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

From: Thomas Thrainer tom_t at gmx.at
Date: Sat Jan 24 19:17:42 EET 2009
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?

Thanks,
Thomas



More information about the maemo-developers mailing list