[hatari-devel] Bugs profiler CPU cycles values

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


Hi,

I found the reason for the wierd CPU cycles values in profiler.
And why they looked OKish in my profiles, but completely bogus
for Douglas.

It's a bit silly, I should have noticed it before.

CPU cores increase the CPU cycles counter constantly when
DSP is NOT enabled, but give the current instruction cycles
information when DSP IS enabled.

As I had developed & tested the CPU profiling code with ST or with
DSP disabled (for speed reasons), I thought it was monotonically
increasing and wrote profiling code accordingly.  And Douglas of
course wasn't disabling DSP for Falcon when profiling.


I'd like to remove this kind of behavior changes, cycles
counters should always behave the same way.

I.e. I'd like to remove the if line here so that counter is
always reset in CPU cores:
----
                /* Clear M68000 cycle counter */
                if (bDspEnabled)
                        Cycles_SetCounter(CYCLES_COUNTER_CPU, 0);
----

As it's in the CPU main loop, it obviously has some effect
on speed.  Compared to earlier, speed decreases a bit when DSP is
disabled (as it now always updates CPU counter), and potentially
increases when DSP is enabled (as there's one if less).

Comments, or objections to this?


	- Eero



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