perfstat_memory_total Subroutine

Purpose

Retrieves global memory usage statistics.

Library

Perfstat Library (libperfstat.a)

Syntax

#include <libperfstat.h>

int perfstat_memory_total (name, userbuff, sizeof_struct, desired_number)
perfstat_id_t *name;
perfstat_memory_total_t *userbuff;
size_t sizeof_struct;
int desired_number;

Description

The perfstat_memory_total subroutine returns global memory usage statistics in a perfstat_memory_total_t structure.

To get statistics that are global to the whole system, the name parameter must be set to NULL, the userbuff parameter must be allocated, and the desired_number parameter must be set to 1.

This subroutine returns only global processor statistics inside a workload partition (WPAR).

Parameters

Item Description
name

Must be set to NULL.

userbuff Points to the memory area that is to be filled with the perfstat_memory_total_t structure.
sizeof_struct Specifies the size of the perfstat_memory_total_t structure: sizeof(perfstat_memory_total_t).
desired_number Must be set to 1.

Return Values

Upon successful completion, the number of structures filled is returned. This will always be 1. If unsuccessful, a value of -1 is returned and the errno global variable is set.

Error Codes

The perfstat_memory_total subroutine is unsuccessful if the following is true:

Item Description
EINVAL One of the parameters is not valid.

Files

The libperfstat.h file defines standard macros, data types, and subroutines.