Re: FW: Running gprof on gtk demo...
- From: jcupitt gmail com
- To: "Martin, Charles" <cmart dolby com>
- Cc: gtk-list gnome org
- Subject: Re: FW: Running gprof on gtk demo...
- Date: Thu, 8 Apr 2010 09:34:09 +0100
On 7 April 2010 22:13, Martin, Charles <cmart dolby com> wrote:
> Has anyone ever tried to run the GNU profiler on the gtk-demo program? I
> did the following:
Off-topic, but you could try some other profilers too. Linux has some
At a higher level than gprof, sysprof or oprofile will profile the
whole system. They add a kernel module which at some regular interval
(100x a second? something like that, you can tune it) takes a snapshot
of the stack and context. It can show you broadly where time is being
spent, including time in syscalls and in other processes in your
system. This is very helpful for profiling tasks like window resizing
where the performance visible to the user is the result of the
cooperative behaviour of many processes.
At a lower level than gprof, valgrind with the cachegrind plugin will
run your program in a virtual CPU. Performance is not great (about 20x
slower than native), but you can see %cpu figures down to individual
line numbers and see on exactly which lines of code L1 and L2 spills
and misses are occurring.
Neither requires compiling with extra flags, though of course enabling
debugging will help.
] [Thread Prev