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

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


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.


valgrind是一个知名的linux分析器


Zoom from RotateRight ( http://www.rotateright.com ) is what I've been using. It has a butterfly view of functions and you can double-click any function to dive into source or asm code. Build with debugging information (-g) to see your source, but you should still build and profile optimized code.

链接地址: http://www.djcxy.com/p/40376.html

上一篇: 在Python中分析:谁称这个函数?

下一篇: 什么是Linux上用于C ++的简单易用的探查器?