wlm_get_info Subroutine

Purpose

Read the characteristics of superclasses or subclasses.

Library

Workload Manager Library (libwlm.a)

Syntax

#include <sys/wlm.h>

int wlm_get_info ( wlmargs,  info,  count)

struct wlm_args *wlmargs;

struct wlm_info *info

int *count

Description

The wlm_get_info subroutine is used to get the characteristics of the classes defined in the active Workload Manager (WLM) configuration, together with their current resource usage statistics. For a detailed description of the fields of the structure wlm_info, refer to the description of the wlm.h header file in the AIX® Version 7.1 Files Reference documentation.

By default, the scope of the wlm_get_info subroutine is all the superclasses and all the subclasses. This scope can be limited to a subset of the classes using flags in the versflags field of wlm_args or a superclass or subclass name in the name field of the substructure class_definition of wlm_args.

The information related to the superclasses and subclasses within the scope of wlm_get_info are copied to the array of wlm_info structures pointed to by info. The total number of classes for which information is copied to the array at info is limited to the value of the integer pointed to by count. If the routine is successful, the value of the integer pointed to by count is set to the actual number of classes copied. If the value passed to the routine for the count is equal to zero (0), wlm_get_info does not copy any class statistics but sets this count to the number of classes 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 (superclasses or subclasses).

This is a way of finding out how big an array is needed to get all the information for a given set of classes (superclasses or subclasses).

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

Parameters

wlmargs
The address of a struct wlm_args data structure.

The following fields of the wlm_args structure and the embedded substructures need to be provided:

versflags
Needs to be initialized with WLM_VERSION. Optionally, the following flag value 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_VERBOSE_MODE
Shows the system-defined subclasses (Default and Shared) even if they have not been modified by a WLM administrator.

WLM_SUPER_ONLY and WLM_SUB_ONLY are mutually exclusive.

 
name
Contains either a null string or the name of a valid superclass or subclass (in the form Super.Sub). This field can be used in conjunction with the flags to further narrow the scope of wlm_get_info:
  • If the name of a subclass is provided, wlm_get_info returns the statistics only for the specified subclass.
  • If the name of a superclass is provided or if none of the WLM_SUPER_ONLY and WLM_SUB_ONLY flag is provided, wlm_get_info returns the statistics for the specified superclass and all its subclasses.
  • If the name of a superclass is provided together with WLM_SUPER_ONLY, wlm_get_info returns only the statistics for the specified superclass.
  • If the name of a superclass is provided together with WLM_SUB_ONLY, wlm_get_info returns the statistics for all the subclasses of the specified superclass.

All the other fields of the wlm_args structure can be left uninitialized.

info
The address of an array of structures of type struct wlm_info. Upon successful return from wlm_get_info, this array contains the WLM statistics for the classes selected.
count
The address of an integer containing the maximum number of element (of type wlm_info) for wlm_get_info to copy into the array above. If the call to wlm_get_info is successful, this integer contains the number of elements actually copied. If the initial value is equal to zero (0), wlm_get_info sets this value to the number of classes selected by the specified combination of versflags and name above.

Return Values

Upon successful completion, the wlm_get_info subroutine returns a value of 0. If the wlm_get_info 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 wlm.h header file.