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


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


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