HAP user PMU
HAP user PMU API
API for reading a group of PMUs

Functions

static int HAP_register_pmu_group (HAP_pmu_group_config_t *pmu_config)
 
static int HAP_read_pmu_group (HAP_pmu_group_config_t *pmu_config)
 
static int HAP_deregister_pmu_group (HAP_pmu_group_config_t *pmu_config)
 

Detailed Description

These APIs expose a way to register and read an array of PMU events (maximum of four PMU events) by using the HAP_pmu_group_config_t structure. Alternatively, the user can use a different set of APIs explained in the next section to configure and read a single PMU event.

Function Documentation

◆ HAP_deregister_pmu_group()

static int HAP_deregister_pmu_group ( HAP_pmu_group_config_t pmu_config)
inlinestatic

De-registers a group of PMU events registered via HAP_register_pmu_group().

Parameters
pmu_configPointer to the HAP_pmu_group_config_t structure used in the HAP_register_pmu_group() call.
Returns
0 upon success.
Other values upon failure.

◆ HAP_read_pmu_group()

static int HAP_read_pmu_group ( HAP_pmu_group_config_t pmu_config)
inlinestatic

Reads the PMU values of registered PMU events.

Call this function after successfully calkling HAP_register_pmu_group() with the same structure pointer, pmu_config. This API uses the context_id field of the input pmu_config structure, which is set in a successful HAP_register_pmu_group().

Parameters
pmu_configPointer to the HAP_pmu_group_config_t structure used in HAP_register_pmu_group() call.
Returns
0 upon success. Updates the pmu_value[] array corresponding to the configured pmu_events[] in the structure pointed to by pmu_config. pmu_value[x] is updated to HAP_USER_PMU_READ_FAILED if the corresponding pmu_event[x] configuration has failed or is invalid.
Other values upon failure.
HAP_USER_PMU_READ_NOT_SUPPORTED when unsupported.

◆ HAP_register_pmu_group()

static int HAP_register_pmu_group ( HAP_pmu_group_config_t pmu_config)
inlinestatic

Registers a group of PMU events to read.

Call this function from the DSP user process to register a set of PMU events (maximum of four) for tracking. Fill in the pmu_events[] array file of pmu_config with the specified PMU events to track (maximum of four) and update the num_events field of pmu_config with the number of PMU events written into the pmu_events[] array.

Parameters
pmu_configPointer to HAP_pmu_group_config_t structure with pmu_events[] array and num_events fields updated.
Returns
0 upon success. Updates the contextId field of pmu_config.
The same pmu_config structure should be used for reading the PMU counter values HAP_read_pmu_group() corresponding to the configured events and for de-registration HAP_deregister_pmu_group().