![]() |
![]() |
#1 |
Registered User
Join Date: May 2022
Location: Canada
Posts: 149
|
winUAE - Is there a profiler
Hi everyone,
Alongside the useful features of the WinUAE debugger, is there a way to profile code? What I would have in mind could be something as simple as setting up "dummy marker instructions", a bit like some use move 4,4 to place a no-side-effect instruction that can be used as an easy to remember breakpoint with "w 4 4". My question would something similar which a tool could intercept and start calculating time/clock cycles/etc between the next occurence of that same marker. This would allow monitor and graphing in realtime the performance for multiple section of a game main loop, without having to introduce the couting and printing code directly in the Amiga code. Maybe as a broader question: what could I use for profiling my game? (i.e.: mainly for games that are not tied to the vertical sync and could have a main loop taking multiple frames, thus making for color 0 marker bars inconvenient). Many thanks, as always! |
![]() |
![]() |
#2 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,301
|
Bartman's VSCode extension has something like that built in: https://marketplace.visualstudio.com...ss.amiga-debug
I usually just use a couple of counters displayed on screen, since that also works when running on real HW. Exactly like here: https://eab.abime.net/showthread.php?t=116656&page=3 Also just looking at the DMA debugger visualization usually gives a very good idea of where chip cycles are spent. I have also occasionally done custom builds of WinUAE to do custom profiling (though that was for "whdload speedup projects", not A500 512+512 stuff). |
![]() |
![]() |
#3 |
German Translator
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 50
Posts: 214
|
What you can do is run from a starting point (e.g. breakpoint) with fi nop (or something else) to a stop marker 'nop'.
The debugger stops each time this 'breakpoint' is reached and displays the number of cycles and the scanline progress. If there are several frames, you can find out the difference with the c command. https://eab.abime.net/showpost.php?p...32&postcount=5 Code:
>g Breakpoint 0 triggered. Cycles: 4194303 Chip, 8388607 CPU. (V=105 H=0 -> V=105 H=26) ... >fi nop Cycles: 13212 Chip, 26424 CPU. (V=105 H=26 -> V=163 H=72) VPOS: 163 ($0a3) HPOS: 072 ($048) COP: $0002388c ... 00026786 4e71 nop Next PC: 00026788 >c ... DMACON: $23f0 INTENA: $202c ($202c) INTREQ: $0068 ($0068) VPOS: 163 ($0a3) HPOS: 072 ($048) ... Average frame time: 13418323.71 ms [frames: 5004 time: -727553002] > |
![]() |
![]() |
#4 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,755
|
You could read the CIAB TOD counters before and after a block of code, and compare it to the corresponding length of a frame (not vblank)?
Dividing the time for a block of code into the length of a frame would then give you a percentage of a frame spent on that block. Note that the resolution is in HSync ticks. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
WinUAE crashes when I want to add a hard drive (WinUAE 4.9.1 64 bit / Windows 10 21H2 | Madusch | support.WinUAE | 2 | 12 May 2022 21:04 |
WinuAE + ADF-copy __ Read Real AmigaFloppy with WinUAE | Giants | support.WinUAE | 14 | 02 May 2019 11:17 |
C profiler Aprof or other | arti | Coders. C/C++ | 8 | 10 March 2018 21:15 |
Recently changed WinUAE folder, now getting Arabuusimiehet.WinUAE error | Foebane | support.WinUAE | 9 | 09 September 2016 20:03 |
Profiler | Tiddlypeeps | Coders. General | 3 | 19 April 2010 06:53 |
|
|