English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 20 December 2015, 17:56   #1
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,607
Feature request [Heatmap]....

Never seen this before, but i think a cool idea would be for emulators to have a function to list the biggest loads (i.e. what routines within a game are the most system intensive for emulation).

Obviously its not a must have feature, but doing these ST to Amiga conversions, something like that would be awesome.

I will get back to dreaming
Galahad/FLT is offline  
AdSense AdSense  
Old 20 December 2015, 18:16   #2
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 46
Posts: 1,012
Quote:
Originally Posted by Galahad/FLT View Post
Never seen this before, but i think a cool idea would be for emulators to have a function to list the biggest loads (i.e. what routines within a game are the most system intensive for emulation).

Obviously its not a must have feature, but doing these ST to Amiga conversions, something like that would be awesome.

I will get back to dreaming
Interesting that you mention this! I have been caressing the idea of having some profiling system in UAE. An emulator is indeed perfectly suited for that since it has access to all the needed data.

Even something as simple as keeping a list of all the "memory hot spots" would be super useful to determine which code gets used the most.
ReadOnlyCat is offline  
Old 20 December 2015, 18:41   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,958
I actually have some plans for some kind of memory "heat map" with different colors for different DMA accesses and CPU accesses. 8 bytes = 1 pixel or something like that.
Toni Wilen is offline  
Old 20 December 2015, 18:44   #4
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,607
Quote:
Originally Posted by Toni Wilen View Post
I actually have some plans for some kind of memory "heat map" with different colors for different DMA accesses and CPU accesses. 8 bytes = 1 pixel or something like that.
Galahad/FLT is offline  
Old 21 December 2015, 04:38   #5
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 46
Posts: 1,012
Quote:
Originally Posted by Toni Wilen View Post
I actually have some plans for some kind of memory "heat map" with different colors for different DMA accesses and CPU accesses. 8 bytes = 1 pixel or something like that.
Nice!

Good that you mention that because I was starting to consider peeking at the code lately to see if I could hack in a quick and dirty version of that.

I cannot reliably promise I can offer time for such a feature but do you have any time horizon for it? If I end up actually needing it before you get to work on it I could make an effort to make the code cleaner and submit it. No promises though, my own code is already quite tough to schedule.
ReadOnlyCat is offline  
Old 21 December 2015, 19:29   #6
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 18,304
[offtopic removed]

Big ups on the "memory heat map", sounds really useful for coders!

Last edited by Toni Wilen; 21 December 2015 at 20:05.
Akira is offline  
Old 21 December 2015, 19:39   #7
alexh
Thalion Webshrine
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 11,943
Will the "heat-map" have an option for capture pre-cache? That way routines which don't leave the cache can still be profiled
alexh is offline  
Old 30 December 2015, 20:10   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,958
http://www.winuae.net/files/b/winuae.7z

- Very basic, as usual.
- Enable: "vh" in debugger. (cycle-exact mode must be enabled)
- Automatically adds "null" memwatch break point from 0 to 512k, used to capture all memory accesses.
- First 512k of chip ram only.
- 256x256 pixel matrix, 1 pixel = 8 bytes. (top/left = addresses 0 - 7, top/right = addresses 255*8 - 255*8+7 and so on..)
- Colors are same as in DMA debugger except CPU color was changed to brown from dark grey.
- CPU = all CPU accesses, no separation between opcode and data accesses.
- Each pixel has 32 shades, pixel gets darker each frame if it has not been "accessed".

At least it creates interesting images!

Quote:
Will the "heat-map" have an option for capture pre-cache? That way routines which don't leave the cache can still be profiled
Too early for that.

EDIT: Separate color for CPU instruction (pink) and data accesses (brown).

"Heatmap" shows audio sample playing nicely (red lines). Also game/demo double/triple buffer usage is easy to see (flashing blue = bitplane DMA regions)

Not much CPU code activity, I guess most common routines are short loops except if program has or generates big unrolled loops.

Last edited by Toni Wilen; 31 December 2015 at 12:43.
Toni Wilen is offline  
Old 03 January 2016, 00:40   #9
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 46
Posts: 1,012
Huh, I guess that explains the lack of answer to my proposition to write code.

Thanks Toni!

Will give it a look soon if I can port it to FS-UAE (or if I get un-lazy enough to download WinUAE on my PC ).

A bit related: do you have a roadmap of future features to be released? As I mentioned above there are modifications to UAE that I plan to do (for my own needs) and I would hate to start working on something that you are already working on.

Knowing which features are planned and approximately when they will be worked on would help me not waste time on them.
And conversely it would save you time if you could reuse well written code instead of starting from scratch. As well as reducing the "bus factor" of UAE, which is always a good thing.
ReadOnlyCat is offline  
Old 05 January 2016, 03:54   #10
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 46
Posts: 1,012
Quote:
Originally Posted by ReadOnlyCat View Post
A bit related: do you have a roadmap of future features to be released? As I mentioned above there are modifications to UAE that I plan to do (for my own needs) and I would hate to start working on something that you are already working on.

Knowing which features are planned and approximately when they will be worked on would help me not waste time on them.
And conversely it would save you time if you could reuse well written code instead of starting from scratch. As well as reducing the "bus factor" of UAE, which is always a good thing.
I hope this is not a taboo topic?

