Instructions for running the profiler Contributed by Keith Rarick; partially stolen from http://jrat.sourceforge.net/quickstart.html; slightly modified by Mike Clancy 1. Copy two files, "jrat" and "profile" from ~cs61bl/lib to your project directory. 2. Decide on a puzzle to use for profiling your project. 3. Compile your project and verify that it correctly solves the puzzle. 4. Run "./jrat" and a window will appear. From the "Instrument" menu, choose "Inject JAR(s) or Class File(s)". http://jrat.sourceforge.net/images/menu-inject.gif Select the directory where your program is and click "Open"; you may need to do this repeatedly to get to where your program files are. Then select all .class files that are part of your project (hold down the "Control" key and click on them) and click "Open". This incorporates the profiling code-- updates of counters in each of your methods, etc.--into your .class files. NOTE: once you do this step, the class files will only run with the profiler; you can't run them normally any more. To get back your regular class files go to Eclipse's "Project" menu and pick "Clean...". Alternatively, you could make a copy of the class files in a directory named "profiling" or some such. Anyway, then close the jrat window. 5. Now run your project in the UNIX shell using the "profile" command: $ ./profile Solver 6. It should have produced a directory called "JRatOutput" with a subdirectory named after the date and time, with some log files in it. Run "./jrat" again; this time choose "Open JRat Output File" from the "File" menu. Burrow into those directories until you find a file named "0002_TreeMethodHandler.xrat" and open it. If all goes well you will see an outline view of the time spent in each function of your program. A diagram is given in http://jrat.sourceforge.net/images/treeView.gif