Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
dsp profiling patch for Hatari
Posted by: dml Feb,27.2014-14:04 

Here's a patch I made for Hatari a while ago, which adds useful detail to DSP profiling disassembly.

https://dl.dropboxusercontent.com/u/12947585/dspprofext.diff

It was originally made against Hatari v1.6 but have rebased it against v1.7 so it should apply easily.


What does it do? You get more useful detail on instruction timing/cost and special cases like external memory penalties. It provides higher precision results for usage and cycle times. It is formatted more formally with prefixes to make data mining and calculation easier when pasted into Excel.

A sample of output can be found here:

https://dl.dropboxusercontent.com/u/12947585/dspsample.txt


A typical profile packet looks like this:

<address> (X:Y) <opcode> u:00.00189% c:00.00258% (U: 2315 avC:6.00 avE:0.00 V:0)

u: instruction usage as a percentage of total profiled instructions
c: cycle usage as a percentage of total profiled time
U: actual (absolute) usage for this instruction (total hits)
avC: measured average cycles for this instruction
avE: measured average external memory penalty for this instruction
V: peak variance seen in terms of cycles (e.g. 2 = execution time varied by 2 cycles worst case during profile run) note that this can also cause non-integer averaged cycle measurements for any instruction.

External memory penalties occur when an opcode tries to read twice from external ram in the same operation. This isn't always easy to guess if the program is complex because it depends on the location of the opcode, and the source address of the data reads taking place, of which there could be two. The penalty can also vary if the address changes. It's nice to actually see that happening in profile results, especially if its part of a tight loop and could suggest reorganizing code or sources.

The figure in brackets e.g. (X:Y) before the opcode may be unreliable in this version of the patch but will update if/when I find a problem. it used to show the same cycles/penalty information but for the *last* execution only (instead of average of all executions). I didn't find this field essential at all - the other info is usually enough to find and optimize stuff.












[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
dsp profiling patch for Hatari dml Feb,27.2014-14:04
  Re: dsp profiling patch for Hatari dml Feb,27.2014-15:55
  Re: dsp profiling patch for Hatari dml Feb,27.2014-16:04


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson