call graphs in sprof
Pierre Habouzit
madcoder@debian.org
Mon Jul 2 15:44:00 GMT 2007
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20070702/8557a4cc/attachment.sig>
More information about the Libc-alpha
mailing list