HP Caliper User's Guide
Differences Between scgprof and cgprof
These are differences between scgprof and cgprof collection runs:
• scgprof collection runs have significantly less overhead than cgprof collection
runs, because the call graphs are produced using sampling instead of
instrumentation.
• The --duration option is supported for use with scgprof (but not cgprof).
• The --branch-sampling-spec option is supported for use with scgprof (but
not cgprof).
• When you are using scgprof and attaching to a process, dependent libraries do
not have to be mapped private with chatr before attaching with HP Caliper.
• An scgprof report differs slightly from a cgprof report. In particular, there are
two Sampling Specification sections in the summary area: IP Sampling and Branch
Sampling. See “Sampled Call Graph Text Report Example” (p. 159).
Running the HP Caliper Sampled Call Graph Profile
You can start HP Caliper from the command line, a shell script, or your program's
Makefile to produce a sampled call graph profile.
The syntax is:
caliper scgprof [caliper_options] program [program_arguments]
This measurement uses the --branch-sampling-spec option to control the sampling
of the branch trace buffer (BTB)/execution trace buffer (ETB), which produces the
statistical call graph. For more information, see “--branch-sampling-spec” (p. 72).
The following command creates a summary call graph profile report in the file named
results.save when profiling the program wordplay. The string “abcdefghi” is an
argument to the wordplay program.
$ caliper scgprof -o results.save --descr all -r state:instr
wordplay abcdefghi
Sampled Call Graph Text Report Example
An example report is shown in Figure 10-1 “Sampled Call Graph Text Report Example”.
This report is the result of this command line:
$ caliper scgprof -o results.save --descr all -r state:instr
wordplay abcdefghi
158 Producing a Sampled Call Graph Profile Analysis