The main window displays the runtimes of your program's loops in a bar chart arranged in the order that the source files were presented to the compiler.
Figure 3-1 shows the components of the LoopTool window.
To open executable and timing files, choose File Open in the main window.
There are two ways to specify the files you want to open:
Type in the name of the files to open.
Bring up a file chooser.
Once you enter the executable's path, you don't need to type in the timing file, unless it's in a different directory or has a non-default name (or both).
For more information about opening files, see the Analyzing the Loops in Your Program section of the Sun WorkShop Online Help.
To open a window with detailed information on all the loops in your program, choose File Create Report in the main window (see Figure 3-2). The generated report is identical to that produced by LoopReport.
The Help button in the report window links to the Sun WorkShop online help section containing compiler hints.
To print the LoopTool graph, choose File Print Graph in the main window and type the name of your chosen printer. To save the graph to a file, type a filename instead of a printer name.
For more information about printing see the Sun WorkShop online help.
Choose File Options in the main window to open the Options dialog box, where you can choose an editor for editing source code. The available editors are vi, gnuemacs, and xemacs.
vi and xemacs are installed with LoopTool into your install directory (usually /opt/SUNWspro/bin) if they're not already on your system. You must provide gnuemacs yourself. In all cases, the editor you want must be in a directory in your search path in order for LoopTool to find it. For example, your PATH environment variable should include /usr/local if that's where gnuemacs is located on your system.
For more information about choosing an editor see the WorkShop Online Help.
Clicking a loop in the main window (see Figure 3-1) does two things:
It brings up a window in which you can edit your source code (see Figure 3-3). The available editors are vi, xemacs, and gnuemacs.
For information on vi, see the vi(1) manual page. xemacs and gnuemacs have online help (click the Help button).
The Sun WorkShop vi editor has a special Version menu that allows you to make use of the Source Code Control System (SCCS) utility for sharing files. See the online help, as well as the sccs(1) manual page, for more information.
It brings up a separate window that displays one or more hints about the loop you've selected. The Help button in this window displays the Sun WorkShop online help compiler hints section. See also "Compiler Hints", which explains the hints in detail.
Figure 3-3 shows an xemacs editor window with a loop selected, and a hint window with an explanation of a compiler hint.
If you edit your source code, line numbers shown by LoopTool may become inconsistent with the source. You must save and recompile the edited source and then run LoopTool with the new executable, producing new loop information, for the line numbers to remain consistent.