[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

perfstat_diskadapter Subroutine

Purpose

Retrieves individual disk adapter usage statistics.

Library

Perfstat Library (libperfstat.a)

Syntax

#include <libperfstat.h>


int perfstat_diskadapter (name, userbuff, sizeof_struct, desired_number)
perfstat_id_t *name;
 perfstat_diskadapter_t *userbuff;
size_t sizeof_struct;
int desired_number;

Description

The perfstat_diskadapter subroutine retrieves one or more individual disk adapter usage statistics. The same function can be used to retrieve the number of available sets of adapter statistics.

To get one or more sets of disk adapter usage metrics, set the name parameter to the name of the first disk adapter for which statistics are desired, and set the desired_number parameter. To start from the first disk adapter, set the name parameter to "" or FIRST_DISKADAPTER. The userbuff parameter must point to a memory area big enough to contain the desired number of perfstat_diskadapter_t structures which will be copied by this function. Upon return, the name parameter will be set to either the name of the next disk adapter, or to "" if all structures have been copied.

To retrieve the number of available sets of disk adapter 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_diskadapter 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.

Parameters

name Contains either "", FIRST_DISKADAPTER, or a name identifying the first disk adapter for which statistics are desired. For example:
scsi0, scsi1, ...
userbuff Points to the memory area to be filled with one or more perfstat_diskadapter_t structures.
sizeof_struct Specifies the size of the perfstat_diskadapter_t structure: sizeof(perfstat_diskadapter_t)
desired_number Specifies the number of perfstat_diskadapter_t structures to copy to userbuff.

Return Values

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.

Error Codes

The perfstat_diskadapter 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.

Files

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

Related Information

perfstat_netbuffer Subroutine, perfstat_cpu Subroutine, perfstat_cpu_total Subroutine, perfstat_disk 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.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]