pm_get_program_wp_mm Subroutine

Purpose

Returns Performance Monitor settings in counter multiplexing mode for a specified Workload partition.

Library

Performance Monitor APIs Library (libpmapi.a)

Syntax

#include <pmapi.h>

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

Description

The pm_get_program_wp_mm subroutine retrieves the current Performance Monitor settings in counter multiplexing mode for a specified workload partition (WPAR). The settings include the mode information and the events being counted, which are in an array of a list of event identifiers. 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, a threshold value is also returned.

When you use the pm_get_program_wp_mm subroutine for multi-mode counting, a mode is associated to each event list.

The counting mode includes both User mode and Kernel mode, or either of them; the current Counting state; and the Process Tree mode. If the Process Tree mode is set, the counting is applied to only the calling process and its descendants.

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

The user application must free the array allocated to store the event lists.

Parameters

Item Description
cid Specifies the identifier of the WPAR for which the programming is to be retrieved. The CID can be obtained from the WPAR name using the getcorralid system call.
prog_mm 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 activities of the calling process and its descendants.

The PM_PROCTREE mode and the PM_COUNT mode are common to all mode set.

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.