PAPI  5.3.0.0
 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.

Macros

#define papi_return(a)
 

Functions

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)
 

Variables

int _papi_hwi_debug
 
static int init_retval = DEADBEEF
 

Detailed Description

Macro Definition Documentation

#define papi_return (   a)
Value:
do { \
int b = a; \
if (b != PAPI_OK) {\
} \
} 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
static double b[MATRIX_SIZE][MATRIX_SIZE]
Definition: rapl_basic.c:38
int
Definition: iozone.c:18528
return
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 3039 of file papi.c.

3040 {
3042 
3043  memset( &attach, 0x0, sizeof ( attach ) );
3044  attach.attach.eventset = EventSet;
3045  attach.attach.tid = tid;
3046  return ( PAPI_set_opt( option, &attach ) );
3047 }
memset(eventId, 0, size)
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:843
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3360
void *long long tid
Definition: iozone.c:18586
unsigned long tid
Definition: papi.h:813
int EventSet
PAPI_attach_option_t attach
Definition: papi.h:852
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 3799 of file papi.c.

3800 {
3801  return ( PAPI_num_cmp_hwctrs( 0 ) );
3802 }
int PAPI_num_cmp_hwctrs(int cidx)
Definition: papi.c:3854

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

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

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

82 {
83  if ( _papi_hwi_invalid_cmp( cidx ) )
84  return ( PAPI_ENOCMP );
85  return ( cidx );
86 }
#define PAPI_ENOCMP
Definition: fpapi.h:122
static int cidx
Definition: event_info.c:40
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 89 of file papi.c.

90 {
91  return ( valid_component( ESI->CmpIdx ) );
92 }
inline_static int valid_component(int cidx)
Definition: papi.c:81

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

int init_retval = DEADBEEF
static

Definition at line 78 of file papi.c.