[maemo-developers] oprofile on ARM

From: Alberto Mardegan mardy at users.sourceforge.net
Date: Sun Apr 11 10:46:41 EEST 2010
Hi all,
   again I've tried to profile Mapper on the N900, with no results. 
First I tried gprof, but it gives me all 0.0 times (and a google search 
reveals that this is a common problem in maemo, even though I didn't 
find an explanation of it); then I tried oprofile, which gives me an 
output like this:

samples  %        image name               symbol name
3007     38.3497  no-vmlinux               /no-vmlinux
1083     13.8120  libclutter-eglx-1.0.so.0.8.0 
424       5.4075  libc-2.5.so              memcpy
336       4.2852  libpng12.so.0.37.0       png_do_expand_palette
317       4.0429  libz.so.1.2.3            /usr/lib/libz.so.1.2.3
286       3.6475  libGLESv2.so             /usr/lib/libGLESv2.so
219       2.7930  ld-2.5.so                do_lookup_x
120       1.5304  libglslcompiler.so       /usr/lib/libglslcompiler.so
55        0.7014  libc-2.5.so              _int_malloc
48        0.6122  libpthread-2.5.so        pthread_mutex_lock
44        0.5612  libpixman-1.so.0.15.3    fbCompositeSolidMask_nx8x8888neon
36        0.4591  libsrv_um.so             /usr/lib/libsrv_um.so
35        0.4464  libc-2.5.so              malloc
35        0.4464  libsqlite3.so.0.8.6      /usr/lib/libsqlite3.so.0.8.6
34        0.4336  libc-2.5.so              memset
34        0.4336  libglib-2.0.so.0.2000.3  g_slice_alloc
32        0.4081  libglib-2.0.so.0.2000.3  g_hash_table_lookup
(I got this output after moving the oprofile collected data into Scratchbox)

But this doesn't help me, as Mapper's own functions appear on the bottom 
of the list and seem to take very little time. I tried to use the "-c" 
option of opreport to see the call graph, but it doesn't seem to be 
working properly, as for every function it gives this output:

336       4.2852  libpng12.so.0.37.0       png_do_expand_palette
   336      100.000  libpng12.so.0.37.0       png_do_expand_palette [self]

It seems it cannot resolve the caller, why?

One more question: how can I see the total time taken by a function? I 
would expect to see the main() function of Mapper at the top of the 
list, as it's clearly the function that takes most time, but it doesn't 
even appear in the list at all.
So I assume that these times are net (that is, the time spend in 
subroutines is excluded from the function times), which might be useful 
in some case, but it definitely prevents me from knowing what functions 
in Mapper need to be optimized...


http://blog.mardy.it <- geek in un lingua international!
More information about the maemo-developers mailing list