Re: [hatari-devel] Code execution discontinuities and detecting them?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 15/03/2013 23:13, Eero Tamminen a écrit :
Hi,

On maanantai 25 helmikuu 2013, Douglas Little wrote:
I think it should be possible to filter out interrupt enter/exit events
appearing like normal program flow changes / calls in a reliable way - if
some of the CPU context is made available in the profiling data (either
the status register or some housekeeping info belonging to UAE).

You can try to identify via the last instruction, but you could perhaps
get unlucky and have an interrupt occur in the wrong place, causing a
bogus link in your callgraph. This seems like a very rare occurrence but
when you're dealing with capture over many seconds, even rare things
happen frequently enough to contribute confusion (some of this can even
be seen in the last DOT example)
Does DSP have also this kind of interrupts?

Yes, you can program interrupts in the DSP for HOST transfers or SSI transfers for example. The 68030 can also interrupt the DSP (via the host port) and let him interrupt to execute some specific code before returning to the main routine.


Btw. I've thought of counting cycles, i-cache misses etc for a subset
of the tracked calls.  It can be done for subroutine calls, by saving
the values when the call is done, and storing difference to current
values when the call returns.

For this to work also for DSP, I need to know what are DSP subroutine
call instructions, subroutine call return instruction(s) and their
opcodes.

For the DSP subroutines, instructions are :

rts : as on the 68030.

JSCC : jump to subroutine under a condition
JSCLR : Jump to Subroutine if Bit Clear
JSSET : Jump to Subroutine if Bit Set
JSR : jump to subroutine


For the opcodes, there are many opcodes for each of these instructions :

The easiest : RTS

00000000 00000000 00001100


JSCLR :

00001011 01MMMRRR 1S0bbbbb
00001011 00aaaaaa 1S0bbbbb
00001011 10pppppp 1S0bbbbb
00001011 11DDDDDD 000bbbbb


JSCC :

00001111 CCCCaaaa aaaaaaaa
00001011 11 MMMRRR 1010CCCC


JSR :

00001101 0000aaaa aaaaaaaa
00001011 11MMMRRR 10000000


JSSET :

00001011 01MMMRRR 1S1bbbbb
00001011 00aaaaaa 1S1bbbbb
00001011 10pppppp 1S1bbbbb
00001010 11DDDDDD 001bbbbb


Hope this helps,
regards

Laurent




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/