Re: Profiling multithreaded C++ code

From: Bruce Stephens (bruce+usenet_at_cenderis.demon.co.uk)
Date: 08/20/03


Date: Wed, 20 Aug 2003 19:17:31 +0100
To: richard.wallace@specastro.com (Richard Wallace)

richard.wallace@specastro.com (Richard Wallace) writes:

[...]

> These are all open source tools. I'd like to stick to that, but if
> someone has a proprietary tool that they think just blows everything
> else out of the water, I'd like to hear about it.

I've been looking at the same. The best (free) solution I've found is
kcachegrind, with the calltree skin to valgrind. There's a
performance hit, obviously, but it works nicely. The documentation to
cachegrind suggests that it's mostly for cache hits and things, but
actually it works as a nice general profiler too.

OProfile is also handy for some things, and works with very low
overhead. But it's a more conventional profiler, so you get all the
problems with that---one nice feature of cachegrind is that you can
get accurate function call counts (which is quite often more
interesting than times).