1

I am having some trouble profiling a dynamic library, and I can't seem to find anybody who has used sprof.

Does anybody know of an alternative tool that can give a call graph for a dynamically linked library?

Mikhail
  • 7,749
  • 11
  • 62
  • 136
  • 1
    [*Maybe this will help?*](http://greg-n-blog.blogspot.com/2010/01/profiling-shared-library-on-linux-using.html) – Mike Dunlavey Nov 13 '12 at 00:53
  • You can use any modern tool, like: valgrind (with callgrind subtool), gperftools (pprof, cpuprofiler), perf (part of linux kernel, perf.wiki.kernel.org/), oprofile. Any of them should provide call graph. – osgx Nov 13 '12 at 18:58
  • As an additional note, gprof is [unable to profile calls to shared libraries](http://gernotklingler.com/blog/gprof-valgrind-gperftools-evaluation-tools-application-level-cpu-profiling-linux/#conclusion-and-comparison). Apparently gprof combines the samples collected for a shared library function with the samples collected for its caller, so that only the cumulative stats of both are reported, but not individually. – davide Oct 15 '17 at 14:47

1 Answers1

0

The answer was to use valgrind and KCachegrind

Mikhail
  • 7,749
  • 11
  • 62
  • 136