call graphs in sprof

Arvind Ayyangar arvind.ayyangar@gmail.com
Tue Jul 3 06:01:00 GMT 2007


Thanks. i installed libc6-dbg and the call graph does give me more
information. But I still find symbols name <UNKNOWN> in the call
graphs.

I created two small libraries to check if inter library calls are
displayed. I compiled the libraries with `-g -pg` option to enable
profiling.  On profiling the library, I get the following output..

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        3     0.00           fun

index % time    self  children    called     name

[0]      0.0    0.00    0.00        0         mcount@@GLIBC_2.0 [0]
                0.00    0.00        3/3           fun [2]
-----------------------------------------------
                0.00    0.00        3/3           <UNKNOWN>
[2]      0.0    0.00    0.00        3         fun [2]
-----------------------------------------------


the code for the library is:
#include <stdio.h>
static void
do_nothin ()
{

}

void
fun()
{
        int i;
        printf ("\nIn function fun.");
        for (i=-1;++i<3;)
                foo();
        do_nothin();

}

There is no information about calls to do_nothin() and foo()...

Is there something very basic that I am missing out?


>   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
>
>
-
Arvind



More information about the Libc-alpha mailing list