HP Caliper User's Guide

You can attach to the process for these measurements:
cgprof
fcount
fcover
To attach to a process, you must specify the process ID (PID). The syntax is:
caliper measurement [options] pid
For example:
$ caliper cgprof 7654
To perform precise measurements of a process:
1. Run chatr(1) with the +dbg enable option on the program you want to
measure. For example:
$ chatr +dbg enable ./myprog
2. Run ./myprog and find the process ID of the process.
3. Specify the process you want to measure. For example:
$ caliper fprof 7654
HP Caliper remains attached to the target process until it ends or you type Ctrl-C.
If you type Ctrl-C to stop HP Caliper and generate a report, HP Caliper forcibly
terminates all processes that are being measured.
Taking PMU Samples in Your Code
On HP-UX, you have two methods to control where to collect performance information
in your code:
Triggering samples in specific places in your code. See “Triggering PMU Samples
in Specific Code Regions” (p. 208).
Limiting samples to specific blocks of your code. See “Restricting PMU
Measurements to Specific Code Regions” (p. 211).
Both of these methods require you to make changes to your source code.
Triggering PMU Samples in Specific Code Regions
To analyze the performance in several regions of code, such as a function or a hot loop,
you can collect samples at specific places as your code executes.
This feature works with the pmu_trace measurement to show each sample in the
output with the associated delta in even counts since the last sample.
To specify the place in your code to trigger a sample:
208 HP Caliper Features Specific to HP-UX