PAPI_detach(3) | PAPI | PAPI_detach(3) |
PAPI_detach -
Detach PAPI event set from previously specified thread id and restore to executing thread.
C Interface:
PAPI_detach 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:
Return values:
Examples:
int EventSet = PAPI_NULL; unsigned long pid; pid = fork( ); if ( pid <= 0 ) exit( 1 ); if ( PAPI_create_eventset( &EventSet ) != PAPI_OK ) exit( 1 ); // Add Total Instructions Executed to our EventSet if ( PAPI_add_event( EventSet, PAPI_TOT_INS ) != PAPI_OK ) exit( 1 ); // Attach this EventSet to the forked process if ( PAPI_attach( EventSet, pid ) != PAPI_OK ) exit( 1 );
See Also:
Generated automatically by Doxygen for PAPI from the source code.
Mon Nov 14 2022 | Version 7.0.0.0 |