This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
URGENT: Using gprof on ".so" files
- To: binutils at sourceware dot cygnus dot com
- Subject: URGENT: Using gprof on ".so" files
- From: "Masaoud T. Moonim" <masaoud at mailandnews dot com>
- Date: Fri, 29 Dec 2000 17:13:31 +0530
Hi,
I wanted to profile the 'Xerces-C' suite from Apache using 'gprof'.
Xerces-C comes along with a shared library named 'libxerces-c1_3.so'.
I rebuilt this library with the '-pg' and '-g' options. I used this
library with one of the samples ( this sample was also rebuilt with the
'-pg' and '-g' compile/link time options ). The results of gprof did
not have profiling information for function calls within the library,
it only had profiling for function calls in the sample.
Then I rebuilt the 'Xerces-C' as a static library (.lib) with the
'-pg' and '-g' options, and used this library with the same sample.
This time gprof generated profiling information for all function
calls ( even those within the static library ).
I sent an email to Jay Fenlason explaining to him the above
behaviour and he explained the behavior as follows :
>"I suspect collecting profiling information across the shared
>library interface is problematic at best (and impossible at worst).
>By the time gprof runs, there is no way for it to determine which
>shared libraries were loaded at what memory addresses, which means
>the memory addresses in its table of function call arcs cannot be
>translated back into function names."
I wanted to know the following :
1. Is there any way I can use gprof to profile function calls
within shared libraries ?
2. Are there any tools/scripts that can be used to take the output
of gprof and generate a visual representation ?
3. Is there a 'xgprof' or 'xprofiler' for linux ?
4. Can the granularity for 'time' be reduced ?
Thanks and Regards
Masaoud
P.S.: Merry Christmas and Happy New Year