PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
papi.h File Reference

Return codes and api definitions. More...

Include dependency graph for papi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PAPI_all_thr_spec_t
 
struct  PAPI_sprofil_t
 
struct  PAPI_itimer_option_t
 
struct  PAPI_inherit_option_t
 
struct  PAPI_domain_option_t
 
struct  PAPI_granularity_option_t
 
struct  PAPI_preload_info_t
 
struct  PAPI_component_info_t
 
struct  PAPI_mpx_info_t
 
struct  PAPI_debug_option_t
 
struct  PAPI_address_map_t
 get the executable's address space info More...
 
struct  PAPI_exe_info_t
 get the executable's info More...
 
struct  PAPI_shlib_info_t
 
struct  PAPI_mh_tlb_info_t
 
struct  PAPI_mh_cache_info_t
 
struct  PAPI_mh_level_t
 
struct  PAPI_mh_info_t
 mh for mem hierarchy maybe? More...
 
struct  PAPI_hw_info_t
 Hardware info structure. More...
 
struct  PAPI_attach_option_t
 
struct  PAPI_cpu_option_t
 
struct  PAPI_multiplex_option_t
 
struct  PAPI_addr_range_option_t
 address range specification for range restricted counting if both are zero, range is disabled More...
 
union  PAPI_option_t
 A pointer to the following is passed to PAPI_set/get_opt() More...
 
struct  PAPI_dmem_info_t
 A pointer to the following is passed to PAPI_get_dmem_info() More...
 
struct  PAPI_event_info_t
 

Macros

#define PAPI_VERSION_NUMBER(maj, min, rev, inc)   (((maj)<<24) | ((min)<<16) | ((rev)<<8) | (inc))
 
#define PAPI_VERSION_MAJOR(x)   (((x)>>24) & 0xff)
 
#define PAPI_VERSION_MINOR(x)   (((x)>>16) & 0xff)
 
#define PAPI_VERSION_REVISION(x)   (((x)>>8) & 0xff)
 
#define PAPI_VERSION_INCREMENT(x)   ((x) & 0xff)
 
#define PAPI_VERSION   PAPI_VERSION_NUMBER(5,4,0,0)
 
#define PAPI_VER_CURRENT   (PAPI_VERSION & 0xffff0000)
 
#define IS_NATIVE(EventCode)   ( ( EventCode & PAPI_NATIVE_MASK ) && !(EventCode & PAPI_PRESET_MASK) )
 
#define IS_PRESET(EventCode)   ( ( EventCode & PAPI_PRESET_MASK ) && !(EventCode & PAPI_NATIVE_MASK) )
 
#define IS_USER_DEFINED(EventCode)   ( ( EventCode & PAPI_PRESET_MASK ) && (EventCode & PAPI_NATIVE_MASK) )
 
#define PAPI_OK   0
 
#define PAPI_EINVAL   -1
 
#define PAPI_ENOMEM   -2
 
#define PAPI_ESYS   -3
 
#define PAPI_ECMP   -4
 
#define PAPI_ESBSTR   -4
 
#define PAPI_ECLOST   -5
 
#define PAPI_EBUG   -6
 
#define PAPI_ENOEVNT   -7
 
#define PAPI_ECNFLCT   -8
 
#define PAPI_ENOTRUN   -9
 
#define PAPI_EISRUN   -10
 
#define PAPI_ENOEVST   -11
 
#define PAPI_ENOTPRESET   -12
 
#define PAPI_ENOCNTR   -13
 
#define PAPI_EMISC   -14
 
#define PAPI_EPERM   -15
 
#define PAPI_ENOINIT   -16
 
#define PAPI_ENOCMP   -17
 
#define PAPI_ENOSUPP   -18
 
#define PAPI_ENOIMPL   -19
 
#define PAPI_EBUF   -20
 
#define PAPI_EINVAL_DOM   -21
 
#define PAPI_EATTR   -22
 
#define PAPI_ECOUNT   -23
 
#define PAPI_ECOMBO   -24
 
#define PAPI_NUM_ERRORS   25
 
#define PAPI_NOT_INITED   0
 
#define PAPI_LOW_LEVEL_INITED   1 /* Low level has called library init */
 
#define PAPI_HIGH_LEVEL_INITED   2 /* High level has called library init */
 
#define PAPI_THREAD_LEVEL_INITED   4 /* Threads have been inited */
 
#define PAPI_NULL   -1
 
#define PAPI_DOM_USER   0x1
 
#define PAPI_DOM_MIN   PAPI_DOM_USER
 
#define PAPI_DOM_KERNEL   0x2
 
#define PAPI_DOM_OTHER   0x4
 
#define PAPI_DOM_SUPERVISOR   0x8
 
#define PAPI_DOM_ALL   (PAPI_DOM_USER|PAPI_DOM_KERNEL|PAPI_DOM_OTHER|PAPI_DOM_SUPERVISOR)
 
#define PAPI_DOM_MAX   PAPI_DOM_ALL
 
