This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: gprof/sprof and shared libraries...again
- From: "Braman, Paul" <Paul_Braman at tvratings dot com>
- To: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Date: Thu, 4 Apr 2002 16:15:07 -0500
- Subject: RE: gprof/sprof and shared libraries...again
Okay, I did get a little further with the hints from Andrew Cagney.
To profile the calls to my library I made sure I compiled it with -pg.
gcc -pg -fPIC -I. -c -o prof.lo prof.c
gcc --shared -o libprof.so prof.lo
Now, I added the a few options to my call to sprof and seem to be getting
slightly closer...
sprof --flat-profile --graph libprof.so libprof.so.profile
This returns a flat profile that contains the symbol I am looking for, but
the call graph still won't show it like it would with profiling libc.so.6.
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
100.00 0.50 0.50 0 0.00 something
index % time self children called name
0.00 0.00 0/0 <UNKNOWN>
[0] 0.0 0.00 0.00 0 mcount@@GLIBC_2.0 [0]
0.00 0.00 0/0 mcount@@GLIBC_2.0 [0]
Yes, "something" is the symbol I'm looking for, and I get timing on the
call, but it doesn't show up in the call graph. (Note that this much only
works when I *do not* compile my program with profiling. If I do compile my
executable with -pg, my symbol won't even show up in the flat profile
above.)
So, there's something...not sure what, but something.
Paul Braman
x5273