add usertrace-fast
[lttv.git] / usertrace-generic / README
index b8c23018bc2f66fed0d23b0ae5ae52cf1aa33fce..b9ac1fb431c5a0861a43d9aaea08a54a0d955e31 100644 (file)
@@ -161,4 +161,33 @@ It will show, for example :
 user_myfacility.myevent: 39507.805584526 (/cpu_1), 15829, 15736,  SYSCALL { "myapp.c", "main", 8, 1234, 0xf0f0f0f0 }
 
 
+* Fun feature : function instrumentation
+
+Here is how to generate a full trace of you program function calls.
+See the sample-instrument-fct.c example program.
+
+- Compile your application with at least these parameters to gcc (it is splitted
+  on two lines, joined by a "\") :
+gcc -g -finstrument-functions \
+  -lltt-instrument-functions -o myapp myapp.c
+
+To see what the final result looks like :
+- Start tracing
+- Start your application
+- Stop tracing
+Then, to see only the function_entry and function_exit events :
+lttv -m textDump -t /tmp/trace1 -e "event.facility=user_generic & (event.name=function_entry & event.name=function_exit)"
+
+It will show, for example :
+user_generic.function_entry: 59329.709939111 (/cpu_0), 19250, 18581,  SYSCALL { 0x8048454, 0x80484c2 }
+user_generic.function_exit: 59329.709944613 (/cpu_0), 19250, 18581,  SYSCALL { 0x8048454, 0x80484c2 }
+
+you can then use (from the binutils package)
+addr2line -e sample-instrument-fct -i -f 0x8048454
+Which shows :
+test_function
+/usr/src/usertrace-generic/sample-instrument-fct.c:12
+
+The lookup in LTTV through libbfd has not been implemented yet.
+
 
This page took 0.023712 seconds and 4 git commands to generate.