pm_set_program_wp Subroutine

Purpose

Sets Performance Monitor programming for a specified workload partition (WPAR).

Syntax

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

Description

The pm_set_program_wp subroutine sets Performance Monitor programming for the processes that belong to the specified workload partition (WPAR). The programming includes the events to be counted, and a mode in which to count.

The events to count are in a list of event identifiers. The identifiers must be selected from the list that the pm_initialize subroutine (pm_initialize Subroutine) returns. If the list includes an event that can be used with a threshold, you can specify a threshold value.

In some platforms, you can specify an event group instead of individual events. Set the is_group bit field in the mode and type the group ID in the first element of the event array. The group ID can be obtained by the pm_initialize subroutine.

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. The default values for User mode and Kernel mode are Off. The initial default state is set to delay the counting until calling the pm_start subroutine (pm_start and pm_tstart Subroutine), and to count the activities of all of the processes running into the specified WPAR.

Parameters

Item Description
cid Specifies the identifier of the WPAR for which the subroutine is to be set. The CID can be obtained from the WPAR name using the getcorralid system call.
prog Specifies the events and modes to use in Performance Monitor setup. The following modes are supported:
PM_USER
Counts processes that are running in User mode. The default value is set to Off.
PM_KERNEL
Counts processes that are running in Kernel mode. The default value is set to Off.
PM_COUNT
Starts counting immediately. The default value is set to Not to start counting.
PM_PROCTREE
Sets counting to On for only the calling process and its descendants. The default value is set to Off.

Return Values

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

Error codes

To decode the error code, see the pm_error subroutine (pm_error Subroutine).

Files

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