I'm new to ltrace.
- I'd like to use wildcards (patterns) to trace function calls, but they don't seem to work as they should, based on the web pages I see, e.g. http://man7.org/linux/man-pages/man1/ltrace.1.html
E.g. this works:
ltrace -c -e "XDrawLine" -p 10876 ^C
% time seconds usecs/call calls function
------ ----------- ----------- --------- --------------------
100.00 4.925592 501 9829 XDrawLine
------ ----------- ----------- --------- --------------------
100.00 4.925592 9829 total
But this matches nothing:
trace -c -e "XDrawLin*" -p 10876
^C
% time seconds usecs/call calls function
------ ----------- ----------- --------- --------------------
------ ----------- ----------- --------- --------------------
100.00 0.000000 0 total
Also, no luck with -e "/XDrawLin.*/"
or -e "XDrawLin.*"
either.
Any working example is appreciated.
- If this is sorted out, I'd like to move on to how to trace on C++ lib symbols, shall I use mangled or demangled format ?
The functionality of the
-e
switch evolved overltrace
releases. Even fairly recent Linux releases frequently shipped an older ltrace, and that’s most likely is the issue for you. (For example, RHEL6 if I remember correctly, ships with version 0.5.) Runltrace --v
and make sure you have version 0.7 and above.http://anonscm.debian.org/gitweb/?p=collab-maint/ltrace.git;a=blob_plain;f=NEWS;hb=0.7.3
If you have an older ltrace - update it with your package manager or download it from http://freecode.com/projects/ltrace