Re: [hatari-devel] profiler cycles (was New WinUAE core issue with Bad Mood)

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


Le 11/12/2014 23:51, Eero Tamminen a écrit :
Hi,

On torstai 11 joulukuu 2014, Nicolas Pomarède wrote:
can you try this quick and dirty patch ? I think it should fix the
cycles counting in the profiler code.

Basically, CyclesGlobalClockCounter is the 64 bit monotonic counter that
get increased after each instruction and that can be considered as the
"main" clock for the emulation (this counter is increased in m68000.h)

Thanks, it seems to fix the assert in profiler.


Do you send a patch or do you want me to do the update ?

With profiler debugging enabled, I'm still getting
"Zero cycles for an opcode" warnings though,
for this kind of instructions:

$06b6ee : 3001  move.w    d1,d0   0.54% (14238, 0, 0)
$06b6f0 : 4840  swap      d0      0.54% (14238, 28856, 0)
$06b6f2 : 2208  move.l    a0,d1   0.54% (14238, 0, 0)
$0200ba : b280  cmp.l     d0,d1   0.27% (7139, 0, 0)
$01fee6 : 4a84  tst.l     d4      0.27% (7139, 0, 0)
$0200b4 : 588f  addq.l    #4,sp   0.27% (7139, 100, 0)
$0210fa : 6708  beq.s     $21104  0.27% (7100, 0, 0)
$0210fe : b082  cmp.l     d2,d0   0.27% (7100, 0, 0)
$021102 : 2400  move.l    d0,d2   0.27% (7100, 368, 0)

As you can see from above, some of them have never
gotten cycles, some have somethings (cycles is second
number in parenthesis).

This how larger piece of code around them can look like:

$06b6e6: 4c39 0401 000e 9ae4 mulu.l  $e9ae4,d0,d1 0.54% (14238, 228768, 0)
$06b6ee: 3001                move.w  d1,d0        0.54% (14238, 0, 0)
$06b6f0: 4840                swap    d0           0.54% (14238, 28856, 0)
$06b6f2: 2208                move.l  a0,d1        0.54% (14238, 0, 0)
$06b6f4: 4e75                rts                  0.54% (14238, 228296, 0)

Is it really possible that move.w and move.l above
don't consume any cycles?

No, this is not possible.
But in Hatari, as we simulate higher clock speed by dividing cycles by 2, 4 or 8, this could yield 0 in some cases.

What freq are you using for the cpu ? Can you try if you force it to 8 MHz ?
If you add --trace cpu_all when executing $06b6e6 to $06b6f4, can you send the result ?

Nicolas




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