English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 08 October 2018, 14:37   #1
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Profiling code under WinUAE?

Is there any clever way to profile the 68K code I'm running under WinUAE?

I've written several different implementations of the stuff I'm working on, and the version that I think should be fastest isn't, and it would be great to get some insight into where each version is spending its time, but with a bit more precision and sophistication than I can get by inserting measurement code myself.
deimos is offline  
Old 08 October 2018, 15:53   #2
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,438
Well, there is at least one profiler for Amiga OS: http://aminet.net/package/dev/misc/AProf334

However, as I understand it's meant for C compiled code so I don't know what would happen with assembly programs or C programs with assembly added. Still, it's better than nothing I suppose. As for directly in WinUAE, I don't think there are tools like that. AFAIK most people custom code this stuff, either by using raster timing bars or using the CIA timers.
roondar is offline  
Old 08 October 2018, 16:02   #3
dodke
Registered User
 
Join Date: Feb 2018
Location: London / UK
Posts: 112
Are you coding for plain a500? The cycle exact mode should be quite accurate with that. Even with how active bitplanes / blitter etc affect CPU speed. For measuring speed setting different values in color0 register for different parts of code is common and I generally use that. For small routines you could repeat it.
dodke is offline  
Old 08 October 2018, 16:13   #4
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by roondar View Post
Well, there is at least one profiler for Amiga OS: http://aminet.net/package/dev/misc/AProf334

However, as I understand it's meant for C compiled code so I don't know what would happen with assembly programs or C programs with assembly added. Still, it's better than nothing I suppose. As for directly in WinUAE, I don't think there are tools like that. AFAIK most people custom code this stuff, either by using raster timing bars or using the CIA timers.
Thanks, I've googled that and found it on SourceForge. "can be used with all Amiga development languages that support the standard AmigaDOS symbol hunk format", so it sounds like I could probably use it, but it's not going to get me the level of information I need.

If I could have anything I wanted, I'd like to record what the virtual 68000 is doing at every instruction fetched while it's in my task, then match that up against the 1000 or so lines of code that I'm interested in to get an overview of how my code performs.

Wishes are free, I suppose.
deimos is offline  
Old 08 October 2018, 16:20   #5
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by dodke View Post
Are you coding for plain a500? The cycle exact mode should be quite accurate with that. Even with how active bitplanes / blitter etc affect CPU speed. For measuring speed setting different values in color0 register for different parts of code is common and I generally use that. For small routines you could repeat it.
I'd really like to get more detail than that would allow, and I'd really like it to be more automatic, so I can compare at both a high and low level how my two implementations behave.
deimos is offline  
Old 08 October 2018, 16:29   #6
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,438
Quote:
Originally Posted by deimos View Post
Thanks, I've googled that and found it on SourceForge. "can be used with all Amiga development languages that support the standard AmigaDOS symbol hunk format", so it sounds like I could probably use it, but it's not going to get me the level of information I need.

If I could have anything I wanted, I'd like to record what the virtual 68000 is doing at every instruction fetched while it's in my task, then match that up against the 1000 or so lines of code that I'm interested in to get an overview of how my code performs.

Wishes are free, I suppose.
The only other thing I can think of is looking into non-Amiga specific tools. The 68000 was used in a ton of embedded systems and other applications (still is to some limited degree) and a lot of professional software was made for it.

I'm fairly certain that full profilers and simulators (maybe even with the kind of features you'd like to have) exist in that world.

However, those options might not be affordable (let alone free ). And they also won't let you look at Amiga hardware specifics. So if you want to go that route, you might be able to get the profiler abilities you want, but forget about accessing Amiga hardware.

Oh well, one can indeed dream
roondar is offline  
Old 08 October 2018, 16:42   #7
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by roondar View Post
The only other thing I can think of is looking into non-Amiga specific tools. The 68000 was used in a ton of embedded systems and other applications (still is to some limited degree) and a lot of professional software was made for it.

I'm fairly certain that full profilers and simulators (maybe even with the kind of features you'd like to have) exist in that world.

However, those options might not be affordable (let alone free ). And they also won't let you look at Amiga hardware specifics. So if you want to go that route, you might be able to get the profiler abilities you want, but forget about accessing Amiga hardware.

Oh well, one can indeed dream
That's an interesting idea. The code I'm working on isn't very Amiga-specific, if I took out the code to set up the display and just reserved some pretend bitmap memory then maybe I could use a tool from the embedded world. Except those guys like to charge. A lot.
deimos is offline  
Old 08 October 2018, 17:17   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,574
Profiling would be good fit with new debugger features (http://eab.abime.net/showthread.php?t=91321) but because most of these features are something I don't personally need and/or used: I need multiple good suggestions (which good enough explanation why doing it that way is good idea) before I'll implement it.

Also, at least when doing 68000 code, chipset (and what it is doing) is very important part than CPU which makes profiling for non-expanded configs very non-trivial and make results random-looking..
Toni Wilen is offline  
Old 08 October 2018, 17:55   #9
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
I'd love to see a separate tool next to uaedbg that runs an Amiga executable in a similar way, but on exit outputs a CSV that could be interpreted by tools on the Window's side, or just viewed by braver souls. If it could have enough information to reconstruct the drill-down style interface that you get with, say, Java profilers, that would be awesome, but even starting with the number of cycles spent in each instruction in a way that could be compared to the original source would be enough to be useful.

Quote:
Originally Posted by Toni Wilen View Post
Profiling would be good fit with new debugger features (http://eab.abime.net/showthread.php?t=91321) but because most of these features are something I don't personally need and/or used: I need multiple good suggestions (which good enough explanation why doing it that way is good idea) before I'll implement it.

Also, at least when doing 68000 code, chipset (and what it is doing) is very important part than CPU which makes profiling for non-expanded configs very non-trivial and make results random-looking..
deimos is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
native x86 code in WinUAE? Falk support.WinUAE 20 21 January 2023 18:30
New FS-UAE branches with updated emulation code from WinUAE FrodeSolheim support.FS-UAE 103 21 June 2019 22:39
Profiling WinUAE with Visual Studio 2013 mark_k support.WinUAE 3 14 January 2014 20:26
Calling Windows code from WinUAE is risky! Leandro Jardim support.WinUAE 2 22 January 2012 10:09
editing winuae source code petee1979 Coders. General 2 22 April 2008 04:19

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:57.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08942 seconds with 13 queries