Oracle® Solaris Studio 12.4: Performance Analyzer

Exit Print View

Updated: January 2015

Compiling to Analyze Source Code

To see source code in annotated Source and Disassembly views, and source lines in the Lines view, you must compile the source files of interest with the -g compiler option (-g0 for C++ to enable front-end inlining) to generate debug symbol information. The format of the debug symbol information can be either DWARF2 or stabs, as specified by -xdebugformat=(dwarf|stabs) . The default debug format is dwarf.

Executables and libraries built with DWARF format debugging symbols automatically include a copy of each constituent object file’s debugging symbols. Executables and libraries built with stabs format debugging symbols also include a copy of each constituent object file’s debugging symbols if they are linked with the –xs option, which leaves stabs symbols in the various object files as well as the executable. The inclusion of this information is particularly useful if you need to move or remove the object files. With all of the debugging symbols in the executables and libraries themselves, moving the experiment and the program-related files to a new location is easier.

Programs can be compiled with the Oracle Solaris Studio compilers or GNU compilers. However, GNU compilers cannot support some features such as reconstructed call stacks with OpenMP.

Compiling with -g does not change optimization, except for tail call optimization at the O2 and O3 optimization levels in Studio compilers.

Source level information for Java code is supported. The location of Java sources, unlike that for native languages, is not recorded in the experiments. You might need to use path mapping or set the search path to point to your source. See How the Tools Find Source Code for more information.

Compiling for Dataspace and Memoryspace Profiling

Dataspace profiling attributes memory access to data structure elements. To enable dataspace profiling, you must compile C, C++, and Fortran executables with the Oracle Solaris Studio compilers and the -xhwcprof option. If you do not compile with this option, the DataObjects and DataLayout views do not show data for the binaries.

Memoryspace profiling enables you to see which memory addresses are costing the most performance. No special compiler options are necessary to prepare a program for memoryspace profiling, but the feature is available only on SPARC platforms running Oracle Solaris 10 1/13, and on Intel platforms running Oracle Solaris 11.2. See Dataspace Profiling and Memoryspace Profiling for more information.