LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Best way to trace library calls in C on SUSE using glibc 2.9 (https://www.linuxquestions.org/questions/programming-9/best-way-to-trace-library-calls-in-c-on-suse-using-glibc-2-9-a-834793/)

mrbarritt 09-27-2010 02:18 PM

Best way to trace library calls in C on SUSE using glibc 2.9
 
We recently ported an application over from IRIX to Linux, specifically SUSE Enterprise 11 and gcc (glibc 2.9).

On IRIX there was a library trace utility call 'par' that allowed me to execute a C program and trace all the library calls it made, tracking how much time was spent in each call. I have been trying to find something similar for SUSE. I have found the ?trace programs (strace, ltrace, and ktrace) none of which is default installed on SUSE 11.

Does any one have a suggestion on which ?trace to install and use or is there something else out there better?

tronayne 09-28-2010 07:53 AM

Well, there's useful and then there's useful -- kind of depends...

There is grpof (which you should have by default). You compile with the -pg option (and don't strip, the -s option!), execute, and examine the result with gprof. Lots and lots of optional output to look at and it may fit your needs.

strace is also good and may be a good choice (the other *trace utilities I'm not familiar with). It may also be overwhelming until you get used to it.

I'd try both, see what you get and decide from there.

Hope this helps some.


All times are GMT -5. The time now is 04:51 PM.