Re: gprof-base Profiling: "no time accumulated"

2009-01-26 Thread Eero Tamminen
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
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: gprof-base Profiling: "no time accumulated"

2009-01-24 Thread Thomas Thrainer
Am Samstag 24 Januar 2009 schrieb Siarhei Siamashka:
> On Saturday 24 January 2009, Thomas Thrainer wrote:
> > Hello,
> >
> > I'm trying to profile an application on the N810 with gprof. I compiled
> > it with -pg, -O3  and -g and linked all the libraries I'm interested in
> > statically (and compiled them also with -pg -O3 -g).
> >
> > The first couple of problems were that I got a floating point exception
> > in scratchbox when starting the program, and a crash on the tablet. Using
> > -fno- unit-at-a-time and -fno-omit-frame-pointer solves the problem on
> > the tablet, it still doesn't run in scratchbox tough. By the way, this is
> > related to -O3, non-optimized build run fine in both scratchbox and on
> > the tablet.
> >
> > My problem is however, that profiling doesn't give any usable results. In
> > the profile written to gmon.out there are all times 0.0. But the call
> > graph and calling count for functions is correct.
> >
> > I tried to strace the application, and profiling seems to work normally.
> > The profiling code sets up the profiling timer, and the SIGPROF signal is
> > received regularly throughout the program run.
> > So I suspect the profiling code, or more precisely the SIGPROF-handler,
> > to not being able to get the currently executing function based on the
> > stack. My program is not spending a lot of time in some library functions
> > or such, most of the time it's usually in some user-functions (I know
> > that based on profiling on my PC).
> >
> > Can anybody shed some light on this issue? To I have to link against some
> > special version of glibc? Or is profiling with gprof broken on ARM's?
>
> IIRC, there might be something wrong with the toolchain in the respect of
> support for -pg option.
>
> 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.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: gprof-base Profiling: "no time accumulated"

2009-01-24 Thread Siarhei Siamashka
On Saturday 24 January 2009, Thomas Thrainer wrote:
> Hello,
>
> I'm trying to profile an application on the N810 with gprof. I compiled it
> with -pg, -O3  and -g and linked all the libraries I'm interested in
> statically (and compiled them also with -pg -O3 -g).
>
> The first couple of problems were that I got a floating point exception in
> scratchbox when starting the program, and a crash on the tablet. Using
> -fno- unit-at-a-time and -fno-omit-frame-pointer solves the problem on the
> tablet, it still doesn't run in scratchbox tough. By the way, this is
> related to -O3, non-optimized build run fine in both scratchbox and on the
> tablet.
>
> My problem is however, that profiling doesn't give any usable results. In
> the profile written to gmon.out there are all times 0.0. But the call graph
> and calling count for functions is correct.
>
> I tried to strace the application, and profiling seems to work normally.
> The profiling code sets up the profiling timer, and the SIGPROF signal is
> received regularly throughout the program run.
> So I suspect the profiling code, or more precisely the SIGPROF-handler, to
> not being able to get the currently executing function based on the stack.
> My program is not spending a lot of time in some library functions or such,
> most of the time it's usually in some user-functions (I know that based on
> profiling on my PC).
>
> Can anybody shed some light on this issue? To I have to link against some
> special version of glibc? Or is profiling with gprof broken on ARM's?

IIRC, there might be something wrong with the toolchain in the respect of 
support for -pg option.

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.

-- 
Best regards,
Siarhei Siamashka
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers