logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PAPI_detach - Detach PAPI event set from previously specified thread id and restore to executing thread.

Author

       Generated automatically by Doxygen for PAPI from the source code.

Version 7.1.0.0                                  Thu Dec 14 2023                                  PAPI_detach(3)

Detailed Description

CInterface:
           #include <papi.h>
           int PAPI_detach(intEventSet,unsignedlongtid);

       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.

       ParametersEventSet An integer handle for a PAPI EventSet as created by PAPI_create_eventset.
           tid A thread id as obtained from, for example, PAPI_list_threads or PAPI_thread_id.

       ReturnvaluesPAPI_ECMP This feature is unsupported on this component.
           PAPI_EINVAL One or more of the arguments is invalid.
           PAPI_ENOEVST The event set specified does not exist.
           PAPI_EISRUN The event set is currently counting events.

       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 );

       SeealsoPAPI_set_optPAPI_list_threadsPAPI_thread_idPAPI_thread_init

Name

       PAPI_detach - Detach PAPI event set from previously specified thread id and restore to executing thread.

Synopsis

See Also