pm_start_thread and pm_tstart_thread Subroutine

Purpose

Starts Performance Monitor counting for a target thread.

Library

Performance Monitor APIs Library (libpmapi.a)

Syntax

#include <pmapi.h>

int pm_start_thread (pid, tid)
pid_t pid;
tid_t tid;

int pm_tstart_thread ( pid,  tid, *time)
pid_t pid;
tid_t tid;
timebasestruct_t *time

Description

This subroutine supports only the 1:1 threading model. It has been superseded by the pm_start_pthread subroutine, which supports both the 1:1 and the M:N threading models. A call to this subroutine is equivalent to a call to the pm_start_pthread subroutine with a ptid parameter equal to 0.

The pm_start_thread subroutine starts Performance Monitor counting for a target kernel thread. The thread must be stopped and must be part of a debuggee process, under the control of the calling process. Counting is effective immediately unless the thread is in a group and the group counting is not currently set to On. The counting state of a thread in a group is obtained by ANDing the thread counting state with the group state.

The pm_tstart_thread subroutine starts Performance Monitor counting for a target kernel thread, and returns a timestamp indicating when the counting was started.

Parameters

Item Description
pid Process ID of target thread. Target process must be a debuggee of the caller process.
tid Thread ID of target thread.
*time Pointer to a structure containing the timebase value when the counting was started. This can be converted to time using the time_base_to_time subroutine.

Return Values

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

Error Codes

Refer to the pm_error (pm_error Subroutine) subroutine.

Files

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