gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > How to profile code on the GBA

#135009 - gazsp - Thu Jul 19, 2007 10:31 am

Hi all,

How exactly do I go about profiling my code for the GBA?

I know normally you'd just run the (-pg compiled) binary and then run gprof on the binary.

Not sure exactly how this would work on the GBA because the executable is running on the target platform, not on the host.

Any help would be much appreciated :-)

Cheers,
Gaz.

#135017 - Dwedit - Thu Jul 19, 2007 12:03 pm

You use visualboyadvance-sdl, which supports profiling. I couldn't get it to work though.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#135020 - gazsp - Thu Jul 19, 2007 12:27 pm

Cool, cheers.

#135049 - gazsp - Thu Jul 19, 2007 7:37 pm

Hi all,

After compiling and linking with -g and -pg, I'm getting loads of undefined references to LP0, LP1 etc.

These appear as labels in the assembled code:

Code:
.LM1:
   push   {r7, lr}
   mov   r7, sp
   .data
   .align   2
.LP0:
   .word   0
   .text
   mov   ip, lr
   bl   mcount
   .word   LP0
.LM2:
   ldr   r2, .L2
   ldr   r3, .L2+4
   str   r3, [r2]


Any ideas what I'm doing wrong?

Cheers,
Gaz.

#135050 - gazsp - Thu Jul 19, 2007 7:55 pm

I've found this

http://forum.gbadev.org/viewtopic.php?t=2431&highlight=gprof

But it doesn't really explain how to get rid of the undefined references. Any ideas anyone?

Cheers,
Gaz.