pm_get_program_pgroup Subroutine

Purpose

Retrieves Performance Monitor settings for the counting group to which a target pthread belongs.

Library

Performance Monitor APIs Library (libpmapi.a)

Syntax

#include <pmapi.h>  

int pm_get_program_pgroup ( pid,  tid,  ptid,  *prog)
pid_t pid;
tid_t tid;
ptid_t ptid;
pm_prog_t *prog;

Description

The pm_get_program_pgroup subroutine retrieves the Performance Monitor settings for the counting group to which a target pthread belongs. The pthread must be stopped and must be part of a debuggee process, under the control of the calling process. This includes mode information and the events being counted, which are in a list of event identifiers. The identifiers come from the lists returned by the pm_inititialize subroutine.

If the pthread is running in 1:1 mode, only the tid parameter must be specified. If the pthread is running in m:n mode, only the ptid parameter must be specified. If both theptid and tid parameters are specified, they must be referring to a single pthread with the ptid parameter specified and currently running on a kernel thread with specified tid parameter.

The counting mode includes the user mode and kernel mode, and the current counting state.

If the list includes an event that can be used with a threshold (as indicated by the pm_initialize subroutine), a threshold value is also returned.

Parameters

Item Description
pid Process ID of target pthread. The target process must be an argument of a debug process.
tid Thread ID of target pthread. To ignore this parameter, set it to 0.
ptid Pthread ID of the target pthread. To ignore this parameter, set it to 0.
*prog Returns which Performance Monitor events and modes are set. The following modes are supported:
PM_USER
Counts process running in user mode
PM_KERNEL
Counts process running kernel mode
PM_COUNT
Counting is on
PM_PROCESS
Process-level counting group

Return Values

Item Description
0 No errors occurred.
Positive error code Refer to the pm_error Subroutine to decode the error code.

Error Codes

Refer to the pm_error Subroutine.

Files

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