topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 19, 2024, 6:05 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Debugging gems: runtime code profiling in Linux - KCacheGrind  (Read 4589 times)

Gothi[c]

  • DC Server Admin
  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 873
    • View Profile
    • linkerror
    • Donate to Member
I recently stumbled upon the (so far) best FOSS runtime code profiling tool I ever tried: KCacheGrind

It is really a front-end for the common *nix debugging tool valgrind, but the way it visualizes the data makes the valgrind actually allot more usable.

You can navigate through the call graph tree, go into different levels and subtrees, view how much time was spent in each function, detect memory leaks, bugs, etc,...

A nice addition to my debugging arsenal, I thought I would share ;)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Debugging gems: runtime code profiling in Linux - KCacheGrind
« Reply #1 on: January 30, 2007, 05:56 AM »
Thanks a lot!!
Valgrind can become quite hard to understand, i hope this'll help. It sure does look good  :Thmbsup:

Gothi[c]

  • DC Server Admin
  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 873
    • View Profile
    • linkerror
    • Donate to Member
Re: Debugging gems: runtime code profiling in Linux - KCacheGrind
« Reply #2 on: January 30, 2007, 06:08 AM »
Be sure to read the manual to get the most out of it ;)

to produce the output needed for KCacheGrind, run:
valgrind --tool=callgrind ./yourprogram

+ any other options you want to pass to valgrind

Then open the produced yourprogram.out.12345 file with KCacheGrind.

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: Debugging gems: runtime code profiling in Linux - KCacheGrind
« Reply #3 on: January 30, 2007, 07:24 AM »
That's a pretty sweet find. Thanks for pointing it out.