#define PAPI_DOM_HWSPEC   0x80000000
 
#define PAPI_USR1_TLS   0x0
 
#define PAPI_USR2_TLS   0x1
 
#define PAPI_HIGH_LEVEL_TLS   0x2
 
#define PAPI_NUM_TLS   0x3
 
#define PAPI_TLS_USR1   PAPI_USR1_TLS
 
#define PAPI_TLS_USR2   PAPI_USR2_TLS
 
#define PAPI_TLS_HIGH_LEVEL   PAPI_HIGH_LEVEL_TLS
 
#define PAPI_TLS_NUM   PAPI_NUM_TLS
 
#define PAPI_TLS_ALL_THREADS   0x10
 
#define PAPI_USR1_LOCK   0x0
 
#define PAPI_USR2_LOCK   0x1
 
#define PAPI_NUM_LOCK   0x2
 
#define PAPI_LOCK_USR1   PAPI_USR1_LOCK
 
#define PAPI_LOCK_USR2   PAPI_USR2_LOCK
 
#define PAPI_LOCK_NUM   PAPI_NUM_LOCK
 
#define PAPI_VENDOR_UNKNOWN   0
 
#define PAPI_VENDOR_INTEL   1
 
#define PAPI_VENDOR_AMD   2
 
#define PAPI_VENDOR_IBM   3
 
#define PAPI_VENDOR_CRAY   4
 
#define PAPI_VENDOR_SUN   5
 
#define PAPI_VENDOR_FREESCALE   6
 
#define PAPI_VENDOR_ARM   7
 
#define PAPI_VENDOR_MIPS   8
 
#define PAPI_GRN_THR   0x1
 
#define PAPI_GRN_MIN   PAPI_GRN_THR
 
#define PAPI_GRN_PROC   0x2
 
#define PAPI_GRN_PROCG   0x4
 
#define PAPI_GRN_SYS   0x8
 
#define PAPI_GRN_SYS_CPU   0x10
 
#define PAPI_GRN_MAX   PAPI_GRN_SYS_CPU
 
#define PAPI_STOPPED   0x01
 
#define PAPI_RUNNING   0x02
 
#define PAPI_PAUSED   0x04
 
#define PAPI_NOT_INIT   0x08
 
#define PAPI_OVERFLOWING   0x10
 
#define PAPI_PROFILING   0x20
 
#define PAPI_MULTIPLEXING   0x40
 
#define PAPI_ATTACHED   0x80
 
#define PAPI_CPU_ATTACHED   0x100
 
#define PAPI_QUIET   0
 
#define PAPI_VERB_ECONT   1
 
#define PAPI_VERB_ESTOP   2
 
#define PAPI_PROFIL_POSIX   0x0
 
#define PAPI_PROFIL_RANDOM   0x1
 
#define PAPI_PROFIL_WEIGHTED   0x2
 
#define PAPI_PROFIL_COMPRESS   0x4
 
#define PAPI_PROFIL_BUCKET_16   0x8
 
#define PAPI_PROFIL_BUCKET_32   0x10
 
#define PAPI_PROFIL_BUCKET_64   0x20
 
#define PAPI_PROFIL_FORCE_SW   0x40
 
#define PAPI_PROFIL_DATA_EAR   0x80
 
#define PAPI_PROFIL_INST_EAR   0x100
 
#define PAPI_PROFIL_BUCKETS   (PAPI_PROFIL_BUCKET_16 | PAPI_PROFIL_BUCKET_32 | PAPI_PROFIL_BUCKET_64)
 
#define PAPI_OVERFLOW_FORCE_SW   0x40
 
#define PAPI_OVERFLOW_HARDWARE   0x80
 
#define PAPI_MULTIPLEX_DEFAULT   0x0
 
#define PAPI_MULTIPLEX_FORCE_SW   0x1
 
#define PAPI_INHERIT_ALL   1
 
#define PAPI_INHERIT_NONE   0
 
#define PAPI_DETACH   1
 
#define PAPI_DEBUG   2
 
#define PAPI_MULTIPLEX   3
 
#define PAPI_DEFDOM   4
 
#define PAPI_DOMAIN   5
 
#define PAPI_DEFGRN   6
 
#define PAPI_GRANUL   7
 
#define PAPI_DEF_MPX_NS   8
 
#define PAPI_MAX_MPX_CTRS   11
 
#define PAPI_PROFIL   12
 
#define PAPI_PRELOAD   13
 
#define PAPI_CLOCKRATE   14
 
#define PAPI_MAX_HWCTRS   15
 
#define PAPI_HWINFO   16
 
#define PAPI_EXEINFO   17
 
#define PAPI_MAX_CPUS   18
 
#define PAPI_ATTACH   19
 
#define PAPI_SHLIBINFO   20
 
#define PAPI_LIB_VERSION   21
 
#define PAPI_COMPONENTINFO   22
 
#define PAPI_DATA_ADDRESS   23
 
