English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 21 December 2022, 16:27   #1
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Instruction instrumentation

Hi,

Is it possible, perhaps using the debugger, to profile instruction counts, by type, for some duration? I don't mean cycle exact or anything, just a set of opcode/count pairs over some time interval.
Karlos is offline  
Old 31 December 2022, 14:34   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
Doing only that would most likely return totally useless results..

How do you define an "instruction"? Counts per unique opcode words would be easy enough but that can't be used to separate all addressing modes. Or do you only need to separate "base" instructions? (MOVE, NOP, SUB etc)

And what about OS routines? Filesystem handlers? Device drivers? You can't detect when you are running OS code and when "your" code easily. One possibility is to use "uaedbg" mode where whole binary gets loaded in normally non-existing RAM space.

Not taking these in account would return totally useless information. Unless program takes over the system.
Toni Wilen is offline  
Old 31 December 2022, 14:47   #3
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Quote:
Originally Posted by Toni Wilen View Post
Doing only that would most likely return totally useless results..

How do you define an "instruction"? Counts per unique opcode words would be easy enough but that can't be used to separate all addressing modes. Or do you only need to separate "base" instructions? (MOVE, NOP, SUB etc)

And what about OS routines? Filesystem handlers? Device drivers? You can't detect when you are running OS code and when "your" code easily. One possibility is to use "uaedbg" mode where whole binary gets loaded in normally non-existing RAM space.

Not taking these in account would return totally useless information. Unless program takes over the system.
I get that, I was looking for something broad strokes on an a CPU bound application that, until recently did take over the system. As for how it's collated, by opcode is fine but I'd be looking to collate that further. I'm looking for the counts of particular time consuming operations, like division.

More ideally, I would like to be able to call a trap of some kind that would initiate the instrumentation and a later trap that would disable it and log it somewhere. The scope of this code is small and doesn't call any library routines between the points I want to instrument. Now any kind of task switch or other interrupt in the duration of the interval will skew the results but it's not particularly likely in this case and I could just as easily invoke Disable() and Forbid() outside the region I'm instrumenting.

Last edited by Karlos; 31 December 2022 at 14:52.
Karlos is offline  
Old 21 January 2023, 18:31   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
Quote:
Originally Posted by Karlos View Post
I get that, I was looking for something broad strokes on an a CPU bound application that, until recently did take over the system. As for how it's collated, by opcode is fine but I'd be looking to collate that further. I'm looking for the counts of particular time consuming operations, like division.

More ideally, I would like to be able to call a trap of some kind that would initiate the instrumentation and a later trap that would disable it and log it somewhere. The scope of this code is small and doesn't call any library routines between the points I want to instrument. Now any kind of task switch or other interrupt in the duration of the interval will skew the results but it's not particularly likely in this case and I could just as easily invoke Disable() and Forbid() outside the region I'm instrumenting.
This sounds doable. Remind me after 4.10.1 is out.
Toni Wilen is offline  
Old 21 January 2023, 23:29   #5
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Quote:
Originally Posted by Toni Wilen View Post
This sounds doable. Remind me after 4.10.1 is out.
Sounds good. I'll try to remember!
Karlos 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
AGA Scroll Instruction Auscoder Coders. Asm / Hardware 9 13 February 2020 10:47
Copper SKIP instruction sparhawk Coders. Asm / Hardware 21 15 January 2020 16:21
Exolon Instruction Manual ransom1122 request.Other 6 18 May 2019 23:32
Please help me: one by one instruction needed JewStrangler support.WinUAE 15 20 September 2010 18:55
$48e70000 instruction Asman Coders. General 5 10 February 2006 23:00

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 14:11.

Top

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