Menu

#424 Create a custom profiler for sections of code.

general
open
nobody
profiling (2)
new feature
2021-11-15
2021-11-15
CB Meeks
No

One useful feature of VICE is the ability to set breakpoints around a section of code.

When the first breakpoint fires, you can type "sw reset" in the monitor to clear out the sw counter.
Then you type "g" to continue.

When the second breakpoint fires, you can type "sw" to get the current cycle count of the routine in question.

A useful feature, in my opinion, is to expand on that and include a "profile" segment.

Then, you could put something like this:

.profile 100
    ....
 .endprofile

What this would do is monitor the section of code an keep track of the cycles taken for each iteration. In this scenario, we have 100 iterations. Then, it could report the AVERAGE number of cycles for each iteration.

This would be very useful for sections of code that do complex branching, etc.

Thanks!

Discussion


Log in to post a comment.

Auth0 Logo