[maemo-developers] gprof-base Profiling: "no time accumulated"

From: Eero Tamminen eero.tamminen at nokia.com
Date: Mon Jan 26 14:12:44 EET 2009
Hi,

ext Thomas Thrainer wrote:
>> On the other hand, do you really need to use gprof? Profiling on N810 can
>> be done with oprofile, which covers all the gprof functionality and
>> provides a lot more features. Please check the following page:
>> http://maemo.org/development/tools/doc/diablo/oprofile/
>>
>> If you think that for your specific case gprof is better and doubt that
>> oprofile can handle it well, please describe what exactly you want to do.
>> I'll try to advice something.
> 
> I tried oprofile, and it worked nicely for me. I actually wanted to use gprof 
> because I used it on my development machine too and I wanted to use the same 
> tool in order to get comparable results.
> But anyway, now I have my profiling results, so thanks for the tip.

On development environment I'd recommend using valgrind/callgrind
and viewing the results with Kcachegrind:
http://www.valgrind.org/docs/manual/cl-manual.html
http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/KcacheGrindShot

Valgrind is a bit slower and works only on x86, but in all other
respects this tool combination is way better for analyzing program
performance than gprof.

My recommendation:
- Adding measurements to the software & running those on device
   (without measurements, optimization is pretty pointless)
- First using CPU and oprofile on device to get system bottlenecks
- Then analyzing those bottlenecks with x86/Sbox[1] using
   Valgrind/Callgrind & Kcachegrind

[1] This assumes that the same source code is used on ARM and x86.


For the Maemo Sbox environment, the maemo-debug-scripts package offers
some useful wrappers for running things (like "run-with-callgrind").


	- Eero

More information about the maemo-developers mailing list