trace

How to access a return value of a function that is being traced

两盒软妹~` 提交于 2019-12-23 07:39:04
问题 Is there any way of accessing return value of a function that is being traced by a function specified as exit param to trace? That sounds hard to understand, but I was not able to simplify the question without loosing the information. So here is a simple example. We have a simple function add10 <- function(a){ a + 10 } And some function that we want to be called when call to add10 exits. trace.exit() <- function(){ ... } Tracing is set up the following way. trace(add10, exit=trace.exit) And

jQuery Debugging

梦想的初衷 提交于 2019-12-23 05:40:27
问题 How prevent a debugger (Firebug or PhpStorm in this case) from step in jQuery and its plugins source code and just step over our own code? 回答1: JavaScript debuggers have no way to determine the difference between your code and someone else's code. You're best option is to either set breakpoints before & after the blocks of code you want to skip (say a jQuery selector) so you can use the debuggers Continue feature to skip that external code. Alternatively you can use the debugger statement to

Get syscall parameters with kretprobes post handler

牧云@^-^@ 提交于 2019-12-23 02:58:20
问题 I want to trace with a LKM the sys_connect and sys_accept right after these system calls return. I found that kprobes can give you access to the registers when a probed system call returns, by defining a post handler. My problem is that I don't know how to get the system call parameters from the data that I have in the post handler (i.e. the struct pt_regs) The post handler is defined like that: void post_handler(struct kprobe *p, struct pt_regs *regs, unsigned long flags); 回答1: This

How does ltrace (library tracing tool) work?

ぐ巨炮叔叔 提交于 2019-12-22 18:37:26
问题 How ltrace works? How does it find out that program's calling library functions? Is there any common code path that all calls to library functions come through? Maybe ltrace is setting breakpoint in this common code path? Thanks! 回答1: Dynamic executables have a symbol table used by the linker when resolving references that need to be connected to library functions. (You can see this yourself by running objdump -T /path/to/binary ). This symbol table is accessible by other tools -- such as

Difference between Console.writeline() /trace.writeline()

吃可爱长大的小学妹 提交于 2019-12-22 10:59:53
问题 What is the difference between Console.WriteLine() and Trace.WriteLine() ? 回答1: Look at these from the " Debugging " perspective. We started debugging using Console.WriteLine() Later we got to know it might not be good to print debugging data on console always. We might not even have a console. Then we started using Debug.WriteLine() , which prints my debug information on Visual Studio output window. Then we got to know that we shouldn't print all debug information in release mode, so we

How can I efficiently support Entity Framework SQL logging in production?

流过昼夜 提交于 2019-12-22 08:37:59
问题 We're using Entity Framework 4.0. When we encounter a problem in production, we'd like to be able to temporarily enable logging of all SQL statements. We don't have enough permissions on the production SQL Server to run SQL Profiler. Is there a good logging option that (a) can be turned on and off via a config file setting, and (b) doesn't add significant overhead when it's turned off? I've read about the Tracing and Caching Provider Wrappers for Entity Framework. This sounds good... but it's

Tracing the action of consuming messages from mailbox in Erlang

守給你的承諾、 提交于 2019-12-22 06:39:41
问题 I went through the documentation of the trace/3 BIF in Erlang. However, one observation I have made is that it cannot be used for tracing the consuming of messages from the mailbox. The flag 'receive' only traces when messages are added to a process's mailbox. Is there any way one can trace events such as reading from the mailbox using the receive construct? If not, is there any reason why this isn't possible? It seems very strange that one can trace most kind of events in a program and the

Tracing the action of consuming messages from mailbox in Erlang

不问归期 提交于 2019-12-22 06:39:08
问题 I went through the documentation of the trace/3 BIF in Erlang. However, one observation I have made is that it cannot be used for tracing the consuming of messages from the mailbox. The flag 'receive' only traces when messages are added to a process's mailbox. Is there any way one can trace events such as reading from the mailbox using the receive construct? If not, is there any reason why this isn't possible? It seems very strange that one can trace most kind of events in a program and the

Why does trace(…, edit=TRUE) not work when … = [.data.table

我是研究僧i 提交于 2019-12-22 04:11:27
问题 To temporarily edit the body of a packaged function func , I frequently use trace(func, edit=TRUE) . For some reason, though, R isn't letting me do this when func is [.data.table : ## Note: In this and the other cases below, once an editor pops up, I save and ## and then exit without making any edits to the function. The commented-out ## message below each call to trace() is what is then printed to my R console. trace("[.data.table", where=data.table, edit=TRUE) # Error in .makeTracedFunction

Adding dynamic tracepoint through perf in Linux for function that is not listed

僤鯓⒐⒋嵵緔 提交于 2019-12-22 01:18:00
问题 I am trying to trace function zap_pte_range from mm/memory.c using perf . But function is not listed in the perf probe -F . So is there a way to dynamically trace this function? I.e. with explicitly adding the tracepoint and recompiling the kernel? perf probe -a zap_pte_range gives: [kernel.kallsyms] with build id 33b15ec444475ee7806331034772f61666fa6719 not found, continuing without symbols Failed to find symbol zap_pte_range in kernel Error: Failed to add events. 回答1: There is no such trace