[SGVLUG] Linux time profiling tools?

James McDuffie mcduffie at pitfall.org
Fri Dec 13 12:42:18 PST 2013


> I see it mentioned online that Kcachegrind can be
> used to visualize oprofile output, but has anyone tried it?

I have used Kcachegrind with valgrind/callgrind at work a bit. We were
mostly looking for low hanging fruit to trim. We found quite a bit of
stupid things such as initializing large arrays to 0 when it was
unnecessary. Also we found places where we fixed the array ordering to
get better performance out of the processor cache. Mostly it helped us
know where to focus out efforts. I've also run into instances where I
had debugging symbols turned on and optimizations off yet I still can't
see the lines of execution where time is spent in certain functions. But
that was just one or two routines out of a larger program. 

its probably a coarser approach than something that can give you time
per assembly instruction, but it can give you time spent per function
and per line of code. Its visualization takes some time to get used to.
When I used it there did not seem to be a decent way to export its
graphs for manipulation to put them into presentations. Sure you can
turn them into pdfs, but they are very wide and I would have liked to
trim stuff off with a graph editing tool instead of having to do it in
Gimp.



More information about the SGVLUG mailing list