pm_set_program_wp_mm Subroutine

Purpose

Sets Performance Monitor programming in counter multiplexing mode for a specified workload partition.

Syntax

#include <pmapi.h>

int pm_set_program_wp_mm (cid, *prog_mm)
cid_t cid; 
pm_prog_mm_t *prog_mm;

Description

The pm_set_program_wp_mm subroutine sets Performance Monitor programming in counter multiplexing mode for the processes that belong to a specified workload partition (WPAR). The programming includes the list of the event arrays to be counted, and the associated mode in which to count each event array. A counting mode is defined for each event array. The identifiers must be selected from the lists that the pm_initialize Subroutine 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 each 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. 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.

If you use the pm_set_program_wp_mm subroutine for a multi-mode counting, Process Tree mode (PM_PROCTREE) and Start Counting mode (PM_COUNT) retain the values that are defined in the first programming set.

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 programming is to be set. The CID can be obtained from the WPAR name using the getcorralid system call.
prog_mm Specifies the events and associated 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.