PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
papi.h
Go to the documentation of this file.
1 /****************************/
2 /* THIS IS OPEN SOURCE CODE */
3 /****************************/
4 
22 #ifndef _PAPI
23 #define _PAPI
24 
206 /* Definition of PAPI_VERSION format. Note that each of the four
207  * components _must_ be less than 256. Also, the PAPI_VER_CURRENT
208  * masks out the revision and increment. Any revision change is supposed
209  * to be binary compatible between the user application code and the
210  * run-time library. Any modification that breaks this compatibility
211  * _should_ modify the minor version number as to force user applications
212  * to re-compile.
213  */
214 #define PAPI_VERSION_NUMBER(maj,min,rev,inc) (((maj)<<24) | ((min)<<16) | ((rev)<<8) | (inc))
215 #define PAPI_VERSION_MAJOR(x) (((x)>>24) & 0xff)
216 #define PAPI_VERSION_MINOR(x) (((x)>>16) & 0xff)
217 #define PAPI_VERSION_REVISION(x) (((x)>>8) & 0xff)
218 #define PAPI_VERSION_INCREMENT(x)((x) & 0xff)
219 
220 /* This is the official PAPI version */
221 /* The final digit represents the patch count */
222 #define PAPI_VERSION PAPI_VERSION_NUMBER(5,3,0,0)
223 #define PAPI_VER_CURRENT (PAPI_VERSION & 0xffff0000)
224 
225  /* Tests for checking event code type */
226 #define IS_NATIVE( EventCode ) ( ( EventCode & PAPI_NATIVE_MASK ) && !(EventCode & PAPI_PRESET_MASK) )
227 #define IS_PRESET( EventCode ) ( ( EventCode & PAPI_PRESET_MASK ) && !(EventCode & PAPI_NATIVE_MASK) )
228 #define IS_USER_DEFINED( EventCode ) ( ( EventCode & PAPI_PRESET_MASK ) && (EventCode & PAPI_NATIVE_MASK) )
229 
230 #ifdef __cplusplus
231 extern "C"
232 {
233 #endif
234 
235 /* Include files */
236 
237 #include <sys/types.h>
238 #include <limits.h>
239 #include "papiStdEventDefs.h"
240 
250 #define PAPI_OK 0
251 #define PAPI_EINVAL -1
252 #define PAPI_ENOMEM -2
253 #define PAPI_ESYS -3
254 #define PAPI_ECMP -4
255 #define PAPI_ESBSTR -4
256 #define PAPI_ECLOST -5
257 #define PAPI_EBUG -6
258 #define PAPI_ENOEVNT -7
259 #define PAPI_ECNFLCT -8
260 #define PAPI_ENOTRUN -9
261 #define PAPI_EISRUN -10
262 #define PAPI_ENOEVST -11
263 #define PAPI_ENOTPRESET -12
264 #define PAPI_ENOCNTR -13
265 #define PAPI_EMISC -14
266 #define PAPI_EPERM -15
267 #define PAPI_ENOINIT -16
268 #define PAPI_ENOCMP -17
269 #define PAPI_ENOSUPP -18
270 #define PAPI_ENOIMPL -19
271 #define PAPI_EBUF -20
272 #define PAPI_EINVAL_DOM -21
273 #define PAPI_EATTR -22
274 #define PAPI_ECOUNT -23
275 #define PAPI_ECOMBO -24
276 #define PAPI_NUM_ERRORS 25
278 #define PAPI_NOT_INITED 0
279 #define PAPI_LOW_LEVEL_INITED 1 /* Low level has called library init */
280 #define PAPI_HIGH_LEVEL_INITED 2 /* High level has called library init */
281 #define PAPI_THREAD_LEVEL_INITED 4 /* Threads have been inited */
282 
290 #define PAPI_NULL -1
296 #define PAPI_DOM_USER 0x1
297 #define PAPI_DOM_MIN PAPI_DOM_USER
298 #define PAPI_DOM_KERNEL 0x2
299 #define PAPI_DOM_OTHER 0x4
300 #define PAPI_DOM_SUPERVISOR 0x8
301 #define PAPI_DOM_ALL (PAPI_DOM_USER|PAPI_DOM_KERNEL|PAPI_DOM_OTHER|PAPI_DOM_SUPERVISOR)
302 /* #define PAPI_DOM_DEFAULT PAPI_DOM_USER NOW DEFINED BY COMPONENT */
303 #define PAPI_DOM_MAX PAPI_DOM_ALL
304 #define PAPI_DOM_HWSPEC 0x80000000
315 #define PAPI_USR1_TLS 0x0
316 #define PAPI_USR2_TLS 0x1
317 #define PAPI_HIGH_LEVEL_TLS 0x2
318 #define PAPI_NUM_TLS 0x3
319 #define PAPI_TLS_USR1 PAPI_USR1_TLS
320 #define PAPI_TLS_USR2 PAPI_USR2_TLS
321 #define PAPI_TLS_HIGH_LEVEL PAPI_HIGH_LEVEL_TLS
322 #define PAPI_TLS_NUM PAPI_NUM_TLS
323 #define PAPI_TLS_ALL_THREADS 0x10
329 #define PAPI_USR1_LOCK 0x0
330 #define PAPI_USR2_LOCK 0x1
331 #define PAPI_NUM_LOCK 0x2
332 #define PAPI_LOCK_USR1 PAPI_USR1_LOCK
333 #define PAPI_LOCK_USR2 PAPI_USR2_LOCK
334 #define PAPI_LOCK_NUM PAPI_NUM_LOCK
337 /* Remove this! If it breaks userspace we might have to add it back :( */
338 /* #define PAPI_MPX_DEF_DEG 32 */
339 
343 #define PAPI_VENDOR_UNKNOWN 0
344 #define PAPI_VENDOR_INTEL 1
345 #define PAPI_VENDOR_AMD 2
346 #define PAPI_VENDOR_IBM 3
347 #define PAPI_VENDOR_CRAY 4
348 #define PAPI_VENDOR_SUN 5
349 #define PAPI_VENDOR_FREESCALE 6
350 #define PAPI_VENDOR_ARM 7
351 #define PAPI_VENDOR_MIPS 8
358 #define PAPI_GRN_THR 0x1
359 #define PAPI_GRN_MIN PAPI_GRN_THR
360 #define PAPI_GRN_PROC 0x2
361 #define PAPI_GRN_PROCG 0x4
362 #define PAPI_GRN_SYS 0x8
363 #define PAPI_GRN_SYS_CPU 0x10
364 #define PAPI_GRN_MAX PAPI_GRN_SYS_CPU
370 #define PAPI_STOPPED 0x01
371 #define PAPI_RUNNING 0x02
372 #define PAPI_PAUSED 0x04
373 #define PAPI_NOT_INIT 0x08
374 #define PAPI_OVERFLOWING 0x10
375 #define PAPI_PROFILING 0x20
376 #define PAPI_MULTIPLEXING 0x40
377 #define PAPI_ATTACHED 0x80
378 #define PAPI_CPU_ATTACHED 0x100
384 #define PAPI_QUIET 0
385 #define PAPI_VERB_ECONT 1
386 #define PAPI_VERB_ESTOP 2
392 #define PAPI_PROFIL_POSIX 0x0
393 #define PAPI_PROFIL_RANDOM 0x1
394 #define PAPI_PROFIL_WEIGHTED 0x2
395 #define PAPI_PROFIL_COMPRESS 0x4
396 #define PAPI_PROFIL_BUCKET_16 0x8
397 #define PAPI_PROFIL_BUCKET_32 0x10
398 #define PAPI_PROFIL_BUCKET_64 0x20
399 #define PAPI_PROFIL_FORCE_SW 0x40
400 #define PAPI_PROFIL_DATA_EAR 0x80
401 #define PAPI_PROFIL_INST_EAR 0x100
402 #define PAPI_PROFIL_BUCKETS (PAPI_PROFIL_BUCKET_16 | PAPI_PROFIL_BUCKET_32 | PAPI_PROFIL_BUCKET_64)
405 /* @defgroup overflow_defns Overflow definitions
406  @{ */
407 #define PAPI_OVERFLOW_FORCE_SW 0x40
408 #define PAPI_OVERFLOW_HARDWARE 0x80
414 #define PAPI_MULTIPLEX_DEFAULT 0x0
415 #define PAPI_MULTIPLEX_FORCE_SW 0x1
421 #define PAPI_INHERIT_ALL 1
422 #define PAPI_INHERIT_NONE 0
425 #define PAPI_DETACH 1
426 #define PAPI_DEBUG 2
427 #define PAPI_MULTIPLEX 3
428 #define PAPI_DEFDOM 4
429 #define PAPI_DOMAIN 5
430 #define PAPI_DEFGRN 6
431 #define PAPI_GRANUL 7
432 #define PAPI_DEF_MPX_NS 8
433  //#define PAPI_EDGE_DETECT 9
434  //#define PAPI_INVERT 10
435 #define PAPI_MAX_MPX_CTRS 11
436 #define PAPI_PROFIL 12
437 #define PAPI_PRELOAD 13
438 #define PAPI_CLOCKRATE 14
439 #define PAPI_MAX_HWCTRS 15
440 #define PAPI_HWINFO 16
441 #define PAPI_EXEINFO 17
442 #define PAPI_MAX_CPUS 18
443 #define PAPI_ATTACH 19
444 #define PAPI_SHLIBINFO 20
445 #define PAPI_LIB_VERSION 21
446 #define PAPI_COMPONENTINFO 22
447 /* Currently the following options are only available on Itanium; they may be supported elsewhere in the future */
448 #define PAPI_DATA_ADDRESS 23
449 #define PAPI_INSTR_ADDRESS 24
450 #define PAPI_DEF_ITIMER 25
451 #define PAPI_DEF_ITIMER_NS 26
452 /* Currently the following options are only available on systems using the perf_events component within papi */
453 #define PAPI_CPU_ATTACH 27
454 #define PAPI_INHERIT 28
455 #define PAPI_USER_EVENTS_FILE 29
457 #define PAPI_INIT_SLOTS 64 /*Number of initialized slots in
458  DynamicArray of EventSets */
460 #define PAPI_MIN_STR_LEN 64 /* For small strings, like names & stuff */
461 #define PAPI_MAX_STR_LEN 128 /* For average run-of-the-mill strings */
462 #define PAPI_2MAX_STR_LEN 256 /* For somewhat longer run-of-the-mill strings */
463 #define PAPI_HUGE_STR_LEN 1024 /* This should be defined in terms of a system parameter */
465 #define PAPI_DERIVED 0x1 /* Flag to indicate that the event is derived */
466 
475 enum {
476  PAPI_ENUM_EVENTS = 0,
480  /* PAPI PRESET section */
494  /* PAPI native event related section */
503 };
505 #define PAPI_ENUM_ALL PAPI_ENUM_EVENTS
506 
507 #define PAPI_PRESET_BIT_MSC (1 << PAPI_PRESET_ENUM_MSC) /* Miscellaneous preset event bit */
508 #define PAPI_PRESET_BIT_INS (1 << PAPI_PRESET_ENUM_INS) /* Instruction related preset event bit */
509 #define PAPI_PRESET_BIT_IDL (1 << PAPI_PRESET_ENUM_IDL) /* Stalled or Idle preset event bit */
510 #define PAPI_PRESET_BIT_BR (1 << PAPI_PRESET_ENUM_BR) /* branch related preset events */
511 #define PAPI_PRESET_BIT_CND (1 << PAPI_PRESET_ENUM_CND) /* conditional preset events */
512 #define PAPI_PRESET_BIT_MEM (1 << PAPI_PRESET_ENUM_MEM) /* memory related preset events */
513 #define PAPI_PRESET_BIT_CACH (1 << PAPI_PRESET_ENUM_CACH) /* cache related preset events */
514 #define PAPI_PRESET_BIT_L1 (1 << PAPI_PRESET_ENUM_L1) /* L1 cache related preset events */
515 #define PAPI_PRESET_BIT_L2 (1 << PAPI_PRESET_ENUM_L2) /* L2 cache related preset events */
516 #define PAPI_PRESET_BIT_L3 (1 << PAPI_PRESET_ENUM_L3) /* L3 cache related preset events */
517 #define PAPI_PRESET_BIT_TLB (1 << PAPI_PRESET_ENUM_TLB) /* Translation Lookaside Buffer events */
518 #define PAPI_PRESET_BIT_FP (1 << PAPI_PRESET_ENUM_FP) /* Floating Point related preset events */
520 #define PAPI_NTV_GROUP_AND_MASK 0x00FF0000 /* bits occupied by group number */
521 #define PAPI_NTV_GROUP_SHIFT 16 /* bit shift to encode group number */
524 /*
525 The Low Level API
526 
527 The following functions represent the low level portion of the
528 PerfAPI. These functions provide greatly increased efficiency and
529 functionality over the high level API presented in the next
530 section. All of the following functions are callable from both C and
531 Fortran except where noted. As mentioned in the introduction, the low
532 level API is only as powerful as the component upon which it is
533 built. Thus some features may not be available on every platform. The
534 converse may also be true, that more advanced features may be
535 available and defined in the header file. The user is encouraged to
536 read the documentation carefully. */
537 
538 
539 #include <signal.h>
540 
541 /* Earlier versions of PAPI define a special long_long type to mask
542  an incompatibility between the Windows compiler and gcc-style compilers.
543  That problem no longer exists, so long_long has been purged from the source.
544  The defines below preserve backward compatibility. Their use is deprecated,
545  but will continue to be supported in the near term.
546 */
547 #define long_long long long
548 #define u_long_long unsigned long long
552  typedef unsigned long PAPI_thread_id_t;
553 
555  typedef struct _papi_all_thr_spec {
556  int num;
557  PAPI_thread_id_t *id;
558  void **data;
561  typedef void (*PAPI_overflow_handler_t) (int EventSet, void *address,
562  long long overflow_vector, void *context);
564  /* Handle C99 compilation */
565  /* All caddr_ts should become unsigned longs eventually. */
566 #ifdef __STDC_VERSION__
567  #if (__STDC_VERSION__ == 199901L)
568  typedef char *caddr_t;
569  #else
570 
571  #endif
572 #endif
573 
575  typedef struct _papi_sprofil {
576  void *pr_base;
577  unsigned pr_size;
578  caddr_t pr_off;
579  unsigned pr_scale;
583  } PAPI_sprofil_t;
584 
586  typedef struct _papi_itimer_option {
587  int itimer_num;
588  int itimer_sig;
589  int ns;
590  int flags;
594  typedef struct _papi_inherit_option {
595  int eventset;
596  int inherit;
600  typedef struct _papi_domain_option {
601  int def_cidx;
602  int eventset;
603  int domain;
607  typedef struct _papi_granularity_option {
608  int def_cidx;
609  int eventset;
610  int granularity;
614  typedef struct _papi_preload_option {
615  char lib_preload_env[PAPI_MAX_STR_LEN];
616  char lib_preload_sep;
617  char lib_dir_env[PAPI_MAX_STR_LEN];
618  char lib_dir_sep;
622  typedef struct _papi_component_option {
623  char name[PAPI_MAX_STR_LEN];
624  char short_name[PAPI_MIN_STR_LEN];
626  char description[PAPI_MAX_STR_LEN];
627  char version[PAPI_MIN_STR_LEN];
628  char support_version[PAPI_MIN_STR_LEN];
629  char kernel_version[PAPI_MIN_STR_LEN];
630  char disabled_reason[PAPI_MAX_STR_LEN];
631  int disabled;
632  int CmpIdx;
633  int num_cntrs;
634  int num_mpx_cntrs;
635  int num_preset_events;
637  int default_domain;
638  int available_domains;
639  int default_granularity;
640  int available_granularities;
641  int hardware_intr_sig;
642 // int opcode_match_width; /**< Width of opcode matcher if exists, 0 if not */
643  int component_type;
644  int reserved[8]; /* */
645  unsigned int hardware_intr:1;
646  unsigned int precise_intr:1;
647  unsigned int posix1b_timers:1;
648  unsigned int kernel_profile:1;
649  unsigned int kernel_multiplex:1;
650 // unsigned int data_address_range:1; /**< Supports data address range limiting */
651 // unsigned int instr_address_range:1; /**< Supports instruction address range limiting */
652  unsigned int fast_counter_read:1;
653  unsigned int fast_real_timer:1;
654  unsigned int fast_virtual_timer:1;
655  unsigned int attach:1;
656  unsigned int attach_must_ptrace:1;
657 // unsigned int edge_detect:1; /**< Supports edge detection on events */
658 // unsigned int invert:1; /**< Supports invert detection on events */
659 // unsigned int profile_ear:1; /**< Supports data/instr/tlb miss address sampling */
660 // unsigned int cntr_groups:1; /**< Underlying hardware uses counter groups (e.g. POWER5)*/
661  unsigned int cntr_umasks:1;
662 // unsigned int cntr_IEAR_events:1; /**< counters support instr event addr register */
663 // unsigned int cntr_DEAR_events:1; /**< counters support data event addr register */
664 // unsigned int cntr_OPCM_events:1; /**< counter events support opcode matching */
665  /* This should be a granularity option */
666  unsigned int cpu:1;
667  unsigned int inherit:1;
668  unsigned int reserved_bits:12;
672  typedef struct _papi_mpx_info {
673  int timer_sig;
674  int timer_num;
675  int timer_us;
678  typedef int (*PAPI_debug_handler_t) (int code);
679 
681  typedef struct _papi_debug_option {
682  int level;
688  typedef struct _papi_address_map {
689  char name[PAPI_HUGE_STR_LEN];
690  caddr_t text_start;
691  caddr_t text_end;
692  caddr_t data_start;
693  caddr_t data_end;
694  caddr_t bss_start;
695  caddr_t bss_end;
700  typedef struct _papi_program_info {
701  char fullname[PAPI_HUGE_STR_LEN];
702  PAPI_address_map_t address_info;
706  typedef struct _papi_shared_lib_info {
707  PAPI_address_map_t *map;
708  int count;
712 typedef char* PAPI_user_defined_events_file_t;
713 
714  /* The following defines and next for structures define the memory heirarchy */
715  /* All sizes are in BYTES */
716  /* Associativity:
717  0: Undefined;
718  1: Direct Mapped
719  SHRT_MAX: Full
720  Other values == associativity
721  */
722 #define PAPI_MH_TYPE_EMPTY 0x0
723 #define PAPI_MH_TYPE_INST 0x1
724 #define PAPI_MH_TYPE_DATA 0x2
725 #define PAPI_MH_TYPE_VECTOR 0x4
726 #define PAPI_MH_TYPE_TRACE 0x8
727 #define PAPI_MH_TYPE_UNIFIED (PAPI_MH_TYPE_INST|PAPI_MH_TYPE_DATA)
728 #define PAPI_MH_CACHE_TYPE(a) (a & 0xf)
729 #define PAPI_MH_TYPE_WT 0x00 /* write-through cache */
730 #define PAPI_MH_TYPE_WB 0x10 /* write-back cache */
731 #define PAPI_MH_CACHE_WRITE_POLICY(a) (a & 0xf0)
732 #define PAPI_MH_TYPE_UNKNOWN 0x000
733 #define PAPI_MH_TYPE_LRU 0x100
734 #define PAPI_MH_TYPE_PSEUDO_LRU 0x200
735 #define PAPI_MH_CACHE_REPLACEMENT_POLICY(a) (a & 0xf00)
736 #define PAPI_MH_TYPE_TLB 0x1000 /* tlb, not memory cache */
737 #define PAPI_MH_TYPE_PREF 0x2000 /* prefetch buffer */
738 #define PAPI_MH_MAX_LEVELS 6 /* # descriptors for each TLB or cache level */
739 #define PAPI_MAX_MEM_HIERARCHY_LEVELS 4
742  typedef struct _papi_mh_tlb_info {
743  int type;
744  int num_entries;
746  int associativity;
750  typedef struct _papi_mh_cache_info {
751  int type;
752  int size;
753  int line_size;
754  int num_lines;
755  int associativity;
759  typedef struct _papi_mh_level_info {
766  typedef struct _papi_mh_info {
767  int levels;
773  typedef struct _papi_hw_info {
774  int ncpu;
775  int threads;
776  int cores;
777  int sockets;
778  int nnodes;
779  int totalcpus;
780  int vendor;
781  char vendor_string[PAPI_MAX_STR_LEN];
782  int model;
783  char model_string[PAPI_MAX_STR_LEN];
784  float revision;
785  int cpuid_family;
786  int cpuid_model;
787  int cpuid_stepping;
789  int cpu_max_mhz;
790  int cpu_min_mhz;
792  PAPI_mh_info_t mem_hierarchy;
793  int virtualized;
794  char virtual_vendor_string[PAPI_MAX_STR_LEN];
796  char virtual_vendor_version[PAPI_MAX_STR_LEN];
799  /* Legacy Values, do not use */
800  float mhz;
801  int clock_mhz;
803  /* For future expansion */
804  int reserved[8];
805 
807 
809  typedef struct _papi_attach_option {
810  int eventset;
811  unsigned long tid;
815  typedef struct _papi_cpu_option {
816  int eventset;
817  unsigned int cpu_num;
821  typedef struct _papi_multiplex_option {
822  int eventset;
823  int ns;
824  int flags;
829  typedef struct _papi_addr_range_option {
830  int eventset;
831  caddr_t start;
832  caddr_t end;
833  int start_off;
834  int end_off;
841  typedef union
842  {
855  PAPI_shlib_info_t *shlib_info;
856  PAPI_exe_info_t *exe_info;
859  PAPI_user_defined_events_file_t events_file;
864  typedef struct _dmem_t {
865  long long peak;
866  long long size;
867  long long resident;
868  long long high_water_mark;
869  long long shared;
870  long long text;
871  long long library;
872  long long heap;
873  long long locked;
874  long long stack;
875  long long pagesize;
876  long long pte;
879 /* Fortran offsets into PAPI_dmem_info_t structure. */
880 
881 #define PAPIF_DMEM_VMPEAK 1
882 #define PAPIF_DMEM_VMSIZE 2
883 #define PAPIF_DMEM_RESIDENT 3
884 #define PAPIF_DMEM_HIGH_WATER 4
885 #define PAPIF_DMEM_SHARED 5
886 #define PAPIF_DMEM_TEXT 6
887 #define PAPIF_DMEM_LIBRARY 7
888 #define PAPIF_DMEM_HEAP 8
889 #define PAPIF_DMEM_LOCKED 9
890 #define PAPIF_DMEM_STACK 10
891 #define PAPIF_DMEM_PAGESIZE 11
892 #define PAPIF_DMEM_PTE 12
893 #define PAPIF_DMEM_MAXVAL 12
895 #define PAPI_MAX_INFO_TERMS 12 /* should match PAPI_EVENTS_IN_DERIVED_EVENT defined in papi_internal.h */
896 
918 enum {
919  PAPI_LOCATION_CORE = 0,
923 };
926 enum {
927  PAPI_DATATYPE_INT64 = 0,
931 };
934 enum {
937 };
940 enum {
945 };
948 enum {
953 };
955 
956  typedef struct event_info {
957  unsigned int event_code;
959  char symbol[PAPI_HUGE_STR_LEN];
960  char short_descr[PAPI_MIN_STR_LEN];
962  char long_descr[PAPI_HUGE_STR_LEN];
967  int component_index;
968  char units[PAPI_MIN_STR_LEN];
969  int location;
970  int data_type;
971  int value_type;
972  int timescope;
973  int update_type;
974  int update_freq;
976  /* PRESET SPECIFIC FIELDS FOLLOW */
977 
978 
979 
980  unsigned int count;
985  unsigned int event_type;
988  char derived[PAPI_MIN_STR_LEN];
991  char postfix[PAPI_2MAX_STR_LEN];
996  unsigned int code[PAPI_MAX_INFO_TERMS];
1001  char name[PAPI_MAX_INFO_TERMS]
1002  [PAPI_2MAX_STR_LEN];
1006  char note[PAPI_HUGE_STR_LEN];
1012 
1013 
1014 
1015 
1019  int PAPI_accum(int EventSet, long long * values);
1020  int PAPI_add_event(int EventSet, int Event);
1021  int PAPI_add_named_event(int EventSet, char *EventName);
1022  int PAPI_add_events(int EventSet, int *Events, int number);
1023  int PAPI_assign_eventset_component(int EventSet, int cidx);
1024  int PAPI_attach(int EventSet, unsigned long tid);
1025  int PAPI_cleanup_eventset(int EventSet);
1026  int PAPI_create_eventset(int *EventSet);
1027  int PAPI_detach(int EventSet);
1028  int PAPI_destroy_eventset(int *EventSet);
1029  int PAPI_enum_event(int *EventCode, int modifier);
1030  int PAPI_enum_cmp_event(int *EventCode, int modifier, int cidx);
1031  int PAPI_event_code_to_name(int EventCode, char *out);
1032  int PAPI_event_name_to_code(char *in, int *out);
1034  int PAPI_get_event_info(int EventCode, PAPI_event_info_t * info);
1036  const PAPI_hw_info_t *PAPI_get_hardware_info(void);
1038  int PAPI_get_multiplex(int EventSet);
1039  int PAPI_get_opt(int option, PAPI_option_t * ptr);
1040  int PAPI_get_cmp_opt(int option, PAPI_option_t * ptr,int cidx);
1041  long long PAPI_get_real_cyc(void);
1042  long long PAPI_get_real_nsec(void);
1043  long long PAPI_get_real_usec(void);
1045  int PAPI_get_thr_specific(int tag, void **ptr);
1046  int PAPI_get_overflow_event_index(int Eventset, long long overflow_vector, int *array, int *number);
1047  long long PAPI_get_virt_cyc(void);
1048  long long PAPI_get_virt_nsec(void);
1049  long long PAPI_get_virt_usec(void);
1050  int PAPI_is_initialized(void);
1051  int PAPI_library_init(int version);
1052  int PAPI_list_events(int EventSet, int *Events, int *number);
1053  int PAPI_list_threads(unsigned long *tids, int *number);
1054  int PAPI_lock(int);
1055  int PAPI_multiplex_init(void);
1056  int PAPI_num_cmp_hwctrs(int cidx);
1057  int PAPI_num_events(int EventSet);
1058  int PAPI_overflow(int EventSet, int EventCode, int threshold,
1060  void PAPI_perror(char *msg );
1061  int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset,
1062  unsigned scale, int EventSet, int EventCode,
1063  int threshold, int flags);
1064  int PAPI_query_event(int EventCode);
1065  int PAPI_query_named_event(char *EventName);
1066  int PAPI_read(int EventSet, long long * values);
1067  int PAPI_read_ts(int EventSet, long long * values, long long *cyc);
1068  int PAPI_register_thread(void);
1069  int PAPI_remove_event(int EventSet, int EventCode);
1070  int PAPI_remove_named_event(int EventSet, char *EventName);
1071  int PAPI_remove_events(int EventSet, int *Events, int number);
1072  int PAPI_reset(int EventSet);
1073  int PAPI_set_debug(int level);
1074  int PAPI_set_cmp_domain(int domain, int cidx);
1075  int PAPI_set_domain(int domain);
1076  int PAPI_set_cmp_granularity(int granularity, int cidx);
1077  int PAPI_set_granularity(int granularity);
1078  int PAPI_set_multiplex(int EventSet);
1079  int PAPI_set_opt(int option, PAPI_option_t * ptr);
1080  int PAPI_set_thr_specific(int tag, void *ptr);
1081  void PAPI_shutdown(void);
1082  int PAPI_sprofil(PAPI_sprofil_t * prof, int profcnt, int EventSet, int EventCode, int threshold, int flags);
1083  int PAPI_start(int EventSet);
1084  int PAPI_state(int EventSet, int *status);
1085  int PAPI_stop(int EventSet, long long * values);
1086  char *PAPI_strerror(int);
1087  unsigned long PAPI_thread_id(void);
1088  int PAPI_thread_init(unsigned long (*id_fn) (void));
1089  int PAPI_unlock(int);
1090  int PAPI_unregister_thread(void);
1091  int PAPI_write(int EventSet, long long * values);
1092  int PAPI_get_event_component(int EventCode);
1093  int PAPI_get_eventset_component(int EventSet);
1094  int PAPI_get_component_index(char *name);
1095  int PAPI_disable_component(int cidx);
1096  int PAPI_disable_component_by_name( char *name );
1110  int PAPI_accum_counters(long long * values, int array_len);
1111  int PAPI_num_counters(void);
1112  int PAPI_num_components(void);
1113  int PAPI_read_counters(long long * values, int array_len);
1114  int PAPI_start_counters(int *events, int array_len);
1115  int PAPI_stop_counters(long long * values, int array_len);
1116  int PAPI_flips(float *rtime, float *ptime, long long * flpins, float *mflips);
1117  int PAPI_flops(float *rtime, float *ptime, long long * flpops, float *mflops);
1118  int PAPI_ipc(float *rtime, float *ptime, long long * ins, float *ipc);
1119  int PAPI_epc(int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc);
1124 /* Backwards compatibility hacks. Remove eventually? */
1125 int PAPI_num_hwctrs(void);
1126 #define PAPI_COMPONENT_INDEX(a) PAPI_get_event_component(a)
1127 #define PAPI_descr_error(a) PAPI_strerror(a)
1129 #ifdef __cplusplus
1130 }
1131 #endif
1132 #endif
i inherit inherit
int PAPI_stop(int EventSet, long long *values)
Definition: papi.c:2225
int PAPI_is_initialized(void)
Definition: papi.c:6324
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
Definition: papi.c:803
int PAPI_add_event(int EventSet, int EventCode)
Definition: papi.c:1597
void PAPI_perror(char *msg)
Definition: papi.c:4520
Hardware info structure.
Definition: papi.h:775
long long PAPI_get_virt_usec(void)
Definition: papi.c:6233
int PAPI_set_cmp_granularity(int granularity, int cidx)
Definition: papi.c:5486
int PAPI_reset(int EventSet)
Definition: papi.c:2370
long long flags
Definition: iozone.c:12330
int PAPI_add_named_event(int EventSet, char *EventName)
Definition: papi.c:1809
const PAPI_shlib_info_t * PAPI_get_shared_lib_info(void)
Definition: papi.c:6005
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
unsigned long PAPI_thread_id(void)
Definition: papi.c:157
int PAPI_write(int EventSet, long long *values)
Definition: papi.c:2720
start
Definition: iozone.c:22736
int PAPI_ipc(float *rtime, float *ptime, long long *ins, float *ipc)
Definition: papi_hl.c:316
cpu
Definition: iozone.c:3872
int PAPI_remove_event(int EventSet, int EventCode)
Definition: papi.c:1692
long long PAPI_get_virt_cyc(void)
Definition: papi.c:6161
int ns
Definition: iozone.c:20358
off64_t offset
Definition: iozone.c:1279
int PAPI_flops(float *rtime, float *ptime, long long *flpops, float *mflops)
Definition: papi_hl.c:259
int PAPI_accum_counters(long long *values, int array_len)
Definition: papi_hl.c:756
int PAPI_num_components(void)
Definition: papi.c:4272
int PAPI_enum_event(int *EventCode, int modifier)
Definition: papi.c:1143
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
int PAPI_detach(int EventSet)
Definition: papi.c:3156
void(* PAPI_overflow_handler_t)(int EventSet, void *address, long long overflow_vector, void *context)
Definition: papi.h:563
get the executable&#39;s info
Definition: papi.h:702
int PAPI_register_thread(void)
Definition: papi.c:203
int count
Definition: iozone.c:22422
int PAPI_overflow(int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
Definition: papi.c:4655
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:843
void
Definition: iozone.c:18627
int PAPI_remove_events(int EventSet, int *Events, int number)
Definition: papi.c:5794
long long PAPI_get_virt_nsec(void)
Definition: papi.c:6191
int PAPI_sprofil(PAPI_sprofil_t *prof, int profcnt, int EventSet, int EventCode, int threshold, int flags)
Definition: papi.c:4910
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3360
int PAPI_add_events(int EventSet, int *Events, int number)
Definition: papi.c:5707
#define PAPI_HUGE_STR_LEN
Definition: papi.h:465
int num_native_events
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
Definition: papi.c:841
int PAPI_disable_component_by_name(char *name)
Definition: papi.c:6574
int multiplex(void)
Definition: multiplex.c:35
int PAPI_set_cmp_domain(int domain, int cidx)
Definition: papi.c:5622
int PAPI_disable_component(int cidx)
Definition: papi.c:6524
int PAPI_flips(float *rtime, float *ptime, long long *flpins, float *mflips)
Definition: papi_hl.c:204
int PAPI_epc(int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc)
Definition: papi_hl.c:383
int PAPI_num_cmp_hwctrs(int cidx)
Definition: papi.c:3854
#define PAPI_2MAX_STR_LEN
Definition: papi.h:464
int PAPI_get_thr_specific(int tag, void **ptr)
Definition: papi.c:357
int PAPI_accum(int EventSet, long long *values)
Definition: papi.c:2653
static struct counter_info * event_info
#define PAPI_MH_MAX_LEVELS
Definition: papi.h:740
int PAPI_thread_init(unsigned long int(*id_fn)(void))
Definition: papi.c:118
int PAPI_library_init(int version)
Definition: papi.c:495
int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
Definition: papi.c:5303
long long debug
Definition: iozone.c:1374
char buf[200]
Definition: iozone.c:19609
int PAPI_num_hwctrs(void)
Definition: papi.c:3799
int PAPI_stop_counters(long long *values, int array_len)
Definition: papi_hl.c:803
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:866
void PAPI_shutdown(void)
Definition: papi.c:4344
int PAPI_get_cmp_opt(int option, PAPI_option_t *ptr, int cidx)
Definition: papi.c:4221
const PAPI_exe_info_t * PAPI_get_executable_info(void)
Definition: papi.c:5975
int PAPI_num_events(int EventSet)
Definition: papi.c:4310
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4030
long long page_size
Definition: iozone.c:428
char *long long size
Definition: iozone.c:12023
static int cidx
Definition: event_info.c:40
void int num
Definition: iozone.c:22151
int PAPI_state(int EventSet, int *status)
Definition: papi.c:2956
get the executable&#39;s address space info
Definition: papi.h:690
void *long long tid
Definition: iozone.c:18586
int(* PAPI_debug_handler_t)(int code)
Definition: papi.h:680
int PAPI_set_granularity(int granularity)
Definition: papi.c:5421
int PAPI_get_component_index(char *name)
Definition: papi.c:6469
char events[MAX_EVENTS][BUFSIZ]
address range specification for range restricted counting if both are zero, range is disabled ...
Definition: papi.h:831
int PAPI_enum_cmp_event(int *EventCode, int modifier, int cidx)
Definition: papi.c:1305
uint32_t id
Definition: linux-cuda.c:293
mh for mem hierarchy maybe?
Definition: papi.h:768
void handler(int EventSet, void *address, long long overflow_vector, void *context)
Definition: rapl_overflow.c:16
int PAPI_cleanup_eventset(int EventSet)
Definition: papi.c:2795
char * addr
Definition: iozone.c:12026
int PAPI_assign_eventset_component(int EventSet, int cidx)
Definition: papi.c:1460
char version[]
Definition: fileop.c:134
int PAPI_create_eventset(int *EventSet)
Definition: papi.c:1399
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:920
int threshold
#define PAPI_MAX_INFO_TERMS
Definition: papi.h:897
int PAPI_event_name_to_code(char *in, int *out)
Definition: papi.c:1003
int PAPI_get_dmem_info(PAPI_dmem_info_t *dest)
Definition: papi.c:5924
int PAPI_query_event(int EventCode)
Definition: papi.c:695
int PAPI_get_overflow_event_index(int EventSet, long long overflow_vector, int *array, int *number)
Definition: papi.c:6378
int EventSet
int PAPI_multiplex_init(void)
Definition: papi.c:2887
int PAPI_read_ts(int EventSet, long long *values, long long *cycles)
Definition: papi.c:2557
long long PAPI_get_real_usec(void)
Definition: papi.c:6125
long long status
Definition: iozone.c:1335
int PAPI_unregister_thread(void)
Definition: papi.c:239
int PAPI_set_thr_specific(int tag, void *ptr)
Definition: papi.c:433
char * PAPI_strerror(int errorCode)
Definition: papi.c:4470
int PAPI_query_named_event(char *EventName)
Definition: papi.c:763
char * name
Definition: iozone.c:23648
int PAPI_unlock(int lck)
Definition: papi.c:6282
int PAPI_read_counters(long long *values, int array_len)
Definition: papi_hl.c:706
int
Definition: iozone.c:18528
#define PAPI_MIN_STR_LEN
Definition: papi.h:462
long long PAPI_get_real_nsec(void)
Definition: papi.c:6098
int PAPI_num_counters(void)
Definition: papi_hl.c:537
int PAPI_start_counters(int *events, int array_len)
Definition: papi_hl.c:593
int Event[MAX_EVENTS]
int PAPI_set_multiplex(int EventSet)
Definition: papi.c:3230
unsigned long PAPI_thread_id_t
Definition: papi.h:554
int PAPI_destroy_eventset(int *EventSet)
Definition: papi.c:1937
#define PAPI_MAX_STR_LEN
Definition: papi.h:463
int PAPI_set_domain(int domain)
Definition: papi.c:5552
int PAPI_attach(int EventSet, unsigned long tid)
Definition: papi.c:3100
static int attach(hwd_control_state_t *ctl, unsigned long tid)
Definition: perfctr.c:242
long long PAPI_get_real_cyc(void)
Definition: papi.c:6078
int PAPI_read(int EventSet, long long *values)
Definition: papi.c:2469
int PAPI_start(int EventSet)
Definition: papi.c:2019
int PAPI_get_multiplex(int EventSet)
Definition: papi.c:3916
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6046
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
int PAPI_lock(int lck)
Definition: papi.c:6262
int PAPI_remove_named_event(int EventSet, char *EventName)
Definition: papi.c:1886
static const PAPI_hw_info_t * hw_info
Definition: byte_profile.c:23
int PAPI_list_threads(PAPI_thread_id_t *tids, int *number)
Definition: papi.c:281
int PAPI_get_event_component(int EventCode)
Definition: papi.c:6443
char * PAPI_user_defined_events_file_t
Definition: papi.h:714
int PAPI_set_debug(int level)
Definition: papi.c:3027
#define PAPI_MAX_MEM_HIERARCHY_LEVELS
Definition: papi.h:741
int PAPI_list_events(int EventSet, int *Events, int *number)
Definition: papi.c:5863
int PAPI_get_eventset_component(int EventSet)
Definition: papi.c:1503
char * ptr
Definition: iozone.c:23586