views:

34

answers:

1

I've been searching for a Linux sampling profiler, and callgrind has come the closest to showing useful results. However the overhead is estimated at 20--100x slower than normal. Additionally, I'm only interested in time spent per function (with particular emphasis on blocking calls such as read() and write(), which no other profiler will faithfully display).

  1. Is there a way to turn off excess options, so that just the minimum data is recorded for generating times spent in various call stacks?
  2. Does callgrind's cachegrind heritage imply that excess stuff is being done with regards to cache profiling etc?
  3. I assume callgrind operates like a debugger. Can this be adjusted to sample the process at intervals, rather than every single instruction?
A: 

Have you tried gprof ? It does not have the big overhead as valgrind do.

Zitrax
Unfortunately gprof does not do sampling, it _only_ counts _CPU_ time for instrumented functions. (Feel free to correct me if you know better but this is what I understand).
Matt Joiner