wlm_get_bio_stats subroutine

Purpose

Read the WLM disk I/O statistics per class or per device.

Library

Workload Manager Library (libwlm.a)

Syntax

#include <sys/types.h>

#include <sys/wlm.h>

int wlm_get_bio_stats ( dev,  array,  count,  class,  flags)

dev_t dev;

void *array;

int *count;

char *class;

int flags;

Description

The wlm_get_bio_stats subroutine is used to get the WLM disk IO statistics. There are two types of statistics available:

The type of statistics returned by the function is predicated on the value of the flags argument. The flags argument, together with the dev and class arguments, are used to restrict the scope of the function to a class or a set of classes and/or a device or a set of devices. If the value passed to the routine in the count argument is equal to zero (0), wlm_get_bio_stats does not copy any device statistics (and, in this case, the array argument can be a NULL pointer but sets this count to the number of elements in scope for the specific set of parameters. This is a way of finding out how big an array is needed to get all the information for a given set of classes and devices.

wlm_get_bio_stats does not require any special privileges and is accessible to all users. wlm_get_bio_stats fails if WLM is off.

Parameters

Item Description
flags Need to be initialized with WLM_VERSION. Optionally, the following flag values can be or'ed to WLM_VERSION:
WLM_SUPER_ONLY
Limits the scope to superclasses only
WLM_SUB_ONLY
Limits the scope to subclasses only
WLM_BIO_CLASS_INFO
Per class statistics requested
WLM_BIO_DEV_INFO
Per device statistics requested
WLM_BIO_ALL_DEV
Requests statistics for all devices. When this flag is set, the value passed in the dev argument is ignored.
WLM_BIO_ALL_MINOR
Requests statistics for all devices associated with a given major number. When this flag is set, only the major number part of the value passed in the dev argument is used.
WLM_VERBOSE_MODE
Shows the system defined subclasses (Default and Shared)even if they have not been modified by a WLM administrator.

One of the flags WLM_BIO_CLASS_INFO or WLM_BIO_DEV_INFO (and only one) must be specified. WLM_SUPER_ONLY and WLM_SUB_ONLYare mutually exclusive.

dev Device identification (major, minor) of a disk device.
  • If dev is equal to 0, the statistics for all devices are returned (even if WLM_BIO_ALL_DEV is not specified in the flags argument).
  • If dev is not equal to 0 and WLM_BIO_ALL_MINOR is specified in the flags argument, the statistics for all disk devices with the same major number specified in dev are returned.
  • If dev is not equal to 0 and WLM_BIO_ALL_MINOR is not specified in the flags argument, only the statistics for the disk device with the major and minor numbers specified in dev are returned.
array Pointer to an array of wlm_bio_class_info_t structures (when WLM_BIO_CLASS_INFO is specified in the flags argument) or an array of wlm_bio_dev_info_t  structures (when WLM_BIO_DEV_INFO is specified in the flags argument). A NULL pointer can be passed together with a count of 0 to determine how many elements are in scope for the set of arguments passed.
count The address of an integer containing the maximum number of elements to be copied into the array above. If the call to wlm_get_bio_stats is successful, this integer will contain the number of elements actually copied. If the initial value is equal to zero (0), wlm_get_bio_stats sets this value to the number elements selected by the specified combination of flags and class.
class A pointer to a character string containing the name of a superclass or subclass. If class is a pointer to an empty string (""), the information for all classes are returned. The class parameter is taken into account only when the flag WLM_BIO_CLASS_INFO is set.

Return Values

Upon successful completion, a value of 0 is returned and the value pointed to by count is set to the number of elements copied into the array of structures pointed to by array. If the wlm_get_bio_stats subroutine is unsuccessful a non 0 value is returned.

Error Codes

For a list of the possible error codes returned by the WLM API functions, see the description of the header file sys/wlm.h.