- Compile your application with at least these parameters to gcc (it is splitted
on two lines, joined by a "\") :
-gcc -g -I /usr/src/usertrace-generic -o myapp myapp.c \
- /usr/src/usertrace-generic/ltt-facility-loader-user_myfacility.c \
- /usr/src/usertrace-generic/ltt-instrument-functions.c
+gcc -g -finstrument-functions \
+ -lltt-instrument-functions -o myapp myapp.c
To see what the final result looks like :
- Start tracing
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 { 0
-x8048454, 0x80484c2 }
+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