HP Caliper Advisor Rule Writer Guide
Examples:
get_histogram(‘ITLB’, ‘SAMPLE_RATE’)
get_histogram_nth(‘ITLB’, ‘SAMPLE_RATE’, 0)
Table 4-4 “Sampling Parameter Metrics Available for Histograms” shows available
metrics, return type, and what it returns.
Table 4-4 Sampling Parameter Metrics Available for Histograms
DescriptionReturn TypeMetric
Returns the number of samples taken.integerSAMPLE_COUNT
Returns the name of the PMU sampling event.stringSAMPLE_EVENT
Returns the privilege level mask. Will be one of the following:
USER, KERNEL, BOTH, or ALL.
stringSAMPLE_PLM
Returns the sample rate.integerSAMPLE_RATE
Returns the sample threshold value.integerSAMPLE_THRESHOLD
Returns the sample rate variation.integerSAMPLE_VARIATION
Dataset ID
The special n metric returns the ID number of the dataset that supplied all of the other
metric values in the call. This metric is used as is, and is normally used in conjunction
with other metrics.
To retrieve this metric, use:
n
Returns the dataset ID number, an integer value.
Examples:
get_histogram(‘IP’, ‘FUNCTION’, ‘n’)
get_histogram_nth(‘IP’, ‘FUNCTION’, ‘n’, -2)
Examples of the Use of the Histogram Accessor Functions
• metrics = object.get_histogram(‘IP’, ‘FUNCTION’)
metrics: ((('sweep_', 'sweep3d', 12667),
('source_', 'sweep3d', 109),
('flux_err_', 'sweep3d', 39),
('initxs_', 'sweep3d', 3),
('inner_', 'sweep3d', 3),
('__milli_div32I', 'sweep3d', 3),
('initialize_', 'sweep3d', 2)))
This example retrieves a list of the top 10 functions based on CPU cycles. If a dataset
with this information exists, then a tuple containing (up to) 10 tuples (each with
Histogram Accessor Function: get_histogram 45