pm_get_data_mx, pm_get_tdata_mx, pm_get_data_cpu_mx, pm_get_tdata_cpu_mx, pm_get_data_lcpu_mx and pm_get_tdata_lcpu_mx Subroutine

Purpose

Returns systemwide Performance Monitor data in counter multiplexing mode.

Library

Performance Monitor APIs Library (libpmapi.a)

Syntax

#include <pmapi.h>

int pm_get_data_mx ( *pmdata)
pm_data_mx_t *pmdata;

int pm_get_tdata_mx (pmdata, * time)
pm_data_mx_t *pmdata;
timebasestruct_t *time;

int pm_get_data_cpu_mx (cpuid, *pmdata)
int cpuid;
pm_data_mx_t *pmdata;

int pm_get_tdata_cpu_mx (cpuid, *pmdata, *time)
int cpuid;
pm_data_mx_t *pmdata;
timebasestruct_t *time;

int pm_get_data_lcpu_mx (lcpuid, *pmdata)
int lcpuid;
pm_data_mx_t *pmdata;

int pm_get_tdata_lcpu_mx (lcpuid, *pmdata, *time)
int lcpuid;
pm_data_mx_t *pmdata;
timebasestruct_t *time;

Description

The pm_get_data_mx subroutine retrieves the current systemwide Performance Monitor data in counter multiplexing mode.

The pm_get_tdata_mx subroutine retrieves the current systemwide Performance Monitor data in counter multiplexing mode, and a timestamp indicating the last time the hardware counters were read.

The pm_get_data_cpu_mx and the pm_get_tdata_cpu_mx subroutines retrieve the current Performance Monitor data for a specified processor. The given processor ID represents a contiguous number ranging from 0 to _system_configuration.ncpus. These subroutines can only be used when no Dynamic Reconfiguration operations are made on the machine, because when processors are added or removed, the processor numbering is modified and the specified processor number can designate different processors from one call to another. These subroutines are maintained for compatibility with previous versions.

The pm_get_data_cpu_mx subroutine retrieves the current Performance Monitor data in counter multiplexing mode for the specified processor.

The pm_get_tdata_cpu_mx subroutine retrieves the current Performance Monitor data in counter multiplexing mode for the specified processor, and a timestamp indicating the last time the hardware counters were read.

The pm_get_data_lcpu_mx and the pm_get_tdata_lcpu_mx subroutines retrieve the current Performance Monitor data for a specified logical processor. The given processor ID represents a value ranging from 0 to _system_configuration.max_ncpus. This value always represents the same processor, even after Dynamic Reconfiguration operations have occurred. These subroutines might return an error if the specified logical processor number has never run during the counting interval.

The pm_get_data_lcpu_mx subroutine retrieves the current Performance Monitor data for the specified logical processor in counter multiplexing mode.

The pm_get_tdata_lcpu_mx subroutine retrieves the current Performance Monitor data for the specified logical processor in counter multiplexing mode, and a timestamp indicating the last time the hardware counters were read.

The Performance Monitor data is always an array of a set (one per hardware counter on the machines used) of 64-bit values.

The user application must free the array allocated to store accumulated counts and times (the accu_set field of the pmdata parameter).

Parameters

Item Description
*pmdata Pointer to a structure that contains the returned systemwide Performance Monitor data. (array of accumulated counters, accumulated time and accumulated PURR and SPURR time for each event set counted)
*time Pointer to a structure containing the timebase value the last time the hardware Performance Monitoring counters were read. This can be converted to time using the time_base_to_time subroutine.
cpuid Contiguous processor numbers going from 0 to _system_configuration.ncpus. This value does not always designate the same processor, even after Dynamic Reconfiguration operations have occurred.
lcpuid Logical processor identifier. Each identifier stays linked to a particular processor between reboots, even after Dynamic Reconfiguration operations. This value must be in the range from 0 to _system_configuartion.max_ncpus.

Return Values

Item Description
0 Operation completed successfully.
Positive error code Refer to the pm_error Subroutine to decode the error code.

Error Codes

Refer to the pm_error Subroutine.

Files

Item Description
/usr/include/pmapi.h Defines standard macros, data types, and subroutines.