for a shorter time, without having to worry about the effects caused by the startup and shutdown code.
Similarly, the data collection can be restricted to the startup or shutdown phases to target those for performance improvements.
NOTE: This feature is not intended to measure a small number of instructions.
Enabling and disabling the PMU are not immediate operations and either operation might take a few processor cycles to be effective. Processor events occurring during those transitions might or might not be measured. Avoid using measurement windows so small that those uncertainties will significantly affect the reported numbers.
To use this feature:
1.Modify the program source code to use the header file provided with HP Caliper.
The location of the header file is include/caliper_control.h in the HP Caliper home directory.
2.In your source code, add the HP Caliper macros to enable and disable the PMU.
•To enable the PMU, insert:
CALIPER_PMU_ENABLE();
Using CALIPER_PMU_ENABLE() enables the PMU for the current thread until the next
CALIPER_PMU_DISABLE().
When the PMU is already enabled, CALIPER_PMU_ENABLE() does not have any effect.
•To disable the PMU, insert:
CALIPER_PMU_DISABLE();
When the PMU is already disabled, CALIPER_PMU_DISABLE() does not have any effect.
3.Use the
This option causes HP Caliper to allow the measured applications to control the PMU. When you specify
The default behavior is to disallow such control and measure the full run
To override the HP Caliper PMU macros, use
If you do not specify the
CALIPER_PMU_DISABLE() do not have any effect and the instructions behave as
When the PMU is programmed to allow control by
Figure 32 (page 165) shows how to use the header file and macros.
164 HP Caliper Features Specific to