perfstat_virtualdisktarget Subroutine

Purpose

Retrieves the Virtual Target Device (VTD) usage statistics in Virtual I/O Server (VIOS).

Library

Perfstat Library (libperfstat.a)

Syntax

#include <libperfstat.h>
int perfstat_virtualdisktarget (name, userbuff, sizeof_struct, desired_number)
perfstat_id_t * name;
perfstat_disk_t * userbuff;
size_t sizeof_struct;int desired_number;

Description

The perfstat_virtualdisktarget subroutine retrieves one or more virtual target device usage statistics.

The same function can also be used to retrieve the number of available sets of virtual target device usage statistics.

To get one or more sets of virtual target device usage metrics, set the name parameter to the name of the first virtual target device for which the statistics are to be collected, and set the desired_number parameter. To start from the first virtual target device, set the name parameter to the quotation marks (" ") or FIRST_VTD. The userbuff parameter must always point to the memory area that is big enough to contain the number of perfstat_disk_t structures that this subroutine is to copy. Upon return, the name parameter is set to either the name of the next network adapter, or to the quotation marks (" ") after all of the structures are copied.

To retrieve the number of available sets of virtual target device usage metrics, set the name parameter and the userbuff parameter to the value of null, and the desired_number parameter to the value of zero. The returned value is the number of available sets. The perfstat_virtualdisktarget subroutine provides the statistics only in VIOS machine.

The following perfstat_disk_t structure fields are not filled by the perfstat_virtualdisktarget subroutine:
  • description
  • vgname
  • size
  • free
  • qdepth
  • adapter
  • paths_count
  • wpar_id

Parameters

Item Description
name Contains the quotation marks (" "), FIRST_VTD, or the name indicating the first network adapter for which the statistics is to be retrieved. For example: vtscsi0, vtscsi1.
userbuff Points to the memory that is to be filled with one or more perfstat_disk_t structures.
sizeof_struct Specifies the size of the perfstat_disk_t structure.
desired_number Specifies the number of perfstat_disk_t structures to copy to the userbuff parameter.

Return Values

Upon successful completion, the number of structures filled is returned.

If unsuccessful, a value of -1 is returned and the errno global variable is set.

Error Codes

The perfstat_virtualdisktarget subroutine is unsuccessful if one of the following is true:

Item Description
EINVAL One of the parameters is not valid
EFAULT The memory is not sufficient
ENOMEM The default length of the string is too short.
ENOMSG The dictionary is not accessible.

Files

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