Seriously though, it would really help me to have even just a very approximative roadmap.
ReadOnlyCat is offline  
Old 05 January 2016, 10:16   #11
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,958
I forgot and I don't do roadmaps, every time I even try to guess some time frame, it goes totally wrong

Data that current heatmap system collects can be easily used to show "top 10" list of addresses used by CPU instruction fetches or something like that.
Toni Wilen is offline  
Old 05 January 2016, 19:55   #12
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 46
Posts: 1,012
Quote:
Originally Posted by Toni Wilen View Post
I forgot and I don't do roadmaps, every time I even try to guess some time frame, it goes totally wrong
Oh, I understand that. I really meant something like a simple prioritized list of things you think/planyou will be working on next.

Just having that on the WinUAE site or here in a sticky thread would be really useful to avoid stepping on your toes.
ReadOnlyCat is offline  
Old 06 January 2016, 13:08   #13
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,958
Statistics update: "vh" command after enabling it now lists 40 first addresses with most CPU instruction word fetch activity. (Data is cleared after command)

It first finds highest CPU usage in stat data. Then finds all other nearby addresses with same or slightly less (5% less) CPU usage and outputs single line to console with start, end and percentage of total used. Then repeat same 40 lines.

EDIT: Note that list is not fully sorted, the longer the detected address space the worse the list is..

EDIT2: now also accepts two parameters, first parameter: percentage value of how big range is accepted (default 95 = 95% of highest accepted, set to zero to list all address), second parameter is number of lines to output.

I quickly checked some simple intros and demos and most CPU time was nearly always used "loop: btst #6,$bfe001; bne.s loop" main loop, everything else was done in interrupts. How boring..

Next?

Last edited by Toni Wilen; 06 January 2016 at 14:44.
Toni Wilen is offline  
Old 06 January 2016, 15:01   #14
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 46
Posts: 1,012
Quote:
Originally Posted by Toni Wilen View Post
Next?
A rudimentary sorted list of features you have in mind next for UAE so we do not accidentally start doing work which will be wasted because you will release your version by surprise.

Sorry if I am insistent but nobody likes to waste time and even just a tiny amount of predictability helps coordination efforts.
ReadOnlyCat is offline  
Old 06 January 2016, 20:12   #15
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,607
Quote:
Originally Posted by Toni Wilen View Post
Statistics update: "vh" command after enabling it now lists 40 first addresses with most CPU instruction word fetch activity. (Data is cleared after command)

It first finds highest CPU usage in stat data. Then finds all other nearby addresses with same or slightly less (5% less) CPU usage and outputs single line to console with start, end and percentage of total used. Then repeat same 40 lines.

EDIT: Note that list is not fully sorted, the longer the detected address space the worse the list is..

EDIT2: now also accepts two parameters, first parameter: percentage value of how big range is accepted (default 95 = 95% of highest accepted, set to zero to list all address), second parameter is number of lines to output.

I quickly checked some simple intros and demos and most CPU time was nearly always used "loop: btst #6,$bfe001; bne.s loop" main loop, everything else was done in interrupts. How boring..

Next?

Awesome stuff, will give you something more challenging next time
Galahad/FLT is offline  
Old 06 January 2016, 20:42   #16
spud
Registered User

 
Join Date: May 2010
Location: London, UK
Posts: 206
The .7z archive above seems to be asking for a password to extract. Is this correct? If so, what might it be?
spud is offline  
Old 06 January 2016, 21:12   #17
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,958
Quote:
Originally Posted by Galahad/FLT View Post
Awesome stuff, will give you something more challenging next time
There is still possibilities to make it more challenging

Like collecting more data, like if code run runs only in interrupt (and which level).

Quote:
Originally Posted by spud View Post
The .7z archive above seems to be asking for a password to extract. Is this correct? If so, what might it be?
It isn't. Your unarchiver may be too old.
Toni Wilen is offline  
Old 06 January 2016, 21:26   #18
spud
Registered User

 
Join Date: May 2010
Location: London, UK
Posts: 206
Thanks, Toni, you were spot on. I've updated to a newer version.
spud is offline  
Old 06 January 2016, 21:48   #19
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,607
How about setting exclusions? Such as you know that a left button test is high on the heatmap which isnt really what people would necessarily be interested in.

Maybe have an option to isolate all audio or all DMA accesses or you get the idea.
Galahad/FLT is offline  
Old 06 January 2016, 23:11   #20
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,958
Quote:
Originally Posted by Galahad/FLT View Post
How about setting exclusions? Such as you know that a left button test is high on the heatmap which isnt really what people would necessarily be interested in.
Probably not worth the trouble, it is easy to ignore manually.

Quote:
Maybe have an option to isolate all audio or all DMA accesses or you get the idea.
Do you mean listing all addresses that were "hit" by copper only or audio only, blitter only (all, reads only, writes only) and so on? That could be useful.
Toni Wilen is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature request TenLeftFingers support.FS-UAE 12 08 April 2014 21:41
Feature request Galahad/FLT support.WinUAE 5 12 February 2013 20:38
feature request Mad-Matt support.WinUAE 4 25 January 2007 10:22
Feature Request Npl request.UAE Wishlist 5 02 August 2004 22:43
Feature request Fackamato support.WinUAE 48 26 February 2004 18:23

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 06:09.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.38434 seconds with 14 queries