Sun Java Solaris Communities My SDN Account Join SDN
 
Article

Tip: A Quick Start Guide To The Performance Tools

 
By Marty Itzkowitz, Sun Microsystems  

This is a very brief guide to help you get started using the Collector and Analyzer performance tools. For the details, see the latest Performance Analysis Tools reference documentation.

Workflow
The user workflow for the Sun ONE Studio Performance Tools is:
  1. Compile the target program
  2. Collect a performance experiment on the target
  3. Analyze the experiment with either the Analyzer or er_print
 
Prerequisites
First, take a look at the readme files for Sun ONE Studio 8 and Sun ONE Studio 7 Compiler Collection releases and set your PATH and MANPATH accordingly. You must also have patches and the right version of Java installed, as described in the readme.
 
Tutorials
The tools ship with several example codes, designed to be used in tutorials on the product. The tutorials are available in Chapter 2 of the S1S8 Compiler Collection Performance Tools manual.
 
Compile the Target Program

The Sun ONE Studio Performance tools can record performance experiments, collecting various kinds of data, on any target executable that is built with shared libraries (not statically-linked). The target program for data collection can be compiled with any compiler, and any level optimization and parallelization. We recommend the Sun ONE Studio 8 compilers, and all features of the tools work with those compilers. In order to get source-level data, and for the support for parallel FORTRAN and OpenMP to work fully, the target should be compiled with the -g flag. For C++ programs, the target should be compiled with the -g0 flag. Please report any anomalies in source or disassembly line-mappings or compiler commentary from these compilers.

 

Native Language (C, C++, Fortran) Compilers

  • Sun ONE Studio 8 Compilers:
    All functionality is working.
  • Forte Developer 7 Compilers:
    All functionality is working.
  • Forte Developer 6 update 2 Compilers:
    Somewhat less compiler commentary is available, but all functionality is working.
  • Sun WorkShop 6 update 1 Compilers:
    Only a limited amount of compiler commentary is available.
  • Sun WorkShop 6 Compilers:
    Special unwind support for parallel FORTRAN and Open MP, allowing the user to see load imbalance per loop, is not implemented.
  • Sun WorkShop 5 Compilers:
    No source-level display for optimized code will be meaningful, as all instructions in a function are mapped to the first line of that function. No compiler commentary is available from code compiled with the 5.0 compilers.
  • GNU Compilers:
    To use the performance tools on code compiled by the GNU compilers, you should use a GNU distribution that is configured for -gstabs+, and compile with that flag. Annotated source and disassembly will be available for both optimized and unoptimized code. Annotated source might not be available if you compile with -g, -gstabs or -gdwarf; it depends on how the distribution was configured. C++ names from the GNU C++ compiler can be demangled only if the user provides a copy of library equivalent to libiberty.so from the appropriate GNU distribution, and uses the gdemangle command to point to it. The GNU compilers do not put out the name of the object file in the executable, so it will always be shown as unknown.
  • KAI OpenMP Guide:
    Names will not be demangled, and the runtime support for the microtasking library is absent, since KAI has their own library. Since Guide works be translating the original source into an alternate source that is in /tmp and not preserved, no line number data is available, and no annotated source can be shown.
  • Java Compilers:
    The tools work on Java codes compiled with any 1.4.X version of the JDK, and are expected to work with the 1.5 version as well.

 
Collect a Performance Experiment

Data collection for user application in the Sun ONE Studio Performance tools is done by the Collector, which is available in two command-line forms: the collect command and the dbx collector. It can also be done from the Collector GUI, also available in two forms, one from the Analyzer and the second from the Debugger GUI.

 

The collect Command
The collect command provides a simple interface to allow data collection without using dbx or WorkShop. It provides arguments for specifying the various types of data to be collected, naming the experiment and an experiment-group, and various other experiment controls.

Further information about collect command can be found on the collect.1 man page. The types of data recorded are also described there.

 

The dbx Collector
dbx provides an alternative interface to collecting data. It supports the same data collection as the collect command, using a command-line interface, described in The dbx collector allows attaching to a multithreaded executable, and collecting performance data from it.

Further information about dbx data collection can be found on the collector.1 man page.

 

Collector GUI in Analyzer
Collector GUI in the Analyzer allows the user to specify the parameters for data collection, and provides a Run button to launch a collect command to actually run the process. It also allows control of that process for Sampling and Pause and Resume.

Further information about Analyzer's Collection GUI can be found on the analyzer.1 man page, or on the online help in the Analyzer

 

The Collector GUI in the Debugger GUI
Collector GUI in the Debugger GUI is very similar to that in the Analyzer, but it uses the dbx collector to do its work.

Further information about Debugger GUI's Collector GUI can be be found in the online help for the Debugger GUI.

 
Analyze the Performance Experiment

There are two ways to examine a performance experiment, the Analyzer GUI program, and a command-line er_print

 

The Analyzer
Analyzer is a Java-based GUI program, that can read one or more experiments, and allow you to navigate through the recorded data. It can show function, caller-callee, source, and disassembly data, as well as a TimeLine showing the profiling events in time-sequence. It also has additional panes to show statistics data, a leak- and allocation-list, and information about the experiments recorded.

Further information about the Analyzer can found on the analyzer.1 man page.

 

er_print
er_print is a command-line program that can read one or more experiments, and produce reports showing the data. The reports match the printed output available from the Analyzer GUI.

Further information about er_print can found on the er_print.1 man page.

 

About the Author

Marty Itzkowitz is project lead for the Sun ONE Studio Compiler Collection Performance Tools.