HP Caliper User's Guide

10 Producing a Sampled Call Graph Profile Analysis
HP Caliper can produce a sampled call graph profile report (using the scgprof
measurement) from any compiled program. You do not need to compile your program
in any special way to use this feature.
The call graph is produced by sampling the processor's performance monitoring unit
(PMU) to determine function calls. The call graph is not exact, because it does not show
every function call, but it is statistically useful.
This chapter provides an overview. For details about the sampled call graph profile
report, see “scgprof Measurement Report Description” (p. 288).
HP Caliper can also produce an exact call graph, using the cgprof measurement,
which instruments the application code. The cgprof measurement runs on HP-UX
only. For details about cgprof, see “cgprof Report Description (p. 232). Also see
“Differences Between scgprof and cgprof” (p. 158).
NOTE: Using the scgprof measurement on HP-UX 11.23 (v2) requires kernel patch
PHKL_34020.
How Sampled Call Graph Profile Analysis Works
The HP Caliper sampled call graph profile analysis produces a gprof-like report. It
includes these results:
Total execution times for each function in the program
Call counts for each function in the program
Cycle information, member functions, time and call counts
Most likely hot call paths in the program
Because the calls are discovered by sampling the PMU, it cannot show every function
call performed by a process. (This is similar to how the dcache measurement works.
It finds data cache misses by sampling the PMU.)
Statistically, the sampled call graph produced by scgprof is generally accurate in
terms of which calls are more frequently made, and how much more frequent some
calls are than others. The sampled call graph produced will be more useful for
longer-lived processes than shorter-lived processes.
The --branch-sampling-spec option is used with the scgprof measurement (and
used only with this measurement). It helps produce the statistical call graph. See
“--branch-sampling-spec” (p. 72).
How Sampled Call Graph Profile Analysis Works 157