pm_set_counter_frequency_pthread, pm_set_counter_frequency_thread, or pm_set_counter_frequency_mythread Subroutine

Purpose

Configures the counter frequencies for the target thread.

Library

Performance Monitor APIs Library (libpmapi.a)

Syntax

#include <pmapi.h>
int pm_set_counter_frequency_pthread (pid_t pid, tid_t tid,
 ptid_t ptid,
 unsigned counter_freq [MAX_COUNTERS])

int pm_set_counter_frequency_thread (pid_t pid, tid_t tid,
 unsigned counter_freq [MAX_COUNTERS])

int pm_set_counter_frequency_mythread (unsigned counter_freq [MAX_COUNTERS])

Description

The pm_set_counter_frequency_pthread, pm_set_counter_frequency_thread, or pm_set_counter_frequency_mythread subroutines configure the counter frequency values in the Performance Monitor Counters (PMCs) for a given thread.

The pm_set_counter_frequency_pthread subroutine must be used to configure the counter frequency for a target pthread.

The pm_set_counter_frequency_thread subroutine must be used to configure the counter frequency for a target kernel thread.

The pm_set_counter_frequency_mythread subroutine must be used to configure the counter frequency for self thread.

Parameters

Item Description
pid Process ID of the target thread.
tid Kernel thread ID of the target thread. The value can be set to zero, if the parameter is not required.
ptid Pthread ID of the target thread. The value can be set to zero if the parameter is not required.
counter_freq Counter frequencies of the corresponding PMCs.

Return Values

If unsuccessful, a value other than zero is returned and a positive error code is set. If successful, a value of zero is returned.

Error Codes

The subroutine is unsuccessful if the following error codes are returned:

Item Description
Pmapi_NoInit The pm_initialize subroutine is not called.
Pmapi_NoSetProg The pm_set_program subroutine is not called.
Other non-zero error codes Returned by the pmsvcs subroutine.

Files

The pmapi.h file defines standard macros, data types, and subroutines.