perfstat_processor_pool_util subroutine

Purpose

Calculates the metrics related to the processor pool utilization.

Library

perfstat library (libperfstat.a)

Syntax

#include <libperfstat.h>
int perfstat_processor_pool_util (perfstat_rawdata_t * data ,perfstat_processor_pool_util_t * userbuff
int sizeoff_userbuff,
int desired_number);

Description

The perfstat_processor_pool_util subroutine calculates the metrics related to the processor pool utilization for the current and the previous values passed to the perfstat_rawdata_t data structure.

Pool utilization is calculated by specifying the Type field of the perfstat_rawdata_t data structure to SHARED_POOL_UTIL. The SHARED_POOL_UTIL is a macro which can be referred to in the definition of the perfstat_rawdata_t data structure.

Parameters

data
Calculates the metrics related to the processor pool utilization related from the current and previous values.

The data parameter belongs to the perfstat_rawdata_t data structure type. The curstat and the prevstat attributes points to the perfstat_partition_total data structure.

userbuff
Specifies the memory area that is to be filled with one or more perfstat_processor_util_t structure.
sizeof_userbuff
Specifies the size of the perfstat_processor_util_t structure.
desired_number
Specifies the number of perfstat_processor_util_t structures to copy to the userbuff parameter. The value needs to be set to 1.

Error Codes

The perfstat_processor_pool_util subroutine is unsuccessful if the following is true:
EINVAL
The value is set if one of the parameters is not valid.
EPERM
The value is set if the performance data collection is not enabled.

Return Values

If the data parameter is set to NULL and the userbuff parameter is also set to NULL and the sizeof_userbuff parameter is set to 0, size of the perfstat_processor_pool_util_t subroutine is returned.

Unless the perfstat_processor_pool_util subroutine is used to retrieve the number of available structures, the number of structures filled is returned upon successful completion. Otherwise, a value of -1 is returned and the errno global variable is set.
Note: The perfstat_processor_pool_util subroutine requires performance data collection to be enabled to return the processor pool values.