pm_get_data_generic subroutine

Purpose

Returns performance monitor data for the following threads and groups:
  • Target thread.
  • Target POSIX thread (pthread).
  • The counting group of the target thread.
  • The counter multiplexing mode for the target thread.
  • The counter multiplexing mode for the counting group to which a target thread belongs.
  • The counter multiplexing mode for a target pthread.

Library

Performance monitor APIs library (libpmapi.a)

Syntax

       #include <pmapi.h>
       int pm_get_data_generic (pid,tid,ptid, type,*pmdata)
       pid_t pid;
       tid_t tid;
       ptid_t ptid;
       profiler_type_t type;
       pm_data_time_t *pmdata;	

Description

The pm_get_data_generic subroutine retrieves the current performance monitor data based on parameters that are provided to the 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 the ptid and tid parameters are specified, the following conditions must be met:
  • Both the ptid and tid parameters must refer to a single pthread.
  • The thread must run on a kernel thread context with the specified tid parameter.
The performance monitor data is always a set of 64-bit values per hardware counter on the used system.

Parameters

pid
Process identifier of a target thread. The target thread must be a debuggee process of the caller process.
tid
Thread identifier of a target thread. You can assign a value of 0 to ignore this parameter.
ptid
pthread ID of the target pthread. You can assign a value of 0 to ignore this parameter.
type
Type of the target. The following are two types of targets:
P_THREAD
This flag is set if the target thread is a pthread.
P_THREAD_GROUP
This flag is set if the target is a group.
*pmdata
Pointer to a structure to return the performance monitor data. The structure contains array of accumulated counters, accumulated time, accumulated Processor Utilization Resource Register (PURR) and Scalable Processor Utilization Resource register (SPURR) time for each event set that is counted for the target kernel thread.

Return values

The pm_get_data_generic subroutine returns 0 if no errors occurred during the subroutine execution and returns a positive error code otherwise. Use the pm_error subroutine to decode the error code.

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