#define PAPI_INSTR_ADDRESS   24
 
#define PAPI_DEF_ITIMER   25
 
#define PAPI_DEF_ITIMER_NS   26
 
#define PAPI_CPU_ATTACH   27
 
#define PAPI_INHERIT   28
 
#define PAPI_USER_EVENTS_FILE   29
 
#define PAPI_INIT_SLOTS
 
#define PAPI_MIN_STR_LEN   64 /* For small strings, like names & stuff */
 
#define PAPI_MAX_STR_LEN   128 /* For average run-of-the-mill strings */
 
#define PAPI_2MAX_STR_LEN   256 /* For somewhat longer run-of-the-mill strings */
 
#define PAPI_HUGE_STR_LEN   1024 /* This should be defined in terms of a system parameter */
 
#define PAPI_PMU_MAX   40 /* maximum number of pmu's supported by one component */
 
#define PAPI_DERIVED   0x1 /* Flag to indicate that the event is derived */
 
#define PAPI_ENUM_ALL   PAPI_ENUM_EVENTS
 
#define PAPI_PRESET_BIT_MSC   (1 << PAPI_PRESET_ENUM_MSC) /* Miscellaneous preset event bit */
 
#define PAPI_PRESET_BIT_INS   (1 << PAPI_PRESET_ENUM_INS) /* Instruction related preset event bit */
 
#define PAPI_PRESET_BIT_IDL   (1 << PAPI_PRESET_ENUM_IDL) /* Stalled or Idle preset event bit */
 
#define PAPI_PRESET_BIT_BR   (1 << PAPI_PRESET_ENUM_BR) /* branch related preset events */
 
#define PAPI_PRESET_BIT_CND   (1 << PAPI_PRESET_ENUM_CND) /* conditional preset events */
 
#define PAPI_PRESET_BIT_MEM   (1 << PAPI_PRESET_ENUM_MEM) /* memory related preset events */
 
#define PAPI_PRESET_BIT_CACH   (1 << PAPI_PRESET_ENUM_CACH) /* cache related preset events */
 
#define PAPI_PRESET_BIT_L1   (1 << PAPI_PRESET_ENUM_L1) /* L1 cache related preset events */
 
#define PAPI_PRESET_BIT_L2   (1 << PAPI_PRESET_ENUM_L2) /* L2 cache related preset events */
 
#define PAPI_PRESET_BIT_L3   (1 << PAPI_PRESET_ENUM_L3) /* L3 cache related preset events */
 
#define PAPI_PRESET_BIT_TLB   (1 << PAPI_PRESET_ENUM_TLB) /* Translation Lookaside Buffer events */
 
#define PAPI_PRESET_BIT_FP   (1 << PAPI_PRESET_ENUM_FP) /* Floating Point related preset events */
 
#define PAPI_NTV_GROUP_AND_MASK   0x00FF0000 /* bits occupied by group number */
 
#define PAPI_NTV_GROUP_SHIFT   16 /* bit shift to encode group number */
 
#define long_long   long long
 
#define u_long_long   unsigned long long
 
#define PAPI_MH_TYPE_EMPTY   0x0
 
#define PAPI_MH_TYPE_INST   0x1
 
#define PAPI_MH_TYPE_DATA   0x2
 
#define PAPI_MH_TYPE_VECTOR   0x4
 
#define PAPI_MH_TYPE_TRACE   0x8
 
#define PAPI_MH_TYPE_UNIFIED   (PAPI_MH_TYPE_INST|PAPI_MH_TYPE_DATA)
 
#define PAPI_MH_CACHE_TYPE(a)   (a & 0xf)
 
#define PAPI_MH_TYPE_WT   0x00 /* write-through cache */
 
#define PAPI_MH_TYPE_WB   0x10 /* write-back cache */
 
#define PAPI_MH_CACHE_WRITE_POLICY(a)   (a & 0xf0)
 
#define PAPI_MH_TYPE_UNKNOWN   0x000
 
#define PAPI_MH_TYPE_LRU   0x100
 
#define PAPI_MH_TYPE_PSEUDO_LRU   0x200
 
#define PAPI_MH_CACHE_REPLACEMENT_POLICY(a)   (a & 0xf00)
 
#define PAPI_MH_TYPE_TLB   0x1000 /* tlb, not memory cache */
 
#define PAPI_MH_TYPE_PREF   0x2000 /* prefetch buffer */
 
#define PAPI_MH_MAX_LEVELS   6 /* # descriptors for each TLB or cache level */
 
#define PAPI_MAX_MEM_HIERARCHY_LEVELS   4
 
#define PAPIF_DMEM_VMPEAK   1
 
#define PAPIF_DMEM_VMSIZE   2
 
#define PAPIF_DMEM_RESIDENT   3
 
#define PAPIF_DMEM_HIGH_WATER   4
 
#define PAPIF_DMEM_SHARED   5
 
#define PAPIF_DMEM_TEXT   6
 
#define PAPIF_DMEM_LIBRARY   7
 
