This uses Sun's WorkShop tool, and therefore will run only on Sun machines.
Haven't tried this for some time. Things may have decayed away.
Build the program in the usual way. Set up your running environment,
e.g. $OO_FD_BOOT. Run a small sample to confirm.
Launch Sun's Workshop. The version in the default installation path
(/opt/SUNWspro/bin) is broken. Please use the following version for now.
You should see the main WorkShop window.
From the WorkShop window's Debug menu, select "New Program...".
Navigate in the new Debug New Program window to the program you want to
run, SimAppApp in this example, and click OK.
Several new windows will come up. The Message window tells you about
what's going on. Leave it alone; it will disappear. There will be an emacs
window containing the main program, APPMain.cc for many
BaBar programs. It will not be used here, so you can iconize it.
A third window is the Debugging window.
From the Debugging window's Windows menu, select Collector to get
the Behaviour Data Collector window. Choose "for one run only",
and "Execution Profile data" in this new window.
Note the name of the "Experiment File". You may have to scroll left
and right to get the full name. You need this file name if you want to
run the Analyzer at a later time.
From the Debugging window's Windows menu, select "Program I/O" to get
the Program Input/Output window.
From the Behaviour Data Collector window's Collect menu, click on "Start"
to start running. Many BaBar programs need a tcl control file. Type "source
tcl_file_name" in the Program Input/Output window, e.g.
The program will run. If additional input is required, e.g.
"ev begin -nev 10", you can enter them in the Program Input/Output
window. Output will also appear in this window. Wait for your program
to finish. You may need to enter the tcl command "exit", if it is not
part of your tcl script. When the program finishes, the "off" button
will be high lighted in the Behaviour Data Collector window.
Run the analyzer.
If Workshop is still running,
select "Analyze" in the Behaviour Data Collector window's Collect menu.
If you start up Workshop at another time, go to the main WorkShop
window's Tools menu, and select Analyzer -> Open. Find your Experiment
File.
You should see a new Analyzer window. The Experiment File name should
be part of the window name.
In this Analyzer window's View menu, select
"Segments Included from Files...". You should see a new window titled
Segments Included from Files. Click on "Clear All". Highlight the
program you are working on, SimAppApp in this example.
Click Apply and Close to get back to the Analyzer window.
Select "User Time" in the Data menu, and "Cumulative" in the
Display menu. You should see an ordered list of programs that take the most
CPU time.
When you are done, select "Exit" from the Analyzer window's Experiment
menu. Exit from emacs, and the Program Input/Output window. Select "Close"
from the Collect menu in the Behaviour Data Collector window, and similarly
select "Close" from the Debug menu in the Debugging window. And finally,
select "Exit WorkShop" from the WorkShop menu in the main WorkShop window.