All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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)


int _papi_hwi_debug
static int init_retval = DEADBEEF

Detailed Description

Macro Definition Documentation

#define papi_return (   a)
do { \
int b = a; \
if (b != PAPI_OK) {\
} \
APIDBG("EXIT: return: %d\n", b);\
} while (0)
PAPI_debug_handler_t _papi_hwi_debug_handler
Definition: papi_internal.c:56
int _papi_hwi_errno
Definition: papi_internal.c:58
return PAPI_OK
Definition: linux-nvml.c:458
static double a[MATRIX_SIZE][MATRIX_SIZE]
Definition: rapl_basic.c:37
#define APIDBG(format, args...)
Definition: papi_debug.h:64
static double b[MATRIX_SIZE][MATRIX_SIZE]
Definition: rapl_basic.c:38
Definition: iozone.c:18528
Definition: iozone.c:22170
if(gettimeofday(&tp,(struct timezone *) NULL)==-1) perror("gettimeofday")

Definition at line 47 of file papi.c.

Function Documentation

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

Definition at line 3083 of file papi.c.

3084 {
3085  APIDBG("Entry: option: %d, EventSet: %d, tid: %lu\n", option, EventSet, tid);
3088  memset( &attach, 0x0, sizeof ( attach ) );
3089  attach.attach.eventset = EventSet;
3090  attach.attach.tid = tid;
3091  return ( PAPI_set_opt( option, &attach ) );
3092 }
memset(eventId, 0, size)
int EventSet
Definition: data_range.c:25
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:845
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3409
#define APIDBG(format, args...)
Definition: papi_debug.h:64
void *long long tid
Definition: iozone.c:18586
unsigned long tid
Definition: papi.h:815
PAPI_attach_option_t attach
Definition: papi.h:854
static int attach(hwd_control_state_t *ctl, unsigned long tid)
Definition: perfctr.c:242

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 3848 of file papi.c.

3849 {
3850  APIDBG( "Entry:\n");
3851  return ( PAPI_num_cmp_hwctrs( 0 ) );
3852 }
#define APIDBG(format, args...)
Definition: papi_debug.h:64
int PAPI_num_cmp_hwctrs(int cidx)
Definition: papi.c:3904

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 120 of file papi.c.

121 {
122  /* Thread support not implemented on Alpha/OSF because the OSF pfm
123  * counter device driver does not support per-thread counters.
124  * When this is updated, we can remove this if statement
125  */
126  if ( init_level == PAPI_NOT_INITED )
130  papi_return( PAPI_OK );
134 }
int _papi_hwi_set_thread_id_fn(unsigned long(*id_fn)(void))
Definition: threads.c:352
#define papi_return(a)
Definition: papi.c:47
return PAPI_OK
Definition: linux-nvml.c:458
Definition: papi.h:278
Definition: papi.h:281
Definition: papi.h:267
int init_level
Definition: papi_internal.c:54

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 83 of file papi.c.

84 {
85  if ( _papi_hwi_invalid_cmp( cidx ) )
86  return ( PAPI_ENOCMP );
87  return ( cidx );
88 }
static int cidx
Definition: event_info.c:40
Definition: papi.h:268
int _papi_hwi_invalid_cmp(int cidx)

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 91 of file papi.c.

92 {
93  return ( valid_component( ESI->CmpIdx ) );
94 }
inline_static int valid_component(int cidx)
Definition: papi.c:83

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int _papi_hwi_debug

Definition at line 76 of file papi.c.

int init_retval = DEADBEEF

Definition at line 80 of file papi.c.