Blame man/man3/PAPI_attach.3

Packit 577717
.TH "PAPI_attach" 3 "Mon Dec 18 2017" "Version 5.6.0.0" "PAPI" \" -*- nroff -*-
Packit 577717
.ad l
Packit 577717
.nh
Packit 577717
.SH NAME
Packit 577717
PAPI_attach \- 
Packit 577717
.PP
Packit 577717
Attach PAPI event set to the specified thread id\&.  
Packit 577717
Packit 577717
.SH SYNOPSIS
Packit 577717
.br
Packit 577717
.PP
Packit 577717
.SH "Detailed Description"
Packit 577717
.PP 
Packit 577717
Packit 577717
.PP
Packit 577717
.nf
Packit 577717
@par C Interface:
Packit 577717
\#include <papi.h> @n
Packit 577717
int PAPI_attach( int EventSet, unsigned long tid );
Packit 577717
Packit 577717
PAPI_attach is a wrapper function that calls PAPI_set_opt to allow PAPI to 
Packit 577717
monitor performance counts on a thread other than the one currently executing. 
Packit 577717
This is sometimes referred to as third party monitoring. 
Packit 577717
PAPI_attach connects the specified EventSet to the specifed thread;
Packit 577717
PAPI_detach breaks that connection and restores the EventSet to the 
Packit 577717
original executing thread. 
Packit 577717
Packit 577717
@param EventSet 
Packit 577717
    An integer handle for a PAPI EventSet as created by PAPI_create_eventset.
Packit 577717
@param tid 
Packit 577717
    A thread id as obtained from, for example, PAPI_list_threads or PAPI_thread_id.
Packit 577717
Packit 577717
@retval PAPI_ECMP 
Packit 577717
    This feature is unsupported on this component.
Packit 577717
@retval PAPI_EINVAL 
Packit 577717
    One or more of the arguments is invalid.
Packit 577717
@retval PAPI_ENOEVST 
Packit 577717
    The event set specified does not exist.
Packit 577717
@retval PAPI_EISRUN 
Packit 577717
    The event set is currently counting events. 
Packit 577717
Packit 577717
@par Examples:
Packit 577717
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
 
Packit 577717
.PP
Packit 577717
.nf
Packit 577717
*   int EventSet = PAPI_NULL;
Packit 577717
*   unsigned long pid;
Packit 577717
*   pid = fork( );
Packit 577717
*   if ( pid <= 0 )
Packit 577717
*   exit( 1 );
Packit 577717
*   if ( PAPI_create_eventset( &EventSet ) != PAPI_OK )
Packit 577717
*   exit( 1 );
Packit 577717
*   // Add Total Instructions Executed to our EventSet
Packit 577717
*   if ( PAPI_add_event( EventSet, PAPI_TOT_INS ) != PAPI_OK )
Packit 577717
*   exit( 1 );
Packit 577717
*   // Attach this EventSet to the forked process
Packit 577717
*   if ( PAPI_attach( EventSet, pid ) != PAPI_OK )
Packit 577717
*   exit( 1 );
Packit 577717
*   
Packit 577717
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
.PP
Packit 577717
\fBSee Also:\fP
Packit 577717
.RS 4
Packit 577717
\fBPAPI_set_opt\fP 
Packit 577717
.PP
Packit 577717
\fBPAPI_list_threads\fP 
Packit 577717
.PP
Packit 577717
\fBPAPI_thread_id\fP 
Packit 577717
.PP
Packit 577717
\fBPAPI_thread_init\fP 
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
Packit 577717
Packit 577717
.SH "Author"
Packit 577717
.PP 
Packit 577717
Generated automatically by Doxygen for PAPI from the source code\&.