Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Can 'gprof' show profile info on lib routines such as 'malloc'?

Reply
Thread Tools

Can 'gprof' show profile info on lib routines such as 'malloc'?

 
 
Terry
Guest
Posts: n/a
 
      04-05-2008
When I use gprof to profile a program, it seems never show me the
profile info on c lib routines such as malloc. But sometimes, profile
info on such c lib routines are also important.
I use 'gcc -g -pg' to compile the c source. Should I use other options
in order for gprof to show 'malloc'?

Any more suggestions on program profiling?

Thanks!
 
Reply With Quote
 
 
 
 
Antoninus Twink
Guest
Posts: n/a
 
      04-05-2008
On 5 Apr 2008 at 11:35, Terry wrote:
> When I use gprof to profile a program, it seems never show me the
> profile info on c lib routines such as malloc. But sometimes, profile
> info on such c lib routines are also important.
> I use 'gcc -g -pg' to compile the c source. Should I use other options
> in order for gprof to show 'malloc'?


You need to have the standard library compiled for profiling if you want
to get profiling information from standard library functions!

For example, Debian has a libc6-prof package that installs a static
version of the C library compiled for profiling. It's called libc_p.a,
so you need to pass -lc_p to the linker.

 
Reply With Quote
 
 
 
 
Flash Gordon
Guest
Posts: n/a
 
      04-05-2008
Terry wrote, On 05/04/08 12:35:
> When I use gprof to profile a program, it seems never show me the
> profile info on c lib routines such as malloc. But sometimes, profile
> info on such c lib routines are also important.
> I use 'gcc -g -pg' to compile the c source. Should I use other options
> in order for gprof to show 'malloc'?
>
> Any more suggestions on program profiling?


You need to ask on the Linux groups rather than here since this is about
tools not the language. There are various other profilers available
though including oprofile.
--
Flash Gordon
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      04-05-2008
In article <(E-Mail Removed)-gordon.me.uk>,
Flash Gordon <(E-Mail Removed)> wrote:
>Terry wrote, On 05/04/08 12:35:
>> When I use gprof to profile a program, it seems never show me the
>> profile info on c lib routines such as malloc. But sometimes, profile
>> info on such c lib routines are also important.
>> I use 'gcc -g -pg' to compile the c source. Should I use other options
>> in order for gprof to show 'malloc'?
>>
>> Any more suggestions on program profiling?

>
>You need to ask on the Linux groups rather than here since this is about
>tools not the language. There are various other profilers available
>though including oprofile.


Same old, same old. Blah, blah, blah.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ICC using -cxxlib-gcc results in - /usr/lib/crtbeginS.o: No such file --error CoL C Programming 2 08-17-2007 02:40 AM
ICC with -cxxlib-gcc --- results in ld: /usr/lib/crtbeginS.o: No such file error Col C++ 0 08-16-2007 02:18 PM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM
Diff betw common/lib and shared/lib in Tomcat James Yong Java 0 09-12-2005 02:36 AM



Advertisments