11 Producing a Sampled Call Stack Profile Analysis
HP Caliper can produce a sampled call stack profile report (using the cstack measurement) from any compiled program. You do not need to compile your program in any special way to use this feature. HP Caliper periodically samples the application program counter and each of its thread's call stacks and then creates a call stack profile of the program's execution.
For more information about the report produced by the cstack measurement, see “cstack Measurement Report Description” (page 186).
Running HP Caliper to Produce a Call Stack Profile
You can start HP Caliper from the command line, a shell script, or your program's makefile to produce a call stack profile. The syntax is:
caliper cstack [caliper_options] program [program_arguments]
For example, the following command creates a call stack profile report in the file named results.save when profiling the program enh_thr_mutex1.
$ /opt/caliper/bin/caliper cstack
You can use the
You can use the
You can use the
By default a cstack run collects the blocking primitives data, and a "Blocking Primitives" section will appear in the cstack reports if there are any samples that are blocked waiting for a thread primitive (mutex, condition variable, or rwlock) or inter process blocking primitive (like semaphore, socket, pipe, or file descriptor).
If an application is linked with libpthread version 11.31_BL2009_1012_2 (or later), the "Blocking Primitive Details" section would appear instead in the cstack report with information about holder and waiter threads for thread primitives (for example, mutexes). See “Thread Synchronization Primitive's Holder and Waiter Thread Analysis
When HP Caliper is run as root, cstack measurement now records and reports both user and kernel space portions of the call stack
Call Stack Profile Text Report Example for
An example report for HP Caliper on
$ /opt/caliper/bin/caliper cstack
134 Producing a Sampled Call Stack Profile Analysis