Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

papi_attach(3) [centos man page]

PAPI_attach(3)							       PAPI							    PAPI_attach(3)

NAME
PAPI_attach - Attach PAPI event set to the specified thread id. SYNOPSIS
Detailed Description @par C Interface: 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 specifed thread; PAPI_detach breaks that connection and restores the EventSet to the original executing thread. @param EventSet An integer handle for a PAPI EventSet as created by PAPI_create_eventset. @param tid A thread id as obtained from, for example, PAPI_list_threads or PAPI_thread_id. @retval PAPI_ECMP This feature is unsupported on this component. @retval PAPI_EINVAL One or more of the arguments is invalid. @retval PAPI_ENOEVST The event set specified does not exist. @retval PAPI_EISRUN The event set is currently counting events. @par 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: PAPI_set_opt PAPI_list_threads PAPI_thread_id PAPI_thread_init Author Generated automatically by Doxygen for PAPI from the source code. Version 5.2.0.0 Tue Jun 17 2014 PAPI_attach(3)

Check Out this Related Man Page

PAPI_assign_eventset_component(3)				       PAPI					 PAPI_assign_eventset_component(3)

NAME
PAPI_assign_eventset_component - Assign a component index to an existing but empty EventSet. SYNOPSIS
Detailed Description @par C Interface: PAPI_assign_eventset_component( int EventSet, int cidx ); @param EventSet An integer identifier for an existing EventSet. @param cidx An integer identifier for a component. By convention, component 0 is always the cpu component. @retval PAPI_ENOCMP The argument cidx is not a valid component. @retval PAPI_ENOEVST The EventSet doesn't exist. @retval PAPI_ENOMEM Insufficient memory to complete the operation. PAPI_assign_eventset_component assigns a specific component index, as specified by cidx, to a new EventSet identified by EventSet, as obtained from PAPI_create_eventset. EventSets are ordinarily automatically bound to components when the first event is added. This routine is useful to explicitly bind an EventSet to a component before setting component related options. @par Examples: * int EventSet = PAPI_NULL; * if ( PAPI_create_eventset( &EventSet ) != PAPI_OK ) * handle_error( 1 ); * // Bind our EventSet to the cpu component * if ( PAPI_assign_eventset_component( EventSet, 0 ) != PAPI_OK ) * handle_error( 1 ); * // Convert our EventSet to multiplexing * if ( PAPI_set_multiplex( EventSet ) != PAPI_OK ) * handle_error( 1 ); * See Also: PAPI_set_opt PAPI_create_eventset PAPI_add_events PAPI_set_multiplex Author Generated automatically by Doxygen for PAPI from the source code. Version 5.2.0.0 Tue Jun 17 2014 PAPI_assign_eventset_component(3)
Man Page