[hatari-devel] Profiling support to Hatari debugger

Jean-Baptiste Berlioz jb.berlioz at freemind-tobe.com
Sat May 1 20:10:30 CEST 2010


Eero Tamminen wrote:
> Hi,
> 
> I was thinking of adding profiling support to the Hatari debugger:
> --------
> 'profile' - profile which part of the code is most used
> Usage:  profile <instruction count> [show count]
>         Runs the emulation a given number of instructions and shows
>         which addresses were most used.
> --------
> 
> I was thinking of implementing most of this functionality outside of Hatari.
> 
> On the Hatari side this would enable SPCFLAG_DEBUGGER flag to catch
> every instruction and pass their PC address outside of Hatari.
> 
> An external program would then process the PC address information,
> count how many times each address is executed and at the end print
> out the most used addresses.
> 
> I was thinking that Hatari could directly invoke the external program
> and feed the data to it through its stdin to avoid huge intermediate
> files and to get the information immediately.
> 
> 
> Future profiling functionality could be:
> * In addition to addresses, give how many cycles was spent at that address
>   so that the program can count which addresses spend most cycles.
> * Pass the loaded (code) symbols addresses to the external program.
>   With this it can list which functions were called most often and how
>   many times.
> 
> (With the additional information about subroutine returns, the external
> program might eventually be even able to construct call graphs[1], but
> I think that quite unlikely. :-))
> 
> Comments?
> 
> 
> 	- Eero
> 
> [1] http://code.google.com/p/jrfonseca/wiki/Gprof2Dot
>      http://code.google.com/p/vcgviewer/
> _______________________________________________
> hatari-devel mailing list
> hatari-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/hatari-devel
> 
> 

This would be a fantastic feature :)

Tobé




More information about the hatari-devel mailing list