#define PAPIF_DMEM_HEAP   8
 
#define PAPIF_DMEM_LOCKED   9
 
#define PAPIF_DMEM_STACK   10
 
#define PAPIF_DMEM_PAGESIZE   11
 
#define PAPIF_DMEM_PTE   12
 
#define PAPIF_DMEM_MAXVAL   12
 
#define PAPI_MAX_INFO_TERMS   12 /* should match PAPI_EVENTS_IN_DERIVED_EVENT defined in papi_internal.h */
 
#define PAPI_COMPONENT_INDEX(a)   PAPI_get_event_component(a)
 
#define PAPI_descr_error(a)   PAPI_strerror(a)
 

Typedefs

typedef unsigned long PAPI_thread_id_t
 
typedef void(* PAPI_overflow_handler_t )(int EventSet, void *address, long long overflow_vector, void *context)
 
typedef int(* PAPI_debug_handler_t )(int code)
 
typedef char * PAPI_user_defined_events_file_t
 

Enumerations

enum  {
  PAPI_ENUM_EVENTS = 0, PAPI_ENUM_FIRST, PAPI_PRESET_ENUM_AVAIL, PAPI_PRESET_ENUM_MSC,
  PAPI_PRESET_ENUM_INS, PAPI_PRESET_ENUM_IDL, PAPI_PRESET_ENUM_BR, PAPI_PRESET_ENUM_CND,
  PAPI_PRESET_ENUM_MEM, PAPI_PRESET_ENUM_CACH, PAPI_PRESET_ENUM_L1, PAPI_PRESET_ENUM_L2,
  PAPI_PRESET_ENUM_L3, PAPI_PRESET_ENUM_TLB, PAPI_PRESET_ENUM_FP, PAPI_NTV_ENUM_UMASKS,
  PAPI_NTV_ENUM_UMASK_COMBOS, PAPI_NTV_ENUM_IARR, PAPI_NTV_ENUM_DARR, PAPI_NTV_ENUM_OPCM,
  PAPI_NTV_ENUM_IEAR, PAPI_NTV_ENUM_DEAR, PAPI_NTV_ENUM_GROUPS
}
 
enum  { PAPI_LOCATION_CORE = 0, PAPI_LOCATION_CPU, PAPI_LOCATION_PACKAGE, PAPI_LOCATION_UNCORE }
 This structure is the event information that is exposed to the user through the API. More...
 
enum  { PAPI_DATATYPE_INT64 = 0, PAPI_DATATYPE_UINT64, PAPI_DATATYPE_FP64, PAPI_DATATYPE_BIT64 }
 
enum  { PAPI_VALUETYPE_RUNNING_SUM = 0, PAPI_VALUETYPE_ABSOLUTE }
 
enum  { PAPI_TIMESCOPE_SINCE_START = 0, PAPI_TIMESCOPE_SINCE_LAST, PAPI_TIMESCOPE_UNTIL_NEXT, PAPI_TIMESCOPE_POINT }
 
enum  { PAPI_UPDATETYPE_ARBITRARY = 0, PAPI_UPDATETYPE_PUSH, PAPI_UPDATETYPE_PULL, PAPI_UPDATETYPE_FIXEDFREQ }
 

Functions

int PAPI_accum (int EventSet, long long *values)
 
int PAPI_add_event (int EventSet, int Event)
 
int PAPI_add_named_event (int EventSet, char *EventName)
 
int PAPI_add_events (int EventSet, int *Events, int number)
 
int PAPI_assign_eventset_component (int EventSet, int cidx)
 
int PAPI_attach (int EventSet, unsigned long tid)
 
int PAPI_cleanup_eventset (int EventSet)
 
int PAPI_create_eventset (int *EventSet)
 
int PAPI_detach (int EventSet)
 
int PAPI_destroy_eventset (int *EventSet)
 
int PAPI_enum_event (int *EventCode, int modifier)
 
int PAPI_enum_cmp_event (int *EventCode, int modifier, int cidx)
 
int PAPI_event_code_to_name (int EventCode, char *out)
 
int PAPI_event_name_to_code (char *in, int *out)
 
int PAPI_get_dmem_info (PAPI_dmem_info_t *dest)
 
int PAPI_get_event_info (int EventCode, PAPI_event_info_t *info)
 
const PAPI_exe_info_tPAPI_get_executable_info (void)
 
const PAPI_hw_info_tPAPI_get_hardware_info (void)
 
const PAPI_component_info_tPAPI_get_component_info (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)
 
long long PAPI_get_real_cyc (void)
 
long long PAPI_get_real_nsec (void)
 
long long PAPI_get_real_usec (void)
 
const PAPI_shlib_info_tPAPI_get_shared_lib_info (void)
 
int PAPI_get_thr_specific (int tag, void **ptr)
 
int PAPI_get_overflow_event_index (int Eventset, long long overflow_vector, int *array, int *number)
 
long long PAPI_get_virt_cyc (void)
 
