trace

Using trace and dbg in Erlang

风格不统一 提交于 2019-11-26 16:58:27
I am trying to start using erlang:trace/3 and the dbg module to trace the behaviour of a live production system without taking the server down. The documentation is opaque (to put it mildly) and there don't appear to be any useful tutorials online. What I spent all day trying to do was capture what was happening in a particular function by trying to apply a trace to module:function using dbg:c and dbg:p but with no success at all... Does anyone have a succinct explanation of how to use trace in a live Erlang system? If you would prefer a graphical tracer then try erlyberly . It allows you to

How to echo shell commands as they are executed

…衆ロ難τιáo~ 提交于 2019-11-26 13:52:35
In a shell script, how do I echo all shell commands called and expand any variable names? For example, given the following line: ls $DIRNAME I would like the script to run the command and display the following ls /full/path/to/some/dir The purpose is to save a log of all shell commands called and their arguments. Is there perhaps a better way of generating such a log? Tom set -x or set -o xtrace expands variables and prints a little + sign before the line. set -v or set -o verbose does not expand the variables before printing. Use set +x and set +v to turn off the above settings. On the first

Trace listener to write to a text box (WPF application)

穿精又带淫゛_ 提交于 2019-11-26 13:08:13
问题 For my WPF application I do logging to a text file using a TextWriterTraceListener. How can I also display the Trace output to a textbox? 回答1: I use this for C# winforms, should be easily adjustable to wpf public class MyTraceListener : TraceListener { private TextBoxBase output; public MyTraceListener(TextBoxBase output) { this.Name = "Trace"; this.output = output; } public override void Write(string message) { Action append = delegate() { output.AppendText(string.Format("[{0}] ", DateTime

How to print the next N executed lines automatically in GDB?

不羁的心 提交于 2019-11-26 12:39:18
问题 I have been trying to find a way for some time to automate the progress in GDB of tracing the control flow of a program. Even just a simple way of automating the n command so you can see in what order routines are called. I realise that you can issues n x where x is the number of times GDB steps through, but the trouble with that is that it shows the command but not the address of the routine! But if you press n manually in GDB (then press return to issue the previous command) it shows the

Does java have any mechanism for a VM to trace method calls on itself, without using javaagent, etc?

家住魔仙堡 提交于 2019-11-26 12:24:22
问题 I want to build call graphs on the fly, starting at an arbitrary method call or with a new thread, which ever is easier, from within the running JVM itself. (this piece of software is going to be a test fixture for load testing another piece of software that consumes call graphs) I understand there are some SPI interfaces, but it looks like you need to run -javaagent flag with them. I want to access this directly in the VM itself. Ideally, I\'d like to get a callback for entry and exit of

Tool to trace local function calls in Linux

折月煮酒 提交于 2019-11-26 11:31:10
I am looking for a tool like ltrace or strace that can trace locally defined functions in an executable. ltrace only traces dynamic library calls and strace only traces system calls. For example, given the following C program: #include <stdio.h> int triple ( int x ) { return 3 * x; } int main (void) { printf("%d\n", triple(10)); return 0; } Running the program with ltrace will show the call to printf since that is a standard library function (which is a dynamic library on my system) and strace will show all the system calls from the startup code, the system calls used to implement printf, and

How can I add a Trace() to every method call in C#?

拟墨画扇 提交于 2019-11-26 08:25:25
问题 I am having a hard time tracking down a lock issue, so I would like to log every method call\'s entry and exit. I\'ve done this before with C++ without having to add code to every method. Is this possible with C#? 回答1: Probably your best bet would be to use an AOP (aspect oriented programming) framework to automatically call tracing code before and after a method execution. A popular choice for AOP and .NET is PostSharp. 回答2: A profiler is great for looking at your running code during

Using trace and dbg in Erlang

假装没事ソ 提交于 2019-11-26 04:58:53
问题 I am trying to start using erlang:trace/3 and the dbg module to trace the behaviour of a live production system without taking the server down. The documentation is opaque (to put it mildly) and there don\'t appear to be any useful tutorials online. What I spent all day trying to do was capture what was happening in a particular function by trying to apply a trace to module:function using dbg:c and dbg:p but with no success at all... Does anyone have a succinct explanation of how to use trace

How to echo shell commands as they are executed

佐手、 提交于 2019-11-26 02:59:28
问题 In a shell script, how do I echo all shell commands called and expand any variable names? For example, given the following line: ls $DIRNAME I would like the script to run the command and display the following ls /full/path/to/some/dir The purpose is to save a log of all shell commands called and their arguments. Is there perhaps a better way of generating such a log? 回答1: set -x or set -o xtrace expands variables and prints a little + sign before the line. set -v or set -o verbose does not

Tool to trace local function calls in Linux

我们两清 提交于 2019-11-26 02:26:56
问题 I am looking for a tool like ltrace or strace that can trace locally defined functions in an executable. ltrace only traces dynamic library calls and strace only traces system calls. For example, given the following C program: #include <stdio.h> int triple ( int x ) { return 3 * x; } int main (void) { printf(\"%d\\n\", triple(10)); return 0; } Running the program with ltrace will show the call to printf since that is a standard library function (which is a dynamic library on my system) and