Re: C++ runtime profiling



Amit Gupta <emailamit@xxxxxxxxx> writes:

I wonder if there are other good open-source runtime profilers for C+
+. My minimal knowledge indicates either gprof and to some extent
cachegrind (little different). What other tools are out there? Is
gprof the best out there for free profilers? Please, open-source and
free tools are important keywords in my message.

oprofile [1] is a very useful whole-system profiling tool, particularly
if you're using 32-bit x86 Linux. It can identify which processes are
using the most CPU cycles, and can drill down as far as individual
instructions. You can also set it to look for specific other things
(e.g. branch mispredicts). The upside is that you can run unmodified
code under it; the major downsides are requiring Linux kernel support
and not being able to gather exact call-profile statistics (gprof I
belive logs every call in addition to taking periodic samples).

You mention cachegrind; I wouldn't even attempt to use any of the
greater valgrind tool suite for any sort of performance testing, since
it works by emulating the entire machine with hooks for plug-ins to do
extra work, most frequently checking that memory accesses refer to
initialized memory. If you're sure that cache misses are your
performance problem it might be helpful, but I don't know how you'd
determine that without starting with a broader profiler.

[1] http://oprofile.sourceforge.net/

--dzm
.



Relevant Pages

  • Re: code profilers?
    ... > Cachegrind is a valgrind tool that does execution profiling similiar to ... > gprof but better. ... How to find out with cachegrind where program spends 80% time? ...
    (comp.programming.threads)
  • C++ runtime profiling
    ... I wonder if there are other good open-source runtime profilers for C+ ... My minimal knowledge indicates either gprof and to some extent ... gprof the best out there for free profilers? ... free tools are important keywords in my message. ...
    (comp.compilers)