Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Studio 12.3: Performance Analyzer Oracle Solaris Studio 12.3 Information Library |
1. Overview of the Performance Analyzer
3. Collecting Performance Data
4. The Performance Analyzer Tool
5. The er_print Command Line Performance Analysis Tool
Commands That Control the Function List
Commands That Control the Callers-Callees List
cprepend function-name [N | ADDR]
cappend function-name [N | ADDR]
Commands That Control the Call Tree List
Commands That Control the Leak and Allocation Lists
Commands That Control the Source and Disassembly Listings
source|src { filename | function_name } [ N]
disasm|dis { filename | function_name } [ N]
Commands That Control Searching For Source Files
Commands That Control Hardware Counter Dataspace and Memory Object Lists
mobj_define mobj_type index_exp
Commands That Control Index Object Lists
indxobj_define indxobj_type index_exp
Commands for the OpenMP Index Objects
Commands That Support the Thread Analyzer
Commands That List Experiments, Samples, Threads, and LWPs
Commands That Control Filtering of Experiment Data
Specifying a Filter Expression
Listing Keywords for a Filter Expression
Selecting Samples, Threads, LWPs, and CPUs for Filtering
Commands That Control Load Object Expansion and Collapse
object_show object1,object2,...
object_hide object1,object2,...
object_api object1,object2,...
object_select object1,object2,...
name { long | short } [ :{ shared_object_name | no_shared_object_name } ]
viewmode { user| expert | machine }
Commands That Print Other Information
Commands That Set Defaults Only For the Performance Analyzer
6. Understanding the Performance Analyzer and Its Data
This section provides some examples for using the er_print command.
Example 5-8 Show summary of how time is spent in functions
er_print -functions test.1.er
Example 5-9 Show caller-callee relationships
er_print -callers-callees test.1.er
Example 5-10 Show which source lines are hot
Source-line information assumes the code was compiled and linked with -g. Append a trailing underscore to the function name for Fortran functions and routines. The 1 after the function name is used to distinguish between multiple instances of myfunction.
er_print -source myfunction 1 test.1.er
Example 5-11 Filter functions named myfunc from the user function stack:
er_print -filters 'FNAME("myfunc") SOME IN USTACK' -functions test.1.er
Example 5-12 Generate output similar to gprof
The following example generates a gprof-like list from an experiment. The output is a file named er_print.out which lists the top 100 functions, followed by caller-callee data, sorted by attributed user time for each.
er_print -outfile er_print.out -metrics e.%user -sort e.user \ -limit 100 -func -callers-callees test.1.er
You can also simplify this example into the following independent commands. However, keep in mind that each call to er_print in a large experiment or application can be time intensive.
er_print -metrics e.%user -limit 100 -functions test.1.er
er_print -metrics e.%user -callers-callees test.1.er
Example 5-13 Show only the compiler commentary
It is not necessary to run your program in order to use this command.
er_src -myfile.o
Example 5-14 Use wall-clock profiling to list functions and callers-callees
er_print -metrics ei.%wall -functions test.1.er
er_print -metrics aei.%wall -callers-callees test.1.er
Example 5-15 Run a script containing er_print commands
er_print -script myscriptfile test.1.er
The myscriptfile script contains er_print commands. A sample of the script file contents follows:
## myscriptfile ## Send script output to standard output outfile - ## Display descriptive information about the experiments header ## Write out the sample data for all experiments overview ## Write out execution statistics, aggregated over ## the current sample set for all experiments statistics ## List functions functions ## Display status and names of available load objects object_list ## Write out annotated disassembly code for systime, ## to file disasm.out outfile disasm.out disasm systime ## Write out annotated source code for synprog.c ## to file source.out outfile source.out source synprog.c ## Terminate processing of the script quit