resource (BPX1RMG, BPX4RMG) — Measure resources

Function

The resource callable service gets system-wide resource measurement data from the kernel address space.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1RMG): 31-bit
AMODE (BPX41RMG): 64-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

CALL BPX1RMG,(Data_area_length,
              Data_area,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4RMG with the same parameters.

Parameters

Data_area_length
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the length of Data_area, which the resource service is to fill with resource measurement information.

Data_area
Supplied parameter
Type:
Structure
Length:
Specified by the Data_area_length parameter

The name of a field of length Data_area_length, which the resource service is to fill with resource measurement information. This field is mapped by the macro BPXYRMON. For the structure of Data_area, see BPXYRMON — Map resource monitor data.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the resource service returns 0 if the request is successful, or -1 if it is not successful.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the resource service stores the return code. The resource service returns Return_code only if Return_value is -1. See z/OS UNIX System Services Messages and Codes for a complete list of possible return code values. The resource service can return the following value in the Return_code parameter:
Return_code Explanation
EINVAL Incorrect argument.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the resource service stores the reason code. The resource service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

  1. Some values that are returned by the resource service are continually wrapping counters. At the first call to the resource service, these values should be stored. At subsequent calls, the growth in these values should be calculated by the caller. The following list describes the normal use of wrapping counters that are returned by the resource service:
    1. A first call to the resource service returns the current value. (For example, X'FFFFFFD0' is returned for a system call count.)
    2. After some time interval expires, a second call to the resource service returns the new value. (For example, X'00000028' is returned for a system call count.)
    3. At this point, the increase in the counter can be calculated by the calling application. (In this case, we can calculate that X'58', or 88, system calls have been processed between the first resource service request and the second.)

Characteristics and restrictions

There are no restrictions on the use of the resource service.

Examples

For an example using this callable service, see BPX1RMG (resource) example.