Re: [hatari-devel] Hatari profiler updates and DSP cycle questions |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
On perjantai 01 helmikuu 2013, Douglas Little wrote:
> It is difficult to tell from this code because it is full of unusual
> instructions and I would expect this kind of code to be executed only
> once in a normal program. I don't really know what the code is doing.
> e.g. the 'andi' instruction is immediately before an infinite loop so
> how could it execute more than once, and produce variance? (it shows a
> variance of 2)
Right, one needs to remember that profile disassembly shows the contents of
the memory at the point you ask for the disassembly, where as the profile
data for those memory addresses is from the code executed from them,
*and that code can change*.
This is the the DSP profile from TOS bootup:
-------------------
p:0000 0af080 000040 (06 cyc) jmp p:$0040
0.00% (1, 6, 0)
[...]
p:0040 08f4a8 000004 (06 cyc) movep #$000004,x:$ffe8
0.00% (1, 6, 0)
p:0042 08f4bf 000c00 (06 cyc) movep #$000c00,x:$ffff
0.00% (1, 6, 0)
p:0044 00feb8 (02 cyc) andi #$fe,mr
0.00% (1, 2, 0)
p:0045 08f4a0 000001 (06 cyc) movep #$000001,x:$ffe0
0.00% (1, 6, 0)
p:0047 08f4be 000000 (06 cyc) movep #$000000,x:$fffe
0.00% (1, 6, 0)
p:0049 60f400 007ea9 (04 cyc) move #$007ea9,r0
0.00% (1, 4, 0)
p:004b 319800 (02 cyc) move #$98,r1
0.00% (1, 2, 0)
p:004c 06d100 000050 (06 cyc) do r1,p:$0050
0.00% (1, 6, 0)
p:004e 0aa980 00004e (06 cyc) jclr #0,x:$ffe9,p:$004e
0.03% (50147, 300882, 0)
p:0050 08586b (06 cyc) movep x:$ffeb,p:(r0)+
0.00% (152, 912, 0)
p:0051 0c0051 (04 cyc) jmp p:$0051
99.97% (147068903, 588275608, 0)
-------------------
And this is from TOS bootup + running Doomino (=data for previous mail):
-------------------
p:0000 0c0040 (04 cyc) jmp p:$0040
0.00% (2, 10, 2)
[...]
p:001e 0d004b (04 cyc) jsr p:$004b
0.00% (1, 4, 0)
[...]
p:0040 0500b9 (02 cyc) movec #$00,sr
0.00% (2, 8, 4)
p:0041 08f4be 000000 (06 cyc) movep #$000000,x:$fffe
0.00% (1, 6, 0)
[...]
p:0042 000000 (02 cyc) nop
0.00% (1, 6, 0)
p:0043 08f4bf 000c00 (06 cyc) movep #$000c00,x:$ffff
0.00% (1, 6, 0)
[...]
p:0044 000c00 (02 cyc) movep #$000c00,x:$ffff
0.00% (1, 2, 0)
p:0045 08f4a0 000001 (06 cyc) movep #$000001,x:$ffe0
0.00% (2, 12, 0)
p:0047 08f4a8 000004 (06 cyc) movep #$000004,x:$ffe8
0.00% (2, 12, 0)
p:0049 0000ba (02 cyc) andi #$00,omr
0.00% (2, 6, 2)
p:004a 0c004a (04 cyc) jmp p:$004a
0.00% (10401, 41604, 0)
p:004b 0444bd (02 cyc) movec ssl,x0
0.00% (2, 4, 0)
p:004c 04c4b9 (02 cyc) movec x0,sr
0.00% (2, 8, 4)
p:004d 0aa803 (04 cyc) bclr #3,x:$ffe8
0.00% (1, 4, 0)
p:004e 0aa804 (04 cyc) bclr #4,x:$ffe8
0.01% (50148, 300886, 2)
p:004f 05f420 00ffff (04 cyc) movec #$00ffff,m0
0.00% (1, 4, 0)
[...]
p:0050 00ffff (02 cyc) movec #$00ffff,m0
0.00% (152, 912, 0)
p:0051 0450bb (02 cyc) movec sp,r0
24.37% (122069996, 488279982, 2)
-------------------
Quite a bit has changed, including address 4a.
It seems that the DSP cycles diff column can be used to detect
code areas that have been modified (either self modifying
code or cross-processor modifications :))...
- Eero