Call Graph Part of the Report

This section reports the call graph produced from the call stack samples. All the call graph entries—one for each function—are reported. Each entry has one or more lines and delimited by the line full of dashes.

In each entry, the primary line is the one that starts with an index number in square brackets. The preceding lines in the entry describe the callers of this function. The lines following the primary line describe the callees of this function.

The entries are sorted by the number of Sample Hits In or Under Function.

Function Indexes

The Function Indexes is an alphabetical list of each function in your program with its index value.

Avoids gprof Fallacy

The cstack measurement does not exhibit the gprof fallacy condition that the scgprof and cgprof measurements do. (See “gprof Fallacy and Possibly Misleading Results” (page 131)'.) This is because the real time of the program that is attributable to a function is directly proportional to the number of Sample Hits In or Under Function. It does not depend on the number of times a function is called.

Limitations to Using cstack

Due to a kernel limitation on HP-UX, call stack sampling on HP-UX 11.23 (v2) exhibits heavy system call bias, resulting in inaccurate call stack profile reports. For an accurate call stack profile, you need to run cstack on HP-UX 11.31 (v3)

You cannot use the caliper diff command with this measurement.

In programs that dynamically load and then unload shared libraries, the cstack measurement might not attribute measurement results to the appropriate shared library.

The kernel does not allow HP Caliper to stop a thread in uninterruptible sleep state. Hence, if a process has one or more threads in uninterrupible sleep state, the callstack profile may be inaccurate.

Pstack like functionality

With HP Caliper 5.2, the cstack measurement can be used to generate a pstack-like report. In this mode, only one callstack sample is collected for all threads of the target process-id. While reporting, only the callpaths are reported for all the threads; other sections like Function Summary, Function Details, and CallGraph are not reported.

Specifying 0 with the-eor --durationoption will generate this pstack-like report.

For example, the following HP Caliper invocation will collect and report callstack samples for all threads of the target process '12345':

$ caliper cstack -e 0 12345

A sample report follows:

====================================================================

HP Caliper A.5.1.19 Report Summary for Call Stack Profile

====================================================================

Hot Call Paths (Thread 859899@signal_monitor_thread_main)

-------------------------------------------------------------

--% Total

Hits In Only--

 

Run +

Run

Block

 

Index Block

Hits

Hits

Name

Hits

Only

Only

 

-------------------------------------------------------------

Avoids gprof Fallacy 149