ilmenit Posted March 10, 2009 Share Posted March 10, 2009 Hi, I did a patch for Atari800Win to profile code compiled by CC65. http://img10.imageshack.us/img10/1729/profilerr.png You can find the binary file, source code and a sample here: www.alamak0ta.republika.pl/Atari800WinProfiler.zip You can profile a code written in the assembler, because the C sources are not required. Currently it parses only files generated by CA65, but it can be changed to support XASM or MADS. The GUI viewer on the screenshot is a bit modified GUI of Sleepy profiler: http://sleepy.sourceforge.net/ The profiler has a very simple API and it’s possible to add it to any emulator. Comments are welcome :-) regards, Jakub Quote Link to comment Share on other sites More sharing options...
Cybernoid Posted March 10, 2009 Share Posted March 10, 2009 Ok! Now this looks interesting... I'll give this a try! Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted March 10, 2009 Share Posted March 10, 2009 that's cool... MADS support asap please... Quote Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted March 11, 2009 Share Posted March 11, 2009 Nice! I'm collecting quite a few forks of Atari800win... I must have at least 4 now. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 11, 2009 Author Share Posted March 11, 2009 that's cool... MADS support asap please... - MADS support added. - "C code" type of profiling added. - Project website created: http://www.alamak0ta.republika.pl/profiler.html Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 11, 2009 Author Share Posted March 11, 2009 Version 1.1 is out. A little bug fix in the GUI. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 13, 2009 Author Share Posted March 13, 2009 Version 1.11 is out. - readme.txt extended - paths in sample config files are relative now. You don't have to place the emulator in C:\Atari800WinProfiler anymore. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 13, 2009 Author Share Posted March 13, 2009 1.20 - MADS code profiler works on labels now, not on procedures only, which has much more sense. - MADS v1.7.3 compatibility added. By default it worked with 1.8.4. - MADS example Tetris changed to Mandelbrot. MADS Screenshot - http://www.alamak0ta.republika.pl/mads.png Quote Link to comment Share on other sites More sharing options...
tjb Posted March 14, 2009 Share Posted March 14, 2009 Would it be difficult to add support for ATASM? tjb Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted March 15, 2009 Share Posted March 15, 2009 (edited) i still not get it to work with mads... ok. got it with the mandelbrot example... Jesus... the profiler files are saved where the atari800win is located and not where the config file points to... not let me check with Beyond Evil... Edited March 15, 2009 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted March 15, 2009 Share Posted March 15, 2009 aehm... maybe I am really stupid... but just again following questions... where do I have to place the sprite10.cfg file? into the source code folder or into the folder where atari800winprofiler is located? the config file looks like this: d:\programmieren\teufel\sprite10.lab d:\programmieren\teufel\sprite10.lst the source is assembled with mads sprite10.asm -t -l then i am drag and drop the sprite10.obx into atari800winprofile entering the monitor and typing pstart sprite10.cfg (which is located in the source code folder not where the atari800win is) after few seconds I am reentering the monitor and typing pend and got the message that the profiler files are generated... now I put them into the same folder where the gui is but it loads the mandelbrot generated files instead? so I checked the text files generated by atari800win and it generates profiles based on the mandelbrot labels etc? but in my beyond evil folder???? I really do not get it... which config file is used etc... Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 16, 2009 Author Share Posted March 16, 2009 where do I have to place the sprite10.cfg file? into the source code folder or into the folder where atari800winprofiler is located? It doesn't matter where you place sprite10.cfg, but using the pstart command you have to point it as a parameter. The easiest way is to place it where Atari800WinProfiler.exe is, so you don't have to add any paths, just a file name. the config file looks like this:d:\programmieren\teufel\sprite10.lab d:\programmieren\teufel\sprite10.lst the source is assembled with mads sprite10.asm -t -l That's fine. then i am drag and drop the sprite10.obx into atari800winprofile entering the monitor and typing pstart sprite10.cfg (which is located in the source code folder not where the atari800win is) Paths to .lab and .lst files are defined in the config file. But you have to tell the profiler where the .cfg file is! If you have placed the sprite10.cfg in the other directory, how the profilier could know, that the config file is there? Place it in the directory where Atari800WinProfiler.exe is or use "pstart d:\programmieren\teufel\sprite10.cfg" after few seconds I am reentering the monitor and typing pend and got the message that the profiler files are generated... now I put them into the same folder where the gui is but it loads the mandelbrot generated files instead? Your previously generated profiler output (IPcounts.txt and ProcCounts.txt of Mandelbrot) was not removed by you or replaced by the new output. I really do not get it... which config file is used etc... 1. Path to the .lst and .lab are written in the .cfg file 2. You point the .cfg file as a parameter to pstart command. That's all. Is that simple enough? :-) Let me know, if it works. Did the profile result was what you have expected? :-) Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 16, 2009 Author Share Posted March 16, 2009 Would it be difficult to add support for ATASM?tjb It wouldn't be difficult, but does anyone still use it, when we have MADS? :-) regards, Jakub Quote Link to comment Share on other sites More sharing options...
cas Posted March 16, 2009 Share Posted March 16, 2009 Would it be difficult to add support for ATASM?tjb It wouldn't be difficult, but does anyone still use it, when we have MADS? :-) I'm using ATASM and I would use the Profiler on some code there. I use ATASM because I like to work on the "real thing" from time to time, and as far as I know there is no MADS compatible assembler available that runs on A8. Carsten Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 16, 2009 Author Share Posted March 16, 2009 I'm using ATASM and I would use the Profiler on some code there. I use ATASM because I like to work on the "real thing" from time to time, and as far as I know there is no MADS compatible assembler available that runs on A8. Fine, I will add ATASM support. Could you upload somewhere your code samples? ATASM provides only one, very simple program. regards, Jakub Quote Link to comment Share on other sites More sharing options...
cas Posted March 16, 2009 Share Posted March 16, 2009 I'm using ATASM and I would use the Profiler on some code there. I use ATASM because I like to work on the "real thing" from time to time, and as far as I know there is no MADS compatible assembler available that runs on A8. Fine, I will add ATASM support. Could you upload somewhere your code samples? ATASM provides only one, very simple program. regards, Jakub Try X-Forth (5600 LOC) http://atariwiki.strotmann.de/xwiki/bin/view/Code/XForth the ATASM Source is also downloadable in the "Attachment" section of this Wiki-Article Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 16, 2009 Author Share Posted March 16, 2009 the ATASM Source is also downloadable in the "Attachment" section of this Wiki-Article I have an ATASM version compiled, but the output is pretty ugly - ATASM doesn't add label names to the .lst output (-v option). Before I release this version I would really like to have another code sampel to test it. Do you have any? regards, Jakub Quote Link to comment Share on other sites More sharing options...
HiassofT Posted March 16, 2009 Share Posted March 16, 2009 I have an ATASM version compiled, but the output is pretty ugly - ATASM doesn't add label names to the .lst output (-v option).Before I release this version I would really like to have another code sampel to test it. Do you have any? Here are links to some of my projects: http://www.horus.com/~hias/freezer/softwar...ftware-3.02.zip COM files: "atasm -oflash.com flash.src", "atasm -opatch.com patch.src" ROM files, in the freezer directory: "atasm -r -f0 BANK1.M65", "atasm -r -f0 BANK2.M65", "atasm -r -f0 BANK3.M65" http://www.horus.com/~hias/tmp/hipatch-090313.zip an ATR file: "atasm -r -odiag.atr diag.src" so long, Hias Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 17, 2009 Author Share Posted March 17, 2009 The test version for the ATASM is done, give it a try before I add it to the official release: http://www.alamak0ta.republika.pl/atasm.zip As the whole profiler it works only on the code executed from the main memory bank. It doesn't trace the bank switching. Quote Link to comment Share on other sites More sharing options...
cas Posted March 23, 2009 Share Posted March 23, 2009 The test version for the ATASM is done, give it a try before I add it to the official release:http://www.alamak0ta.republika.pl/atasm.zip As the whole profiler it works only on the code executed from the main memory bank. It doesn't trace the bank switching. Hello Jakub, the new ATASM support works for me (tested in Windows 7, will test Linux/Wine later today as I use primary Linux for development). One feature request: would it be possible to calculate the total CPU cycles per subroutine and/or miliseconds spend in the top table in the wxProfiler window? And a questions: what does the red numbers in front of the instructions show exactly? (I have looked on the sleepy webpage, but couldn't find a clue there). The profiler is a great help for me when testing different Forth kernel implementation types. Best regards Carsten Strotmann Quote Link to comment Share on other sites More sharing options...
cas Posted March 23, 2009 Share Posted March 23, 2009 Update testing on Linux with WINE: the emulator works, but the monitor window does not work, so I cannot start/stop profiling there. The WxProfilerGui starts, showing the results of the subroutine count, but it locks up (100% CPU) when selecting any of the subroutines/labels. For the name it seems to be a WxWindows application, might be possible to compile it natively on Linux. However, for me I can live with the Windows version for the time being, is better that having no profiler at all. Carsten Quote Link to comment Share on other sites More sharing options...
Urchlay Posted March 23, 2009 Share Posted March 23, 2009 Update testing on Linux with WINE: the emulator works, but the monitor window does not work, so I cannot start/stop profiling there. This applies to the regular (non-profiling) Atari800WinPlus. Nobody's ever gotten the monitor window to work in Wine... so it's not specifically a problem with the profiler. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted March 25, 2009 Author Share Posted March 25, 2009 (edited) the new ATASM support works for me (tested in Windows 7, will test Linux/Wine later today as I use primary Linux for development). Thanks for testing :-) One feature request: would it be possible to calculate the total CPU cycles per subroutine and/or miliseconds spend in the top table in the wxProfiler window? Every features is possible to add. I have to look how the Atari800Win calculates the CPU cycles and if it's not too complicated, I should add it soon. And a questions: what does the red numbers in front of the instructions show exactly? (I have looked on the sleepy webpage, but couldn't find a clue there). The profiler works on "code hits" - periodically it checks where the instruction pointer is. Obviously 100% is the total number of code hits during the profiling. In the top window of wxProfiler is displayed the hit count for each procedure/label and how much percent of total hits it is. The red numbers in the code view are the percents for each line. The total sum of these red values gives a 100%. Example: http://www.alamak0ta.republika.pl/mads.png LOOP label in the DIV procedure takes 60.73% execution time. All the red values from the DIV.LOOP part of the code (up to DIV.DIV2) sums up to 60.73. The profiler is a great help for me when testing different Forth kernel implementation types. It's a pleasure to help :-) BTW: looking at the picture from the link above I see a potential bug. The first instruction of the procedure/label is ignored in profiling... I will check that. regards, Jakub Edited March 25, 2009 by ilmenit Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.