Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Profiling tool?
2019-02-20 08:44
ChristopherJam

Registered: Aug 2004
Posts: 1409
Profiling tool?

Has anyone come across or written a tool that lets you execute a chunk of 6502 that then reports back a disassembly where each instruction is annotated with the total number of cycles it consumed?

Something like unp64 but with added instrumentation, basically.

Closest a quick google found for me was a tool for generating such reports from logs produced by a hardware bus monitor..
 
... 23 posts hidden. Click here to view all posts....
 
2019-02-22 08:55
Slajerek

Registered: May 2015
Posts: 63
Actually, a profiling tool is messing my mind for some time already. I have a proof of concept view of such cycles counting and display for the C64 Debugger, but it is not in the master branch yet.

Brush/Elysium showed me at X a Champ 65C02 profiler written in Ruby that is able to generate nice profiling reports in HTML, it shows cycle % per detected procedures and utilizes GraphViz for the code flow diagrams.

I changed the source of Champ to be able to feed data generated by my debugger and just Today released the first alpha version of this, it is included in C64 Debugger v0.64.56.4. Although it is not perfect, as still I need to add labels and watches, but it is quite usable even now.

Go to Settings/Emulation, set profiler output file and start profiling for some time. It will create a *.pd file which then you need to feed to C64 Debugger's version of Champ: http://csdb.dk/getinternalfile.php/179301/c64d-champ-v064564.rb

It should generate a report.html which you can view in a web browser. It has some flaws though that have to be noted:
- the cycle counter is a global VIC counter, not the CPU cycle counter, so bad line cycles are also added, I'm going to add a setting to select which cycle counter to use for profiling
- Champ is completely not able to distinguish if we are in IRQ, thus, cycles taken by code run in IRQ are also counted as a procedure code.

Anyway, this is some starting point I am going to develop further. It is not giving cycles % spent per each code address, but the POC for such view is existing and I suspect should be added in some upcoming version of the C64 Debugger soon.
2019-02-22 09:12
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: The scene is full of the greatest minds in the galaxy :D

Now, where's my profiling tool? :P


You know very well that even if there was such a tool publicly available you'd find an excuse to code you own in Python. I bet you've already started. That's how we work.
2019-02-22 12:09
chatGPZ

Registered: Dec 2001
Posts: 11386
didnt micro64 have some profiling stuff in its "ide"?
2019-02-22 15:06
oziphantom

Registered: Oct 2014
Posts: 490
VICE PDB Monitor 1.0 (get the extra files from github as per comments ) has a limited profiler, Martin did it so I'm not a 100% sure how it works. But I think it uses the memmap operations to count how often an address is executed. So its doesn't give you clocks but it does give hotspots. Its open source so if you wish to extend it to be better, feel free ;)
2019-02-22 15:08
chatGPZ

Registered: Dec 2001
Posts: 11386
windows specific hack though, and requires a custom non supported acme hack. meh
2019-02-22 15:16
oziphantom

Registered: Oct 2014
Posts: 490
hack? what hack? It makes no modifications to VICE at all and will even connect to a Linux instance if you set up a tunnel for it. To be clear it only uses the Remote Debugger Protocol to communicate to VICE.

It can use Martin's custom ACME, however ACME is for morons and 64Tass is also supported(with more features) for true sensible people ;)
2019-02-22 15:31
chatGPZ

Registered: Dec 2001
Posts: 11386
Now i'd like to know what cybermodo has to say about this topic :)
2019-02-22 15:42
oziphantom

Registered: Oct 2014
Posts: 490
I can't believe he uses ACME, that would mean he knows assembly...
2019-02-22 16:14
chatGPZ

Registered: Dec 2001
Posts: 11386
Obviously he doesnt - but he'd sure have to say something about it =D
2019-02-22 16:41
oziphantom

Registered: Oct 2014
Posts: 490
you could copy paste it for him to lemon
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Copyfault/Extend^tsn..
Linus/MSL
pcollins/Quantum
kbs/Pht/Lxt
Faayd/Quantum
Mythus/Delysid
t0m3000/hf^boom!^ibx
chancer
Walt/Bonzai
Mike
katon/Lepsi De
Mason/Unicess
Freeze/Blazon
Guests online: 111
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.051 sec.