long long PAPI_get_virt_nsec (void)
 
long long PAPI_get_virt_usec (void)
 
int PAPI_is_initialized (void)
 
int PAPI_library_init (int version)
 
int PAPI_list_events (int EventSet, int *Events, int *number)
 
int PAPI_list_threads (unsigned long *tids, int *number)
 
int PAPI_lock (int)
 
int PAPI_multiplex_init (void)
 
int PAPI_num_cmp_hwctrs (int cidx)
 
int PAPI_num_events (int EventSet)
 
int PAPI_overflow (int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
 
void PAPI_perror (char *msg)
 
int PAPI_profil (void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
 
int PAPI_query_event (int EventCode)
 
int PAPI_query_named_event (char *EventName)
 
int PAPI_read (int EventSet, long long *values)
 
int PAPI_read_ts (int EventSet, long long *values, long long *cyc)
 
int PAPI_register_thread (void)
 
int PAPI_remove_event (int EventSet, int EventCode)
 
int PAPI_remove_named_event (int EventSet, char *EventName)
 
int PAPI_remove_events (int EventSet, int *Events, int number)
 
int PAPI_reset (int EventSet)
 
int PAPI_set_debug (int level)
 
int PAPI_set_cmp_domain (int domain, int cidx)
 
int PAPI_set_domain (int domain)
 
int PAPI_set_cmp_granularity (int granularity, int cidx)
 
int PAPI_set_granularity (int granularity)
 
int PAPI_set_multiplex (int EventSet)
 
int PAPI_set_opt (int option, PAPI_option_t *ptr)
 
int PAPI_set_thr_specific (int tag, void *ptr)
 
void PAPI_shutdown (void)
 
int PAPI_sprofil (PAPI_sprofil_t *prof, int profcnt, int EventSet, int EventCode, int threshold, int flags)
 
int PAPI_start (int EventSet)
 
int PAPI_state (int EventSet, int *status)
 
int PAPI_stop (int EventSet, long long *values)
 
char * PAPI_strerror (int)
 
unsigned long PAPI_thread_id (void)
 
int PAPI_thread_init (unsigned long(*id_fn)(void))
 
int PAPI_unlock (int)
 
int PAPI_unregister_thread (void)
 
int PAPI_write (int EventSet, long long *values)
 
int PAPI_get_event_component (int EventCode)
 
int PAPI_get_eventset_component (int EventSet)
 
int PAPI_get_component_index (char *name)
 
int PAPI_disable_component (int cidx)
 
int PAPI_disable_component_by_name (char *name)
 
int PAPI_accum_counters (long long *values, int array_len)
 
int PAPI_num_counters (void)
 
int PAPI_num_components (void)
 
int PAPI_read_counters (long long *values, int array_len)
 
int PAPI_start_counters (int *events, int array_len)
 
int PAPI_stop_counters (long long *values, int array_len)
 
int PAPI_flips (float *rtime, float *ptime, long long *flpins, float *mflips)
 
int PAPI_flops (float *rtime, float *ptime, long long *flpops, float *mflops)
 
int PAPI_ipc (float *rtime, float *ptime, long long *ins, float *ipc)
 
int PAPI_epc (int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc)
 
int PAPI_num_hwctrs (void)
 

Detailed Description

Macro Definition Documentation

#define IS_NATIVE (   EventCode)    ( ( EventCode & PAPI_NATIVE_MASK ) && !(EventCode & PAPI_PRESET_MASK) )

Definition at line 226 of file papi.h.

#define IS_PRESET (   EventCode)    ( ( EventCode & PAPI_PRESET_MASK ) && !(EventCode & PAPI_NATIVE_MASK) )

Definition at line 227 of file papi.h.

#define IS_USER_DEFINED (   EventCode)    ( ( EventCode & PAPI_PRESET_MASK ) && (EventCode & PAPI_NATIVE_MASK) )

Definition at line 228 of file papi.h.

#define long_long   long long

Definition at line 550 of file papi.h.

#define PAPI_COMPONENT_INDEX (   a)    PAPI_get_event_component(a)

Definition at line 1130 of file papi.h.

#define PAPI_descr_error (   a)    PAPI_strerror(a)

Definition at line 1131 of file papi.h.

#define PAPI_ENUM_ALL   PAPI_ENUM_EVENTS

Definition at line 508 of file papi.h.

#define PAPI_MAX_INFO_TERMS   12 /* should match PAPI_EVENTS_IN_DERIVED_EVENT defined in papi_internal.h */

Definition at line 899 of file papi.h.

#define PAPI_MAX_MEM_HIERARCHY_LEVELS   4

Definition at line 743 of file papi.h.

#define PAPI_MH_CACHE_REPLACEMENT_POLICY (   a)    (a & 0xf00)

Definition at line 739 of file papi.h.

#define PAPI_MH_CACHE_TYPE (   a)    (a & 0xf)

Definition at line 732 of file papi.h.

#define PAPI_MH_CACHE_WRITE_POLICY (   a)    (a & 0xf0)

Definition at line 735 of file papi.h.

#define PAPI_MH_MAX_LEVELS   6 /* # descriptors for each TLB or cache level */

Definition at line 742 of file papi.h.

#define PAPI_MH_TYPE_DATA   0x2

Definition at line 728 of file papi.h.

#define PAPI_MH_TYPE_EMPTY   0x0

Definition at line 726 of file papi.h.

#define PAPI_MH_TYPE_INST   0x1

Definition at line 727 of file papi.h.

#define PAPI_MH_TYPE_LRU   0x100

Definition at line 737 of file papi.h.

#define PAPI_MH_TYPE_PREF   0x2000 /* prefetch buffer */

Definition at line 741 of file papi.h.

#define PAPI_MH_TYPE_PSEUDO_LRU   0x200

Definition at line 738 of file papi.h.

#define PAPI_MH_TYPE_TLB   0x1000 /* tlb, not memory cache */

Definition at line 740 of file papi.h.

#define PAPI_MH_TYPE_TRACE   0x8

Definition at line 730 of file papi.h.

#define PAPI_MH_TYPE_UNIFIED   (PAPI_MH_TYPE_INST|PAPI_MH_TYPE_DATA)

Definition at line 731 of file papi.h.

#define PAPI_MH_TYPE_UNKNOWN   0x000

Definition at line 736 of file papi.h.

#define PAPI_MH_TYPE_VECTOR   0x4

Definition at line 729 of file papi.h.

#define PAPI_MH_TYPE_WB   0x10 /* write-back cache */

Definition at line 734 of file papi.h.

#define PAPI_MH_TYPE_WT   0x00 /* write-through cache */

Definition at line 733 of file papi.h.

#define PAPI_NTV_GROUP_AND_MASK   0x00FF0000 /* bits occupied by group number */

Definition at line 523 of file papi.h.

#define PAPI_NTV_GROUP_SHIFT   16 /* bit shift to encode group number */

Definition at line 524 of file papi.h.

#define PAPI_PRESET_BIT_BR   (1 << PAPI_PRESET_ENUM_BR) /* branch related preset events */

Definition at line 513 of file papi.h.

#define PAPI_PRESET_BIT_CACH   (1 << PAPI_PRESET_ENUM_CACH) /* cache related preset events */

Definition at line 516 of file papi.h.

#define PAPI_PRESET_BIT_CND   (1 << PAPI_PRESET_ENUM_CND) /* conditional preset events */

Definition at line 514 of file papi.h.

#define PAPI_PRESET_BIT_FP   (1 << PAPI_PRESET_ENUM_FP) /* Floating Point related preset events */

Definition at line 521 of file papi.h.

#define PAPI_PRESET_BIT_IDL   (1 << PAPI_PRESET_ENUM_IDL) /* Stalled or Idle preset event bit */

Definition at line 512 of file papi.h.

#define PAPI_PRESET_BIT_INS   (1 << PAPI_PRESET_ENUM_INS) /* Instruction related preset event bit */

Definition at line 511 of file papi.h.

#define PAPI_PRESET_BIT_L1   (1 << PAPI_PRESET_ENUM_L1) /* L1 cache related preset events */

Definition at line 517 of file papi.h.

#define PAPI_PRESET_BIT_L2   (1 << PAPI_PRESET_ENUM_L2) /* L2 cache related preset events */

Definition at line 518 of file papi.h.

#define PAPI_PRESET_BIT_L3   (1 << PAPI_PRESET_ENUM_L3) /* L3 cache related preset events */

Definition at line 519 of file papi.h.

#define PAPI_PRESET_BIT_MEM   (1 << PAPI_PRESET_ENUM_MEM) /* memory related preset events */

Definition at line 515 of file papi.h.

#define PAPI_PRESET_BIT_MSC   (1 << PAPI_PRESET_ENUM_MSC) /* Miscellaneous preset event bit */

Definition at line 510 of file papi.h.

#define PAPI_PRESET_BIT_TLB   (1 << PAPI_PRESET_ENUM_TLB) /* Translation Lookaside Buffer events */

Definition at line 520 of file papi.h.

#define PAPI_VER_CURRENT   (PAPI_VERSION & 0xffff0000)

Definition at line 223 of file papi.h.

#define PAPI_VERSION   PAPI_VERSION_NUMBER(5,4,0,0)

Definition at line 222 of file papi.h.

#define PAPI_VERSION_INCREMENT (   x)    ((x) & 0xff)

Definition at line 218 of file papi.h.

#define PAPI_VERSION_MAJOR (   x)    (((x)>>24) & 0xff)

Definition at line 215 of file papi.h.

#define PAPI_VERSION_MINOR (   x)    (((x)>>16) & 0xff)

Definition at line 216 of file papi.h.

#define PAPI_VERSION_NUMBER (   maj,
  min,
  rev,
  inc 
)    (((maj)<<24) | ((min)<<16) | ((rev)<<8) | (inc))
@page CDI PAPI Component Development Interface @par \em Introduction PAPI-C consists of a Framework and between 1 and 16 Components. The Framework is platform independent and exposes the PAPI API to end users. The Components provide access to hardware information on specific subsystems. By convention, Component 0 is always a CPU Component. This allows default behavior for legacy code, and provides a universal place to define system-wide operations and parameters, like clock rates and interrupt structures. Currently only a single CPU Component can exist at a time. @par No CPU In certain cases it can be desirable to use a generic CPU component for testing instrumentation or for operation on systems that don't provide the proper patches for accessing cpu counters. For such a case, the configure option: @code configure --with-no-cpu-counters = yes @endcode is provided to build PAPI with an "empty" cpu component. @par Exposed Interface A Component for PAPI-C typically consists of a single header file and a single (or small number of) source file(s). All of the information for a Component needed by PAPI-C is exposed through a single data structure that is declared and initialized at the bottom of the main source file. This structure, @ref papi_vector_t , is defined in @ref papi_vector.h . @par Compiling With an Existing Component Components provided with the PAPI source distribution all appear in the src/components directory. Each component exists in its own directory, named the same as the component itself. To include a component in a PAPI build, use the configure command line as shown: @code configure --with-components="component list" @endcode Replace the "component list" argument with either the name of a specific component directory or multiple component names separated by spaces and enclosed in quotes as shown below: \c configure --with-components="acpi lustre infiniband" In some cases components themselves require additional configuration. In these cases an error message will be produced when you run @code make @endcode . To fix this, run the configure script found in the component directory. @par Adding a New Component The mechanics of adding a new component to the PAPI 4.1 build are relatively straight-forward. Add a directory to the papi/src/components directory that is named with the base name of the component. This directory will contain the source files and build files for the new component. If configuration of the component is necessary, additional configure and make files will be needed. The /example directory can be cloned and renamed as a starting point. Other components can be used as examples. This is described in more detail in /components/README. @par Developing a New Component A PAPI-C component generally consists of a header file and one or a small number of source files. The source file must contain a @ref papi_vector_t structure that exposes the internal data and entry points of the component to the PAPI-C Framework. This structure must have a unique name that is exposed externally and contains the name of the directory containing the component source code. Three types of information are exposed in the @ref papi_vector_t structure: Configuration parameters are contained in the @ref PAPI_component_info_t structure; Sizes of opaque data structures necessary for memory management are in the @ref cmp_struct_sizes_t structure; An array of function entry points which, if implemented, provide access to the functionality of the component. If a function is not implemented in a given component its value in the structure can be left unset. In this case it will be initialized to NULL, and result (generally) in benign, although unproductive, behavior. During the development of a component, functions can be implemented and tested in blocks. Further information about an appropriate order for developing these functions can be found in the Component Development Cookbook . @par PAPI-C Open Research Issues:
  • Support for non-standard data types: Currently PAPI supports returned data values expressed as unsigned 64-bit integers. This is appropriate for counting events, but may not be as appropriate for expressing other values. Examples of some other possible data types are shown below. Data type might be expressed as a flag in the event definition.
  • Signed Integer
    • Float: 64-bit IEEE double precision
    • Fixed Point: 32-bit integer and 32-bit fraction
    • Ratios: 32 bit numerator and 32 bit denominator
  • Synchronization: Components might report values with widely different time scales and remote measurements may be significantly skewed in time from local measurements. It would be desirable to have a mechanism to synchronize these values in time.
  • Dynamic Component Discovery: Components currently must be included statically in the PAPI library build. This minimizes startup disruption and time lag, particularly for large parallel systems. In some instances it would also be desirable to support a run-time discovery process for components, possibly by searching a specific location for dynamic libraries.
  • Component Repository: A small collection of components are currently maintained and supported inside the PAPI source distribution. It would be desirable to create a public component repository where 3rd parties could submit components for the use and benefit of the larger community.
  • Multiple CPU Components: With the rise in popularity of heterogeneous computing systems, it may become desirable to have more than one CPU component. Issues must then be resolved relating to which cpu time-base is used, how are interrupts handled, etc.

Definition at line 214 of file papi.h.

#define PAPI_VERSION_REVISION (   x)    (((x)>>8) & 0xff)

Definition at line 217 of file papi.h.

#define PAPIF_DMEM_HEAP   8

Definition at line 892 of file papi.h.

#define PAPIF_DMEM_HIGH_WATER   4

Definition at line 888 of file papi.h.

#define PAPIF_DMEM_LIBRARY   7

Definition at line 891 of file papi.h.

#define PAPIF_DMEM_LOCKED   9

Definition at line 893 of file papi.h.

#define PAPIF_DMEM_MAXVAL   12

Definition at line 897 of file papi.h.

#define PAPIF_DMEM_PAGESIZE   11

Definition at line 895 of file papi.h.

#define PAPIF_DMEM_PTE   12

Definition at line 896 of file papi.h.

#define PAPIF_DMEM_RESIDENT   3

Definition at line 887 of file papi.h.

#define PAPIF_DMEM_SHARED   5

Definition at line 889 of file papi.h.

#define PAPIF_DMEM_STACK   10

Definition at line 894 of file papi.h.

#define PAPIF_DMEM_TEXT   6

Definition at line 890 of file papi.h.

#define PAPIF_DMEM_VMPEAK   1

Definition at line 885 of file papi.h.

#define PAPIF_DMEM_VMSIZE   2

Definition at line 886 of file papi.h.

#define u_long_long   unsigned long long

Definition at line 551 of file papi.h.

Typedef Documentation

typedef int(* PAPI_debug_handler_t)(int code)

Definition at line 682 of file papi.h.

typedef void(* PAPI_overflow_handler_t)(int EventSet, void *address, long long overflow_vector, void *context)

Definition at line 564 of file papi.h.

typedef unsigned long PAPI_thread_id_t

Definition at line 555 of file papi.h.

Specify the file containing user defined events.

Definition at line 716 of file papi.h.

Enumeration Type Documentation

anonymous enum

Possible values for the 'modifier' parameter of the PAPI_enum_event call. A value of 0 (PAPI_ENUM_EVENTS) is always assumed to enumerate ALL events on every platform. PAPI PRESET events are broken into related event categories. Each supported component can have optional values to determine how native events on that component are enumerated.

Enumerator
PAPI_ENUM_EVENTS 

Always enumerate all events

PAPI_ENUM_FIRST 

Enumerate first event (preset or native)

PAPI_PRESET_ENUM_AVAIL 

Enumerate events that exist here

PAPI_PRESET_ENUM_MSC 

Miscellaneous preset events

PAPI_PRESET_ENUM_INS 

Instruction related preset events

PAPI_PRESET_ENUM_IDL 

Stalled or Idle preset events

PAPI_PRESET_ENUM_BR 

Branch related preset events

PAPI_PRESET_ENUM_CND 

Conditional preset events

PAPI_PRESET_ENUM_MEM 

Memory related preset events

PAPI_PRESET_ENUM_CACH 

Cache related preset events

PAPI_PRESET_ENUM_L1 

L1 cache related preset events

PAPI_PRESET_ENUM_L2 

L2 cache related preset events

PAPI_PRESET_ENUM_L3 

L3 cache related preset events

PAPI_PRESET_ENUM_TLB 

Translation Lookaside Buffer events

PAPI_PRESET_ENUM_FP 

Floating Point related preset events

PAPI_NTV_ENUM_UMASKS 

all individual bits for given group

PAPI_NTV_ENUM_UMASK_COMBOS 

all combinations of mask bits for given group

PAPI_NTV_ENUM_IARR 

Enumerate events that support IAR (instruction address ranging)

PAPI_NTV_ENUM_DARR 

Enumerate events that support DAR (data address ranging)

PAPI_NTV_ENUM_OPCM 

Enumerate events that support OPC (opcode matching)

PAPI_NTV_ENUM_IEAR 

Enumerate IEAR (instruction event address register) events

PAPI_NTV_ENUM_DEAR 

Enumerate DEAR (data event address register) events

PAPI_NTV_ENUM_GROUPS 

Enumerate groups an event belongs to (e.g. POWER5)

Definition at line 478 of file papi.h.

556  {
anonymous enum

Enum values for event_info data_type field

Enumerator
PAPI_DATATYPE_INT64 

Default: Data is a signed 64-bit int

PAPI_DATATYPE_UINT64 

Data is a unsigned 64-bit int

PAPI_DATATYPE_FP64 

Data is 64-bit floating point

PAPI_DATATYPE_BIT64 

Data is 64-bit binary

Definition at line 930 of file papi.h.

936  {
anonymous enum

Enum values for event_info value_type field

Enumerator
PAPI_VALUETYPE_RUNNING_SUM 

Data is running sum from start

PAPI_VALUETYPE_ABSOLUTE 

Data is from last read

Definition at line 938 of file papi.h.

942  {
anonymous enum

Enum values for event_info timescope field

Enumerator
PAPI_TIMESCOPE_SINCE_START 

Data is cumulative from start

PAPI_TIMESCOPE_SINCE_LAST 

Data is from last read

PAPI_TIMESCOPE_UNTIL_NEXT 

Data is until next read

PAPI_TIMESCOPE_POINT 

Data is an instantaneous value

Definition at line 944 of file papi.h.

950  {
anonymous enum

Enum values for event_info update_type field

Enumerator
PAPI_UPDATETYPE_ARBITRARY 

Data is cumulative from start

PAPI_UPDATETYPE_PUSH 

Data is pushed

PAPI_UPDATETYPE_PULL 

Data is pulled

PAPI_UPDATETYPE_FIXEDFREQ 

Data is read periodically

Definition at line 952 of file papi.h.

958  {

Function Documentation

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: