Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good c++ profiler for GCC

Tags:

c++

profiling

I tried to find a related question but all previous questions are about profilers for native c++ in windows. I googled a while and learned about gprof, but the output of gprof actually contained lot of obscure internal functions. Is there a good opensource c++ profiler with good documentation?

like image 822
Boolean Avatar asked Dec 27 '09 03:12

Boolean


People also ask

Does gprof work for C++?

GProf is a GNU tool that provides an easy way to profile your C/C++ application and find the locations that require work. Using GCC, you can generate profile information by compiling with a special flags. The source code has to be compiled with the -pg option.

What is profiler in C?

The C Profiler tool enables the collection and display of execution profile data on C software source code bases of arbitrary size. It is a member of SD's family of Profiler tools.

What is gprof tool?

Gprof is a performance analysis tool used to profile applications to determine where time is spent during program execution. Gprof is included with most Unix/Linux implementations, is simple to use, and can quickly show which parts of an application take the most time (hotspots).

How does gprof work?

Essentially gprof will change the executable of your program (this is called instrumenting the code) to store some book-keeping information, e.g. how many times a function is called. The statistical profiling bit comes from snooping the program counter regularly to get a sample of what your code is doing.


1 Answers

Valgrind

I totally recommend this http://en.wikipedia.org/wiki/Valgrind

like image 170
iamslash Avatar answered Oct 12 '22 01:10

iamslash