I use gcc (with option -p) to compile my program which uses shared
libraries. But i cannot find calls of dynamic libraries in my profile.
I generate my shared libraries (xxx.so) with the option -p too.
Is it possible to profile shared libraries?
Thanks
One cheap option is to simply link the libraries static into your
application with the ld option --static.
If you're using glibc as your c library you can export the
variable LD_PROFILE=[libraryname] to tell the dynamic linker to profile the
shared library with this name...
Best see the ld.so man pages, like i.e.
http://www.cs.princeton.edu/cgi-bin/man2html?ld.so.1:1
- Axel Kittenberger
[snip]
Dear "xukg",
Did you try to compile with "-pg" rather than "-p" ? This is what is
specified in gprofs documentation [1].
Is it possible that the time spent in your shared libraries functions
be much less than the profile tick (something like 1/100th of second) ?
In that case, you should either perform many runs (see [2]) and/or try
to force static call graph discovery with gprofs "-c" option (see [3]).
Good luck anyway !
[1] http://www.gnu.org/manual/gprof-2.9.1/html_node/gprof_2.html#SEC2
[2] http://www.gnu.org/manual/gprof-2.9.1/html_node/gprof_22.html#SEC22
[3] http://www.gnu.org/manual/gprof-2.9.1/html_node/gprof_6.html#SEC6
--
Vincent Stehlé StepMind S.A.
DSP system engineer Central Buro, Avenue de Campon
06110 Le Cannet, France