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 (const 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 (const 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, const char *EventName)
int PAPI_remove_named_event (int EventSet, const 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 (const 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 (const char *name)
int PAPI_disable_component (int cidx)
int PAPI_disable_component_by_name (const 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

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:55
int _papi_hwi_errno
Definition: papi_internal.c:57
return PAPI_OK
Definition: linux-nvml.c:497
#define APIDBG(format, args...)
Definition: papi_debug.h:64
Definition: iozone.c:18528
Definition: iozone.c:22170
static double b[MATRIX_SIZE][MATRIX_SIZE]
Definition: libmsr_basic.c:39
if(gettimeofday(&tp,(struct timezone *) NULL)==-1) perror("gettimeofday")
static double a[MATRIX_SIZE][MATRIX_SIZE]
Definition: libmsr_basic.c:38

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

3140 {
3141  APIDBG("Entry: option: %d, EventSet: %d, tid: %lu\n", option, EventSet, tid);
3144  memset( &attach, 0x0, sizeof ( attach ) );
3145  attach.attach.eventset = EventSet;
3146  attach.attach.tid = tid;
3147  return ( PAPI_set_opt( option, &attach ) );
3148 }
int EventSet
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:848
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3465
#define APIDBG(format, args...)
Definition: papi_debug.h:64
void *long long tid
Definition: iozone.c:18586
unsigned long tid
Definition: papi.h:818
PAPI_attach_option_t attach
Definition: papi.h:857
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 3909 of file papi.c.

3910 {
3911  APIDBG( "Entry:\n");
3912  return ( PAPI_num_cmp_hwctrs( 0 ) );
3913 }
#define APIDBG(format, args...)
Definition: papi_debug.h:64
int PAPI_num_cmp_hwctrs(int cidx)
Definition: papi.c:3965

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.

124 {
125  /* Thread support not implemented on Alpha/OSF because the OSF pfm
126  * counter device driver does not support per-thread counters.
127  * When this is updated, we can remove this if statement
128  */
129  if ( init_level == PAPI_NOT_INITED )
133  papi_return( PAPI_OK );
137 }
int _papi_hwi_set_thread_id_fn(unsigned long(*id_fn)(void))
Definition: threads.c:352
#define papi_return(a)
Definition: papi.c:50
return PAPI_OK
Definition: linux-nvml.c:497
Definition: papi.h:280
Definition: papi.h:283
Definition: papi.h:269
int init_level
Definition: papi_internal.c:53

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.

87 {
88  if ( _papi_hwi_invalid_cmp( cidx ) )
89  return ( PAPI_ENOCMP );
90  return ( cidx );
91 }
static int cidx
Definition: papi.h:270
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 94 of file papi.c.

95 {
96  return ( valid_component( ESI->CmpIdx ) );
97 }
inline_static int valid_component(int cidx)
Definition: papi.c:86

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

int init_retval = DEADBEEF

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.

int user_defined_events_count

Definition at line 60 of file papi_internal.c.