This guide gives you enough information to get started using the Sun Studio performance analysis tools. For more information, see the Sun Studio documentation.
The user workflow for the Sun Studio Performance Tools is:
Because the performance tools and their man pages are not installed into the system directories /usr/bin/ and /usr/share/man, you must change your PATH and MANPATH environment variables to enable use of the tools:
The Sun Studio performance tools require the Java TM 2 Platform, Standard Edition v 1.4.2_08 (J2SE) technology or J2SE 5.0 Update 3 technology, and required OS patches.
The Sun 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 libraries). You can compile the target program with any compiler, and any level of optimization and parallelization. All features of the tools work with the Sun Studio compilers, which are recommended.
To get source-level data, and for the support for parallel Fortran and OpenMP to work fully, compile with the -g option. For C++ programs, compile with the -g0 option. Please report any anomalies in source or disassembly line mappings or compiler commentary from the Sun Studio compilers.
To use the performance tools on code compiled by the GNU compilers, use a GNU distribution that is configured for the -gstabs+ option, and compile with that option. Annotated source and disassembly are available for both optimized and unoptimized code. Annotated source might not be available if you compile with the -g option, the -gstabs option, or the -gdwarf option; it depends on how the distribution was configured. C++ names from the GNU C++ compiler can be demangled only if you provide a copy of library equivalent to libiberty.so from the appropriate GNU distribution, and use the gdemangle command to point to it. The GNU compilers do not put out the name of the object file in the executable, so the name is always shown as unknown.
The performance tools work on Java code compiled with any 1.4.x version or 5.0 version of the Java TM 2 Platform, Standard Edition (J2SE) technology.
You can collect data for an application in several ways:
The collect command provides a simple interface that lets you collect data without using the Analyzer GUI, the IDE, or the dbx debugger. The command provides arguments for collecting various types of data, naming the experiment and an experiment group, and specifying experiment controls.
For complete information about the collect command and the types of data it can record, see the collect(1) man page.
The collector command in the dbx debugger supports the same data collection as the collect command. In addition, the collector command lets you attach to a running program to collect data.
For complete information about the collector command, see the collector (1) man page.
The Performance Tools Collect window in the Analyzer GUI lets you specify the parameters for collecting data on an application, and provides a Run button that launches a collect command to run the application. The window also provides buttons to pause the process, record sample points, resume the process, and terminate the process.
For complete information about the Performance Tools Collect window, see the analyzer (1) man page or the online help in the Analyzer GUI.
The Collector window in the Sun Studio IDE is very similar to the Performance Tools Collect window in the Analyzer GUI, but it uses the dbx collector command to collect data.
For complete information about the Collector window, see the online help in the Sun Studio IDE.
You can analyze a performance experiment using the Analyzer GUI or the er_print command-line utility.
The Analyzer GUI can read one or more experiments, and lets you navigate through the recorded data. The GUI can display the following types of data:
It can also display a timeline showing the profiling events in time sequence, statistics data, a leak list, and information about the experiments that have been recorded.
By default, the Analyzer GUI shows data in each tab for all experiments, all samples, all threads, all LWPs, and all CPUs. You can select a subset of data by specifying a filter expression.
For detailed information on the Analyzer GUI, see the analyzer (1) man page and the Performance Analyzer manual .
The er_print utility 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.
For detailed information on the er_print utility, see the er_print (1) man page.