Retrieves individual disk usage statistics.
Perfstat Library (libperfstat.a)
#include <libperfstat.h>
The perfstat_disk subroutine retrieves one or more individual disk usage statistics. The same function can also be used to retrieve the number of available sets of disk statistics.
To get one or more sets of disk usage metrics, set the name parameter to the name of the first disk for which statistics are desired, and set the desired_number parameter. To start from the first disk, specify "" or FIRST_DISK as the name. The userbuff parameter must always point to a memory area big enough to contain the desired number of perfstat_disk_t structures that will be copied by this function. Upon return, the name parameter will be set to either the name of the next disk, or to "" after all structures have been copied.
To retrieve the number of available sets of disk usage metrics, set the name and userbuff parameters to NULL, and the desired_number parameter to 0. The returned value will be the number of available sets.
The perfstat_disk subroutine retrieves information from the ODM database. This information is automatically cached into a dictionary which is assumed to be frozen once loaded. The perfstat_reset subroutine must be called to flush the dictionary whenever the machine configuration has changed.
Unless the function is used to retrieve the number of available structures, the number of structures filled is returned upon successful completion. If unsuccessful, a value of -1 is returned and the errno global variable is set.
The perfstat_disk subroutine is unsuccessful if one of the following is true:
EINVAL | One of the parameters is not valid. |
EFAULT | Insufficient memory. |
ENOMEM | The string default length is too short. |
ENOMSG | Cannot access the dictionary. |
The libperfstat.h file defines standard macros, data types, and subroutines.
perfstat_netbuffer Subroutine, perfstat_cpu Subroutine, perfstat_cpu_total Subroutine, perfstat_diskadapter Subroutine, perfstat_disk_total Subroutine, perfstat_memory_total Subroutine, perfstat_netinterface Subroutine, perfstat_netinterface_total Subroutine, perfstat_pagingspace Subroutine, perfstat_protocol Subroutine, and perfstat_reset Subroutine.
Perfstat API in Performance Tools and APIs Technical Reference.