Meetings/GprofDdd

Debugging and Profiling

I (Milad) gave a talk on profiling codes using gprof and a brief introduction to debugging using gdb/ddd. Dave also gave us a short introduction to using ValGrind to find memory leaks and buffer overruns. The entire talk is available on our youtube site, here.

During the talk I mentioned that there are no tools that graphically represent the output from gprof. It turns out that this is not true - there are a few programs that I managed to find. I've listed some of the options below:

  • Kprof is one tool that seems to be pretty full featured. It can generate hierarchical tables that allow you navigate the gprof output in a more understandable way. It can also make graphical call graphs.
  • gprof2dot.py is another interesting tool. It takes gprof's output and generates are really cool picture that allows you to see which functions call each other and how much time they spend.
  • KCachegrind does not use gprof output, but instead uses ValGrind? behind the scenes to analyze your code. I haven't used it myself, but it seems to be the most well developed of everything I've seen so far.