pm_get_program_wp Subroutine

Purpose

Retrieves system-wide Performance Monitor setting for a specified workload partition (WPAR).

Library

Performance Monitor APIs Library (libpmapi.a).

Syntax

#include <pmapi.h> 
int pm_get_program_wp (cid, *prog)
cid_t cid;
pm_prog_t *prog;

Description

The pm_get_program_wp subroutine retrieves system-wide Performance Monitor settings for the processes that belong to the specified workload partition. These settings include the mode information and the events that are being counted.

The events being counted are in a list of event identifiers. The identifiers must be selected from the list that the pm_init subroutine returns. If the list includes an event that can be used with a threshold, you can specify a threshold value.

If the events are represented by a group ID, then the is_group bit is set in the mode, and the first element of the events array contains the group ID. The other elements of the events array are not meaningful.

The counting mode includes both User mode and Kernel mode, or either of them; the Initial Counting state; and the Process Tree mode.

If the Process Tree mode is set to the On state, the counting only applies to the calling process and its descendants.

Parameters

Item Description
cid Specifies the identifier of the WPAR for which the subroutine is to retrieve. The CID can be obtained from the WPAR name using the getcorralid system call.
prog Returns the Performance Monitor events and modes that are set. The following modes are supported:
PM_USER
Counting the processes that are running in User mode.
PM_KERNEL
Counting the processes that are running in Kernel mode.
PM_COUNT
The counting is on.
PM_PROCTREE
Counting only the calling process and its descendants.

Return Values

Item Description
0 Operation completed successfully.
Positive error code Run the pm_error subroutine to decode the error code.

Error Codes

To decode the error code, see the pm_error subroutine.

Files

Item Description
/usr/include/pmapi.h Defines standard macros, data types, and subroutines.