papi.c File Reference

Most of the low-level API is here. More...

Include dependency graph for papi.c:

Go to the source code of this file.


#define papi_return(a)


inline_static int valid_component (int cidx)
inline_static int valid_ESI_component (EventSetInfo_t *ESI)
int PAPI_thread_init (unsigned long int(*id_fn)(void))
unsigned long PAPI_thread_id (void)
int PAPI_register_thread (void)
int PAPI_unregister_thread (void)
int PAPI_list_threads (PAPI_thread_id_t *tids, int *number)
int PAPI_get_thr_specific (int tag, void **ptr)
int PAPI_set_thr_specific (int tag, void *ptr)
int PAPI_library_init (int version)
int PAPI_query_event (int EventCode)
int PAPI_query_named_event (char *EventName)
const PAPI_component_info_tPAPI_get_component_info (int cidx)
int PAPI_get_event_info (int EventCode, PAPI_event_info_t *info)
int PAPI_event_code_to_name (int EventCode, char *out)
int PAPI_event_name_to_code (char *in, int *out)
int PAPI_enum_event (int *EventCode, int modifier)
int PAPI_enum_cmp_event (int *EventCode, int modifier, int cidx)
int PAPI_create_eventset (int *EventSet)
int PAPI_assign_eventset_component (int EventSet, int cidx)
int PAPI_get_eventset_component (int EventSet)
int PAPI_add_event (int EventSet, int EventCode)
int PAPI_remove_event (int EventSet, int EventCode)
int PAPI_add_named_event (int EventSet, char *EventName)
int PAPI_remove_named_event (int EventSet, char *EventName)
int PAPI_destroy_eventset (int *EventSet)
int PAPI_start (int EventSet)
int PAPI_stop (int EventSet, long long *values)
int PAPI_reset (int EventSet)
int PAPI_read (int EventSet, long long *values)
int PAPI_read_ts (int EventSet, long long *values, long long *cycles)
int PAPI_accum (int EventSet, long long *values)
int PAPI_write (int EventSet, long long *values)
int PAPI_cleanup_eventset (int EventSet)
int PAPI_multiplex_init (void)
int PAPI_state (int EventSet, int *status)
int PAPI_set_debug (int level)
inline_static int _papi_set_attach (int option, int EventSet, unsigned long tid)
int PAPI_attach (int EventSet, unsigned long tid)
int PAPI_detach (int EventSet)
int PAPI_set_multiplex (int EventSet)
int PAPI_set_opt (int option, PAPI_option_t *ptr)
int PAPI_num_hwctrs (void)
int PAPI_num_cmp_hwctrs (int cidx)
int PAPI_get_multiplex (int EventSet)
int PAPI_get_opt (int option, PAPI_option_t *ptr)
int PAPI_get_cmp_opt (int option, PAPI_option_t *ptr, int cidx)
int PAPI_num_components (void)
int PAPI_num_events (int EventSet)
void PAPI_shutdown (void)
char * PAPI_strerror (int errorCode)
void PAPI_perror (char *msg)
int PAPI_overflow (int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
int PAPI_sprofil (PAPI_sprofil_t *prof, int profcnt, int EventSet, int EventCode, int threshold, int flags)
int PAPI_profil (void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
int PAPI_set_granularity (int granularity)
int PAPI_set_cmp_granularity (int granularity, int cidx)
int PAPI_set_domain (int domain)
int PAPI_set_cmp_domain (int domain, int cidx)
int PAPI_add_events (int EventSet, int *Events, int number)
int PAPI_remove_events (int EventSet, int *Events, int number)
int PAPI_list_events (int EventSet, int *Events, int *number)
int PAPI_get_dmem_info (PAPI_dmem_info_t *dest)
const PAPI_exe_info_tPAPI_get_executable_info (void)
const PAPI_shlib_info_tPAPI_get_shared_lib_info (void)
const PAPI_hw_info_tPAPI_get_hardware_info (void)
long long PAPI_get_real_cyc (void)
long long PAPI_get_real_nsec (void)
long long PAPI_get_real_usec (void)
long long PAPI_get_virt_cyc (void)
long long PAPI_get_virt_nsec (void)
long long PAPI_get_virt_usec (void)
int PAPI_lock (int lck)
int PAPI_unlock (int lck)
int PAPI_is_initialized (void)
int PAPI_get_overflow_event_index (int EventSet, long long overflow_vector, int *array, int *number)
int PAPI_get_event_component (int EventCode)
int PAPI_get_component_index (char *name)
int PAPI_disable_component (int cidx)
int PAPI_disable_component_by_name (char *name)


hwi_presets_t user_defined_events [PAPI_MAX_USER_EVENTS]
int user_defined_events_count
int _papi_hwi_debug
static int init_retval = DEADBEEF

Detailed Description

: Philip Mucci
dan terpstra
Min Zhou
Kevin London
Per Ekman Mods: Gary Mohr

Definition in file papi.c.

Define Documentation

#define papi_return ( a   ) 
do { \
    int b = a; \
    if (b != PAPI_OK) {\
        _papi_hwi_errno = b;\
    } \
    APIDBG("EXIT: return: %d\n", b);\
    return((_papi_hwi_debug_handler ? _papi_hwi_debug_handler(b) : b)); \
} while (0)

Definition at line 50 of file papi.c.

Function Documentation

inline_static int _papi_set_attach ( int  option,
int  EventSet,
unsigned long  tid 

Definition at line 3147 of file papi.c.

03148 {
03149     APIDBG("Entry: option: %d, EventSet: %d, tid: %lu\n", option, EventSet, tid);
03150     PAPI_option_t attach;
03152     memset( &attach, 0x0, sizeof ( attach ) );
03153     attach.attach.eventset = EventSet;
03154     attach.attach.tid = tid;
03155     return ( PAPI_set_opt( option, &attach ) );
03156 }

Here is the call graph for this function:

Here is the caller graph for this function:

int PAPI_num_hwctrs ( void   ) 

return the number of hardware counters for the cpu. for backward compatibility. Don't use!

Definition at line 3917 of file papi.c.

03918 {
03919     APIDBG( "Entry:\n");
03920     return ( PAPI_num_cmp_hwctrs( 0 ) );
03921 }

Here is the call graph for this function:

Here is the caller graph for this function:

int PAPI_thread_init ( unsigned long int(*)(void)  id_fn  ) 

Definition at line 123 of file papi.c.

00124 {
00125     /* Thread support not implemented on Alpha/OSF because the OSF pfm
00126      * counter device driver does not support per-thread counters.
00127      * When this is updated, we can remove this if statement
00128      */
00129     if ( init_level == PAPI_NOT_INITED )
00130         papi_return( PAPI_ENOINIT );
00132     if ( ( init_level & PAPI_THREAD_LEVEL_INITED ) )
00133         papi_return( PAPI_OK );
00135     init_level |= PAPI_THREAD_LEVEL_INITED;
00136     papi_return( _papi_hwi_set_thread_id_fn( id_fn ) );
00137 }

Here is the call graph for this function:

Here is the caller graph for this function:

inline_static int valid_component ( int  cidx  ) 

Definition at line 86 of file papi.c.

00087 {
00088     if ( _papi_hwi_invalid_cmp( cidx ) )
00089         return ( PAPI_ENOCMP );
00090     return ( cidx );
00091 }

Here is the call graph for this function:

Here is the caller graph for this function:

inline_static int valid_ESI_component ( EventSetInfo_t ESI  ) 

Definition at line 94 of file papi.c.

00095 {
00096     return ( valid_component( ESI->CmpIdx ) );
00097 }

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

Definition at line 79 of file papi.c.

int init_retval = DEADBEEF [static]

Definition at line 83 of file papi.c.

hwi_presets_t user_defined_events[PAPI_MAX_USER_EVENTS]

Definition at line 59 of file papi_internal.c.

Definition at line 60 of file papi_internal.c.

Generated on 17 Nov 2016 for PAPI by  doxygen 1.6.1