What is a good easy to use profiler for C++ on Linux?


Question

I need to profile some code running C++ on Linux. Can you guys recommend some profilers?

1
74
7/22/2009 11:22:46 PM

Use gprof.

Just compile with -pg flag (I think (but am not sure) you have to turn of optimizations though.) and use gprof to analyze the gmon.out file that your executable will then produce.

eg:

gcc -pg -o whatever whatever.c

./whatever

gprof whatever gmon.out

Same thing with g++ and cpp.

36
4/6/2014 10:52:33 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon