Counter multiplexing mode

You can set the counting for more events than available hardware counters using counter multiplexing. This mode is meant to be used to analyze workloads with homogenous performance characteristics. This avoids the requirement to run the workload multiple times to collect more events than available hardware counters.

In this mode, the pmapi periodically changes the setting of the counting and accumulates values and counting time for multiple sets of events. The time each event set is counted before switching to the next set can be in the range of 10 ms to 30 s. The default value is 100 ms.

The values returned include the number of times all sets of events have been counted, and for each set, the accumulated counter values and the accumulated time the set was counted. The accumulated time is measured up to three different ways: using Time Base, and when available, using the PURR time and one the SPURR time. These times are stored in a timebase format that can be converted to time by using the time_base_to_time function. These times are meant to be used to normalize the results across the complete measurement interval.

Several basic pmapi calls have the following multiplexing mode variations indicated by the _mx suffix:

pm_set_program_mx
Sets the counting configuration. It differs from the pm_set_program function in that it accepts a set of groups (or event lists) to be counted, and the time each set must be counted before switching to the next set.
pm_get_program_mx
Retrieves the current Performance Monitor settings. It differs from the pm_get_program function in that it returns a set of groups (or event lists).
pm_get_data_mx
Returns the Performance Monitor counting data. It returns a set of counting data, one per group (or event list) configured. The returned data includes in addition to the accumulated counter values, the number of times all the configured sets have been counted, and for each set, the accumulated time it was counted.
pm_get_tdata_mx
Same as pm_get_data_mx, but includes a timestamp indicating the last time that the hardware Performance Monitor counters were read.
pm_get_data_cpu_mx/pm_get_tdata_cpu_mx
Same as pm_get_data_mx or pm_get_tdata_mx, but returns the Performance Monitor counting data for a single processor. The specified processor number must be in the range 0 to _system_configuration.ncpus. This number might represent different processors from call to call if dynamic reconfiguration operations have occurred.
pm_get_data_lcpu_mx/pm_get_tdata_lcpu_mx
Same as pm_get_data_cpu_mx or pm_get_tdata_cpu_mx, but returns the Performance Monitor counting data for a single logical processor. The logical processor numbering is not contiguous, and the call to these interfaces return an error if the specified logical processor has not been online since the last call to pm_set_program_mx. A logical processor number always designates the same processor even if dynamic reconfiguration operations have occurred. To get data for all processors, these interfaces must be called in a loop from 0 to _system_configuration.max_ncpus.