Search code examples
c++cprofilinggprof

Performance measuring with prof


Is there a way to run linux's prof in a way equivalent to what a program with -gprof would do? I know wouldn't be exact, but only statistically correct.

I'm basically looking for a way to do a gprof-like analysis on a C/C++ program that includes debug symbols, but without recompiling it.


Solution

  • I'm very satisfied lately by CPU profiler of the Google performance tools. Programs basically run at undistorted normal speed under it. No recompilation is required, linking against a special libraries is recommended but using LD_PRELOAD is also possible in most cases.