PAPI_attach man page on Scientific

Man page or keyword search:  
man Server   26626 pages
apropos Keyword Search (all sections)
Output format
Scientific logo
[printable version]

PAPI_attach(3)			     PAPI			PAPI_attach(3)

NAME
       PAPI_attach -

       Attach PAPI event set to the specified thread id.

SYNOPSIS
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 specifed thread;
       PAPI_detach breaks that connection and restores the EventSet to the
       original executing thread.

       Parameters:
	   EventSet 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.

       Return values:
	   PAPI_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 );

       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.1.1.0			Tue May 21 2013			PAPI_attach(3)
[top]

List of man pages available for Scientific

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net