Search code examples
c++profilinggprofcall-graph

How to get the call graph of a program with a bit of profiling information


I want to understand how a C++ program that was given to me works, and where it spends the most time.

For that I tried to use first gprof and then gprof2dot to get the pictures, but the results are sometimes kind of ugly.

How do you usually do this? Can you recommend any better alternatives?

P.D. Which are the open source solutions (preferably for Linux or Mac OS )X?


Solution

  • You can try KCachegrind. This is a program that visualizes samples acquired by Valgrind tool called Callgrind. KCachegrind may seem to be not actively maintained, but the graphs he produces are very useful.