Performance Profiler - A first attempt

Page 7/8
1 | 2 | 3 | 4 | 5 | 6 | | 8

By Manuel

Ascended (17879)

Manuel's picture

23-03-2020, 17:16

You can just use the installer as published on https://openmsx.dev/ e.g. https://openmsx.dev/builds/windows/x64/
That's a full installer, no need to do any manual copying. Only copy your own custom Tcl files.

By salutte

Master (134)

salutte's picture

02-04-2020, 23:08

What a Rabbit's hole...

The renewed profiler should be pretty much functional, but the GUI is growing an order of magnitude larger. I'm learning a lot of TCL, but now that the project is so big I'm spending too much time debugging.

It is possible to know at which line/file do errors occurr, specially on boot? It would speed up my current workflow quite a bit.

By Manuel

Ascended (17879)

Manuel's picture

02-04-2020, 23:27

Try set $errorInfo

By salutte

Master (134)

salutte's picture

03-04-2020, 07:16

Yup, the problem was that the error happened during boot, and OpenMSX launch aborted, thus I had no access to the console. But loading the profiler scrip within a catch , and inspecting $errorInfo afterwards, solved the issue.

Thanks!

By salutte

Master (134)

salutte's picture

10-04-2020, 11:50

This is the current development version.

Function calls are auto-detected in realtime. The name shown is the call address + a hash, so that functions in different banks that share the call address can be differentiated.

There is a limited window manager with support for buttons, toggle buttons, scroll bars, minimization, etc...
The control buttons are toggable, but not working yet.

While the profiler main functionality is mostly finished, a lot of work is still missing in the interface: renaming function calls, add/remove break points, undock windows so that you can visualize multiple windows, list a number of previous function call logs, so that you choose which timeline to visualize and not only the last one, etc...

A current problem I am facing is about input controls. While I am only capturing mouse events, I found that games do not respond to my key presses if the GUI is active. I also need to see how to deal with overlapping windows (right now events will affect all windows).

By Bengalack

Champion (384)

Bengalack's picture

03-05-2020, 19:51

@salutte how's the timeline-profiler coming along? Smile

By aoineko

Master (154)

aoineko's picture

05-02-2021, 01:39

What a great tool!
Thank you Grauw & salutte Smile

By aoineko

Master (154)

aoineko's picture

06-02-2021, 00:09

I'm a bit lost between the TLC script versions of Grauw and Salutte.
For the moment, I'm using the Salutte version with the definition of sections via I/O port access.
With a profile::section_scope_bp frame 0xFD9F; profile_osd p; I can see in the OpenMSX overlay all the functions I want to measure, but the numbers I get (whatever the unit), are not at all consistent with what I observe via other profiling methods. For example, some functions that I know to be very expensive have very low values, or even 0.
Are there any known issues?
Is the fact that my gameplay loop lasts several display loops a problem?
The duration of my gameplay loop seems consistent, but not the duration of its sub-functions.
Is the script supposed to handle nested functions well?

I thought to test Graw's version of the script, but I didn't understand the new method that replaces the declaration of sections using I/O ports.

By Grauw

Ascended (9824)

Grauw's picture

06-02-2021, 00:42

You can also use the older version of my script which I shared in this post, which is triggered by I/O.

By Bengalack

Champion (384)

Bengalack's picture

06-02-2021, 18:04

I've been using the original tool with the min/avg/max-stats. It's absolutely great, and I have been using it a whole lot. In my set of tools, I think the order by usage... is like this:

1. VSCode with z80 extensions (syntax highlighting + clock cycle and byte count)
2. Code generation: SDCC for C-code and asz80 for assembly
3. openMSX for run
4. profiler script
5. openMSX debugger
... and then all the others. In other words: Very high up on the list.

I've been wanting to have timeseries-graphs for a set of functions. Plus adding up some of the series as well. Would have been great to easily spot when multiple functions/routines accidentally end up spending way too much time in the exact same frame, and then seing why. I actually tried to look into tcl, but I get lost every time. For some reason tcl is totally alien to me :-(

Maybe one day. Maybe one day... Smile

Page 7/8
1 | 2 | 3 | 4 | 5 | 6 | | 8