Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-27-2010, 03:18 PM   #1
LQ Newbie
Registered: Nov 2009
Location: Castle Rock, Co
Distribution: SUSE Enterprise 11
Posts: 3

Rep: Reputation: 0
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?

Last edited by mrbarritt; 09-27-2010 at 03:19 PM.
Old 09-28-2010, 08:53 AM   #2
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use gdb to trace the glibc functions and linux system calls? HolyJoe Programming 8 12-29-2009 06:58 PM
linking library in kernel - what might be the calls library should not be using lakshmi00786 Linux - Kernel 2 07-25-2009 02:30 PM
Unix system calls and c library? goldeneagle1234 Linux - Newbie 2 09-14-2008 10:23 PM
Replacing glibc using linuxthreads for glibc using nptl (native positx thread library CestusGW Linux From Scratch 4 01-20-2005 08:26 AM
tracking library / OS calls chakkerz Linux - General 1 09-01-2003 06:21 PM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration