PAPI 7.1.0.0
Loading...
Searching...
No Matches
PAPI_attach Class Reference

Attach PAPI event set to the specified thread id. More...

Detailed Description

C Interface:
#include <papi.h>
int PAPI_attach( int EventSet, unsigned long tid );

PAPI_attach is a wrapper function that calls PAPI_set_opt to allow PAPI to monitor performance counts on a thread other than the one currently executing. This is sometimes referred to as third party monitoring. PAPI_attach connects the specified EventSet to the specified thread; PAPI_detach breaks that connection and restores the EventSet to the original executing thread.

Parameters
EventSetAn integer handle for a PAPI EventSet as created by PAPI_create_eventset.
tidA thread id as obtained from, for example, PAPI_list_threads or PAPI_thread_id.
Return values
PAPI_ECMPThis feature is unsupported on this component.
PAPI_EINVALOne or more of the arguments is invalid.
PAPI_ENOEVSTThe event set specified does not exist.
PAPI_EISRUNThe event set is currently counting events.
Examples:
unsigned long pid;
pid = fork( );
if ( pid <= 0 )
exit( 1 );
exit( 1 );
// Add Total Instructions Executed to our EventSet
exit( 1 );
// Attach this EventSet to the forked process
exit( 1 );
add PAPI preset or native hardware event to an event set
Attach PAPI event set to the specified thread id.
Create a new empty PAPI EventSet.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
#define PAPI_TOT_INS
Definition: f90papi.h:317
static int EventSet
Definition: init_fini.c:8
static int pid
See also
PAPI_set_opt
PAPI_list_threads
PAPI_thread_id
PAPI_thread_init

The documentation for this class was generated from the following file: