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.

DS development > Profiling on the DS [Tutorial]

#167782 - albinofrenchy - Fri Mar 27, 2009 9:37 am

I've written a tutorial on profiling apps on the DS using simonjhall's code given previously.

If this is something people find helpful, I'll do more; probably one on the desmume-gdb tool for starters. Tell me what you think! For people who end up going through it and using it, please tell me how it could be better. If you got caught up somewhere, I can help that too.

#167786 - hacker013 - Fri Mar 27, 2009 3:53 pm

you are saying that you must rename resolve to resolve.py (.py is a pythom script) and then you say that you must install perl, .pl is a perl script :) The rest of the tutorial is very usable, I only don't get it how to use resolve.py.
_________________
Website / Blog

Let the nds be with you.

#167787 - elhobbs - Fri Mar 27, 2009 4:35 pm

hacker013 wrote:
you are saying that you must rename resolve to resolve.py (.py is a pythom script) and then you say that you must install perl, .pl is a perl script :) The rest of the tutorial is very usable, I only don't get it how to use resolve.py.
the extension on the script file does not matter - but, yes it is a perl script. go back and reread the tutorial it is in there.

#167788 - elhobbs - Fri Mar 27, 2009 4:51 pm

since cyg-profile can only keep track of so many functions and it adversely effects performance I like to have it only profile the code in certain certain files. so, I change the extension on the files I want to profile to be .clk.c and setup a special rule to compile them. I use the 'magic' makefiles provided by devkitpro so I just add the section to my projects arm9 makefile right after the ds_rules include like so
Code:
include $(DEVKITARM)/ds_rules

%.clk.o: %.clk.c
   @echo $(notdir $<)
   $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -finstrument-functions -mpoke-function-name -c $< -o $@

#167789 - albinofrenchy - Fri Mar 27, 2009 5:11 pm

Quote:
since cyg-profile can only keep track of so many functions and it adversely effects performance I like to have it only profile the code in certain certain files.


Good tip! mind if I add it to the tutorial?[/quote]

Quote:
you are saying that you must rename resolve to resolve.py (.py is a pythom script) and then you say that you must install perl, .pl is a perl script :) The rest of the tutorial is very usable, I only don't get it how to use resolve.py.


Good catch! It is a perl script; I'll change the extension. I got the py from the simonjhall post, but it could be just a typo there.

#167790 - elhobbs - Fri Mar 27, 2009 5:24 pm

albinofrenchy wrote:
Good tip! mind if I add it to the tutorial?

go for it