This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: call graphs in sprof


On Mon, Jul 02, 2007 at 12:53:57PM +0530, Arvind Ayyangar wrote:
> Hi,
>  I have a little library (libfun.so) which calls routines in two
> other libraries (libfoo.c and  libc.so.6). I have a program which
> links to this little library. I tried to profile the library and using
> sprof.
> The output of sprof is as below:
> 
> Flat profile:
> 
> Each sample counts as 0.01 seconds.
>  %   cumulative   self              self     total
> time   seconds   seconds    calls  us/call  us/call  name
>  0.00      0.00     0.00        1     0.00           fun
> 
> index % time    self  children    called     name
> 
> [0]      0.0    0.00    0.00        0         printf@@GLIBC_2.0 [0]
>                0.00    0.00        1/1           fun [2]
> -----------------------------------------------
>                0.00    0.00        1/1           <UNKNOWN>
> [2]      0.0    0.00    0.00        1         fun [2]
> -----------------------------------------------
> 
> 
> The call graph gives me information about calls to glibc
> {printf@@GLIBC_2.0 [0]} but provides no information about calls to
> library libfoo.so.
> 
> Also, what does the <UNKNOWN> in the output above mean? Does it refer
> to the function calling it (viz main) or the function foo that it
> called..

  It means that your libc is built without debug symbols, so that the
profiler cannot know what's going on in your libc. Worse, if you're
using a gprof based method, it would also need your libc to be built
with profiling enabled, a thing that almost no distributions give.  But
sysprof/oprofile-like tools do not need that rebuild, so use them :)

  If you use a debian based distribution, libc6-dbg holds the debug
symbols of the libc.
-- 
ÂOÂ  Pierre Habouzit
ÂÂO                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]