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.
◆ HAP_deregister_pmu_group()
De-registers a group of PMU events registered via HAP_register_pmu_group().
- Parameters
-
- Returns
- 0 upon success.
Other values upon failure.
◆ HAP_read_pmu_group()
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
-
- 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()
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
-
- 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().