X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=usertrace-generic%2FREADME;h=b9ac1fb431c5a0861a43d9aaea08a54a0d955e31;hb=b09f3215c7a82327f4e572ad252ebf285ffe4707;hp=b8c23018bc2f66fed0d23b0ae5ae52cf1aa33fce;hpb=51a4c0d0e33332b3ae29d40a483f7e49d67a5949;p=lttv.git diff --git a/usertrace-generic/README b/usertrace-generic/README index b8c23018..b9ac1fb4 100644 --- a/usertrace-generic/README +++ b/usertrace-generic/README @@ -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. +