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