PAPI  5.6.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 
25 #pragma GCC visibility push(default)
26 
208 /* Definition of PAPI_VERSION format. Note that each of the four
209  * components _must_ be less than 256. Also, the PAPI_VER_CURRENT
210  * masks out the revision and increment. Any revision change is supposed
211  * to be binary compatible between the user application code and the
212  * run-time library. Any modification that breaks this compatibility
213  * _should_ modify the minor version number as to force user applications
214  * to re-compile.
215  */
216 #define PAPI_VERSION_NUMBER(maj,min,rev,inc) (((maj)<<24) | ((min)<<16) | ((rev)<<8) | (inc))
217 #define PAPI_VERSION_MAJOR(x) (((x)>>24) & 0xff)
218 #define PAPI_VERSION_MINOR(x) (((x)>>16) & 0xff)
219 #define PAPI_VERSION_REVISION(x) (((x)>>8) & 0xff)
220 #define PAPI_VERSION_INCREMENT(x)((x) & 0xff)
221 
222 /* This is the official PAPI version */
223 /* The final digit represents the patch count */
224 #define PAPI_VERSION PAPI_VERSION_NUMBER(5,6,0,0)
225 #define PAPI_VER_CURRENT (PAPI_VERSION & 0xffff0000)
226 
227  /* Tests for checking event code type */
228 #define IS_NATIVE( EventCode ) ( ( EventCode & PAPI_NATIVE_MASK ) && !(EventCode & PAPI_PRESET_MASK) )
229 #define IS_PRESET( EventCode ) ( ( EventCode & PAPI_PRESET_MASK ) && !(EventCode & PAPI_NATIVE_MASK) )
230 #define IS_USER_DEFINED( EventCode ) ( ( EventCode & PAPI_PRESET_MASK ) && (EventCode & PAPI_NATIVE_MASK) )
231 
232 #ifdef __cplusplus
233 extern "C"
234 {
235 #endif
236 
237 /* Include files */
238 
239 #include <sys/types.h>
240 #include <limits.h>
241 #include "papiStdEventDefs.h"
242 
252 #define PAPI_OK 0
253 #define PAPI_EINVAL -1
254 #define PAPI_ENOMEM -2
255 #define PAPI_ESYS -3
256 #define PAPI_ECMP -4
257 #define PAPI_ESBSTR -4
258 #define PAPI_ECLOST -5
259 #define PAPI_EBUG -6
260 #define PAPI_ENOEVNT -7
261 #define PAPI_ECNFLCT -8
262 #define PAPI_ENOTRUN -9
263 #define PAPI_EISRUN -10
264 #define PAPI_ENOEVST -11
265 #define PAPI_ENOTPRESET -12
266 #define PAPI_ENOCNTR -13
267 #define PAPI_EMISC -14
268 #define PAPI_EPERM -15
269 #define PAPI_ENOINIT -16
270 #define PAPI_ENOCMP -17
271 #define PAPI_ENOSUPP -18
272 #define PAPI_ENOIMPL -19
273 #define PAPI_EBUF -20
274 #define PAPI_EINVAL_DOM -21
275 #define PAPI_EATTR -22
276 #define PAPI_ECOUNT -23
277 #define PAPI_ECOMBO -24
278 #define PAPI_NUM_ERRORS 25
280 #define PAPI_NOT_INITED 0
281 #define PAPI_LOW_LEVEL_INITED 1 /* Low level has called library init */
282 #define PAPI_HIGH_LEVEL_INITED 2 /* High level has called library init */
283 #define PAPI_THREAD_LEVEL_INITED 4 /* Threads have been inited */
284 
292 #define PAPI_NULL -1
298 #define PAPI_DOM_USER 0x1
299 #define PAPI_DOM_MIN PAPI_DOM_USER
300 #define PAPI_DOM_KERNEL 0x2
301 #define PAPI_DOM_OTHER 0x4
302 #define PAPI_DOM_SUPERVISOR 0x8
303 #define PAPI_DOM_ALL (PAPI_DOM_USER|PAPI_DOM_KERNEL|PAPI_DOM_OTHER|PAPI_DOM_SUPERVISOR)
304 /* #define PAPI_DOM_DEFAULT PAPI_DOM_USER NOW DEFINED BY COMPONENT */
305 #define PAPI_DOM_MAX PAPI_DOM_ALL
306 #define PAPI_DOM_HWSPEC 0x80000000
317 #define PAPI_USR1_TLS 0x0
318 #define PAPI_USR2_TLS 0x1
319 #define PAPI_HIGH_LEVEL_TLS 0x2
320 #define PAPI_NUM_TLS 0x3
321 #define PAPI_TLS_USR1 PAPI_USR1_TLS
322 #define PAPI_TLS_USR2 PAPI_USR2_TLS
323 #define PAPI_TLS_HIGH_LEVEL PAPI_HIGH_LEVEL_TLS
324 #define PAPI_TLS_NUM PAPI_NUM_TLS
325 #define PAPI_TLS_ALL_THREADS 0x10
331 #define PAPI_USR1_LOCK 0x0
332 #define PAPI_USR2_LOCK 0x1
333 #define PAPI_NUM_LOCK 0x2
334 #define PAPI_LOCK_USR1 PAPI_USR1_LOCK
335 #define PAPI_LOCK_USR2 PAPI_USR2_LOCK
336 #define PAPI_LOCK_NUM PAPI_NUM_LOCK
339 /* Remove this! If it breaks userspace we might have to add it back :( */
340 /* #define PAPI_MPX_DEF_DEG 32 */
341 
345 #define PAPI_VENDOR_UNKNOWN 0
346 #define PAPI_VENDOR_INTEL 1
347 #define PAPI_VENDOR_AMD 2
348 #define PAPI_VENDOR_IBM 3
349 #define PAPI_VENDOR_CRAY 4
350 #define PAPI_VENDOR_SUN 5
351 #define PAPI_VENDOR_FREESCALE 6
352 #define PAPI_VENDOR_ARM 7
353 #define PAPI_VENDOR_MIPS 8
360 #define PAPI_GRN_THR 0x1
361 #define PAPI_GRN_MIN PAPI_GRN_THR
362 #define PAPI_GRN_PROC 0x2
363 #define PAPI_GRN_PROCG 0x4
364 #define PAPI_GRN_SYS 0x8
365 #define PAPI_GRN_SYS_CPU 0x10
366 #define PAPI_GRN_MAX PAPI_GRN_SYS_CPU
372 #define PAPI_STOPPED 0x01
373 #define PAPI_RUNNING 0x02
374 #define PAPI_PAUSED 0x04
375 #define PAPI_NOT_INIT 0x08
376 #define PAPI_OVERFLOWING 0x10
377 #define PAPI_PROFILING 0x20
378 #define PAPI_MULTIPLEXING 0x40
379 #define PAPI_ATTACHED 0x80
380 #define PAPI_CPU_ATTACHED 0x100
386 #define PAPI_QUIET 0
387 #define PAPI_VERB_ECONT 1
388 #define PAPI_VERB_ESTOP 2
394 #define PAPI_PROFIL_POSIX 0x0
395 #define PAPI_PROFIL_RANDOM 0x1
396 #define PAPI_PROFIL_WEIGHTED 0x2
397 #define PAPI_PROFIL_COMPRESS 0x4
398 #define PAPI_PROFIL_BUCKET_16 0x8
399 #define PAPI_PROFIL_BUCKET_32 0x10
400 #define PAPI_PROFIL_BUCKET_64 0x20
401 #define PAPI_PROFIL_FORCE_SW 0x40
402 #define PAPI_PROFIL_DATA_EAR 0x80
403 #define PAPI_PROFIL_INST_EAR 0x100
404 #define PAPI_PROFIL_BUCKETS (PAPI_PROFIL_BUCKET_16 | PAPI_PROFIL_BUCKET_32 | PAPI_PROFIL_BUCKET_64)
407 /* @defgroup overflow_defns Overflow definitions
408  @{ */
409 #define PAPI_OVERFLOW_FORCE_SW 0x40
410 #define PAPI_OVERFLOW_HARDWARE 0x80
416 #define PAPI_MULTIPLEX_DEFAULT 0x0
417 #define PAPI_MULTIPLEX_FORCE_SW 0x1
423 #define PAPI_INHERIT_ALL 1
424 #define PAPI_INHERIT_NONE 0
427 #define PAPI_DETACH 1
428 #define PAPI_DEBUG 2
429 #define PAPI_MULTIPLEX 3
430 #define PAPI_DEFDOM 4
431 #define PAPI_DOMAIN 5
432 #define PAPI_DEFGRN 6
433 #define PAPI_GRANUL 7
434 #define PAPI_DEF_MPX_NS 8
435  //#define PAPI_EDGE_DETECT 9
436  //#define PAPI_INVERT 10
437 #define PAPI_MAX_MPX_CTRS 11
438 #define PAPI_PROFIL 12
439 #define PAPI_PRELOAD 13
440 #define PAPI_CLOCKRATE 14
441 #define PAPI_MAX_HWCTRS 15
442 #define PAPI_HWINFO 16
443 #define PAPI_EXEINFO 17
444 #define PAPI_MAX_CPUS 18
445 #define PAPI_ATTACH 19
446 #define PAPI_SHLIBINFO 20
447 #define PAPI_LIB_VERSION 21
448 #define PAPI_COMPONENTINFO 22
449 /* Currently the following options are only available on Itanium; they may be supported elsewhere in the future */
450 #define PAPI_DATA_ADDRESS 23
451 #define PAPI_INSTR_ADDRESS 24
452 #define PAPI_DEF_ITIMER 25
453 #define PAPI_DEF_ITIMER_NS 26
454 /* Currently the following options are only available on systems using the perf_events component within papi */
455 #define PAPI_CPU_ATTACH 27
456 #define PAPI_INHERIT 28
457 #define PAPI_USER_EVENTS_FILE 29
459 #define PAPI_INIT_SLOTS 64 /*Number of initialized slots in
460  DynamicArray of EventSets */
462 #define PAPI_MIN_STR_LEN 64 /* For small strings, like names & stuff */
463 #define PAPI_MAX_STR_LEN 128 /* For average run-of-the-mill strings */
464 #define PAPI_2MAX_STR_LEN 256 /* For somewhat longer run-of-the-mill strings */
465 #define PAPI_HUGE_STR_LEN 1024 /* This should be defined in terms of a system parameter */
467 #define PAPI_PMU_MAX 40 /* maximum number of pmu's supported by one component */
468 #define PAPI_DERIVED 0x1 /* Flag to indicate that the event is derived */
478 enum {
479  PAPI_ENUM_EVENTS = 0,
483  /* PAPI PRESET section */
497  /* PAPI native event related section */
506 };
508 #define PAPI_ENUM_ALL PAPI_ENUM_EVENTS
509 
510 #define PAPI_PRESET_BIT_MSC (1 << PAPI_PRESET_ENUM_MSC) /* Miscellaneous preset event bit */
511 #define PAPI_PRESET_BIT_INS (1 << PAPI_PRESET_ENUM_INS) /* Instruction related preset event bit */
512 #define PAPI_PRESET_BIT_IDL (1 << PAPI_PRESET_ENUM_IDL) /* Stalled or Idle preset event bit */
513 #define PAPI_PRESET_BIT_BR (1 << PAPI_PRESET_ENUM_BR) /* branch related preset events */
514 #define PAPI_PRESET_BIT_CND (1 << PAPI_PRESET_ENUM_CND) /* conditional preset events */
515 #define PAPI_PRESET_BIT_MEM (1 << PAPI_PRESET_ENUM_MEM) /* memory related preset events */
516 #define PAPI_PRESET_BIT_CACH (1 << PAPI_PRESET_ENUM_CACH) /* cache related preset events */
517 #define PAPI_PRESET_BIT_L1 (1 << PAPI_PRESET_ENUM_L1) /* L1 cache related preset events */
518 #define PAPI_PRESET_BIT_L2 (1 << PAPI_PRESET_ENUM_L2) /* L2 cache related preset events */
519 #define PAPI_PRESET_BIT_L3 (1 << PAPI_PRESET_ENUM_L3) /* L3 cache related preset events */
520 #define PAPI_PRESET_BIT_TLB (1 << PAPI_PRESET_ENUM_TLB) /* Translation Lookaside Buffer events */
521 #define PAPI_PRESET_BIT_FP (1 << PAPI_PRESET_ENUM_FP) /* Floating Point related preset events */
523 #define PAPI_NTV_GROUP_AND_MASK 0x00FF0000 /* bits occupied by group number */
524 #define PAPI_NTV_GROUP_SHIFT 16 /* bit shift to encode group number */
527 /*
528 The Low Level API
529 
530 The following functions represent the low level portion of the
531 PerfAPI. These functions provide greatly increased efficiency and
532 functionality over the high level API presented in the next
533 section. All of the following functions are callable from both C and
534 Fortran except where noted. As mentioned in the introduction, the low
535 level API is only as powerful as the component upon which it is
536 built. Thus some features may not be available on every platform. The
537 converse may also be true, that more advanced features may be
538 available and defined in the header file. The user is encouraged to
539 read the documentation carefully. */
540 
541 
542 #include <signal.h>
543 
544 /* Earlier versions of PAPI define a special long_long type to mask
545  an incompatibility between the Windows compiler and gcc-style compilers.
546  That problem no longer exists, so long_long has been purged from the source.
547  The defines below preserve backward compatibility. Their use is deprecated,
548  but will continue to be supported in the near term.
549 */
550 #define long_long long long
551 #define u_long_long unsigned long long
555  typedef unsigned long PAPI_thread_id_t;
556 
558  typedef struct _papi_all_thr_spec {
559  int num;
560  PAPI_thread_id_t *id;
561  void **data;
564  typedef void (*PAPI_overflow_handler_t) (int EventSet, void *address,
565  long long overflow_vector, void *context);
567  /* Handle C99 and more recent compilation */
568  /* caddr_t was never approved by POSIX and is obsolete */
569  /* We should probably switch all caddr_t to void * or long */
570 #ifdef __STDC_VERSION__
571  #if (__STDC_VERSION__ >= 199901L)
572  typedef char *caddr_t;
573  #else
574 
575  #endif
576 #endif
577 
579  typedef struct _papi_sprofil {
580  void *pr_base;
581  unsigned pr_size;
582  caddr_t pr_off;
583  unsigned pr_scale;
587  } PAPI_sprofil_t;
588 
590  typedef struct _papi_itimer_option {
591  int itimer_num;
592  int itimer_sig;
593  int ns;
594  int flags;
598  typedef struct _papi_inherit_option {
599  int eventset;
600  int inherit;
604  typedef struct _papi_domain_option {
605  int def_cidx;
606  int eventset;
607  int domain;
611  typedef struct _papi_granularity_option {
612  int def_cidx;
613  int eventset;
614  int granularity;
618  typedef struct _papi_preload_option {
619  char lib_preload_env[PAPI_MAX_STR_LEN];
620  char lib_preload_sep;
621  char lib_dir_env[PAPI_MAX_STR_LEN];
622  char lib_dir_sep;
626  typedef struct _papi_component_option {
627  char name[PAPI_MAX_STR_LEN];
628  char short_name[PAPI_MIN_STR_LEN];
630  char description[PAPI_MAX_STR_LEN];
631  char version[PAPI_MIN_STR_LEN];
632  char support_version[PAPI_MIN_STR_LEN];
633  char kernel_version[PAPI_MIN_STR_LEN];
634  char disabled_reason[PAPI_MAX_STR_LEN];
635  int disabled;
636  int CmpIdx;
637  int num_cntrs;
638  int num_mpx_cntrs;
639  int num_preset_events;
641  int default_domain;
642  int available_domains;
643  int default_granularity;
644  int available_granularities;
645  int hardware_intr_sig;
646 // int opcode_match_width; /**< Width of opcode matcher if exists, 0 if not */
647  int component_type;
648  char *pmu_names[PAPI_PMU_MAX];
649  int reserved[8]; /* */
650  unsigned int hardware_intr:1;
651  unsigned int precise_intr:1;
652  unsigned int posix1b_timers:1;
653  unsigned int kernel_profile:1;
654  unsigned int kernel_multiplex:1;
655 // unsigned int data_address_range:1; /**< Supports data address range limiting */
656 // unsigned int instr_address_range:1; /**< Supports instruction address range limiting */
657  unsigned int fast_counter_read:1;
658  unsigned int fast_real_timer:1;
659  unsigned int fast_virtual_timer:1;
660  unsigned int attach:1;
661  unsigned int attach_must_ptrace:1;
662 // unsigned int edge_detect:1; /**< Supports edge detection on events */
663 // unsigned int invert:1; /**< Supports invert detection on events */
664 // unsigned int profile_ear:1; /**< Supports data/instr/tlb miss address sampling */
665 // unsigned int cntr_groups:1; /**< Underlying hardware uses counter groups (e.g. POWER5)*/
666  unsigned int cntr_umasks:1;
667 // unsigned int cntr_IEAR_events:1; /**< counters support instr event addr register */
668 // unsigned int cntr_DEAR_events:1; /**< counters support data event addr register */
669 // unsigned int cntr_OPCM_events:1; /**< counter events support opcode matching */
670  /* This should be a granularity option */
671  unsigned int cpu:1;
672  unsigned int inherit:1;
673  unsigned int reserved_bits:12;
677  typedef struct _papi_mpx_info {
678  int timer_sig;
679  int timer_num;
680  int timer_us;
683  typedef int (*PAPI_debug_handler_t) (int code);
684 
686  typedef struct _papi_debug_option {
687  int level;
693  typedef struct _papi_address_map {
694  char name[PAPI_HUGE_STR_LEN];
695  caddr_t text_start;
696  caddr_t text_end;
697  caddr_t data_start;
698  caddr_t data_end;
699  caddr_t bss_start;
700  caddr_t bss_end;
705  typedef struct _papi_program_info {
706  char fullname[PAPI_HUGE_STR_LEN];
707  PAPI_address_map_t address_info;
711  typedef struct _papi_shared_lib_info {
712  PAPI_address_map_t *map;
713  int count;
717 typedef char* PAPI_user_defined_events_file_t;
718 
719  /* The following defines and next for structures define the memory heirarchy */
720  /* All sizes are in BYTES */
721  /* Associativity:
722  0: Undefined;
723  1: Direct Mapped
724  SHRT_MAX: Full
725  Other values == associativity
726  */
727 #define PAPI_MH_TYPE_EMPTY 0x0
728 #define PAPI_MH_TYPE_INST 0x1
729 #define PAPI_MH_TYPE_DATA 0x2
730 #define PAPI_MH_TYPE_VECTOR 0x4
731 #define PAPI_MH_TYPE_TRACE 0x8
732 #define PAPI_MH_TYPE_UNIFIED (PAPI_MH_TYPE_INST|PAPI_MH_TYPE_DATA)
733 #define PAPI_MH_CACHE_TYPE(a) (a & 0xf)
734 #define PAPI_MH_TYPE_WT 0x00 /* write-through cache */
735 #define PAPI_MH_TYPE_WB 0x10 /* write-back cache */
736 #define PAPI_MH_CACHE_WRITE_POLICY(a) (a & 0xf0)
737 #define PAPI_MH_TYPE_UNKNOWN 0x000
738 #define PAPI_MH_TYPE_LRU 0x100
739 #define PAPI_MH_TYPE_PSEUDO_LRU 0x200
740 #define PAPI_MH_CACHE_REPLACEMENT_POLICY(a) (a & 0xf00)
741 #define PAPI_MH_TYPE_TLB 0x1000 /* tlb, not memory cache */
742 #define PAPI_MH_TYPE_PREF 0x2000 /* prefetch buffer */
743 #define PAPI_MH_MAX_LEVELS 6 /* # descriptors for each TLB or cache level */
744 #define PAPI_MAX_MEM_HIERARCHY_LEVELS 4
747  typedef struct _papi_mh_tlb_info {
748  int type;
749  int num_entries;
751  int associativity;
755  typedef struct _papi_mh_cache_info {
756  int type;
757  int size;
758  int line_size;
759  int num_lines;
760  int associativity;
764  typedef struct _papi_mh_level_info {
771  typedef struct _papi_mh_info {
772  int levels;
778  typedef struct _papi_hw_info {
779  int ncpu;
780  int threads;
781  int cores;
782  int sockets;
783  int nnodes;
784  int totalcpus;
785  int vendor;
786  char vendor_string[PAPI_MAX_STR_LEN];
787  int model;
788  char model_string[PAPI_MAX_STR_LEN];
789  float revision;
790  int cpuid_family;
791  int cpuid_model;
792  int cpuid_stepping;
794  int cpu_max_mhz;
795  int cpu_min_mhz;
797  PAPI_mh_info_t mem_hierarchy;
798  int virtualized;
799  char virtual_vendor_string[PAPI_MAX_STR_LEN];
801  char virtual_vendor_version[PAPI_MAX_STR_LEN];
804  /* Legacy Values, do not use */
805  float mhz;
806  int clock_mhz;
808  /* For future expansion */
809  int reserved[8];
810 
812 
814  typedef struct _papi_attach_option {
815  int eventset;
816  unsigned long tid;
820  typedef struct _papi_cpu_option {
821  int eventset;
822  unsigned int cpu_num;
826  typedef struct _papi_multiplex_option {
827  int eventset;
828  int ns;
829  int flags;
834  typedef struct _papi_addr_range_option {
835  int eventset;
836  caddr_t start;
837  caddr_t end;
838  int start_off;
839  int end_off;
846  typedef union
847  {
860  PAPI_shlib_info_t *shlib_info;
861  PAPI_exe_info_t *exe_info;
864  PAPI_user_defined_events_file_t events_file;
869  typedef struct _dmem_t {
870  long long peak;
871  long long size;
872  long long resident;
873  long long high_water_mark;
874  long long shared;
875  long long text;
876  long long library;
877  long long heap;
878  long long locked;
879  long long stack;
880  long long pagesize;
881  long long pte;
884 /* Fortran offsets into PAPI_dmem_info_t structure. */
885 
886 #define PAPIF_DMEM_VMPEAK 1
887 #define PAPIF_DMEM_VMSIZE 2
888 #define PAPIF_DMEM_RESIDENT 3
889 #define PAPIF_DMEM_HIGH_WATER 4
890 #define PAPIF_DMEM_SHARED 5
891 #define PAPIF_DMEM_TEXT 6
892 #define PAPIF_DMEM_LIBRARY 7
893 #define PAPIF_DMEM_HEAP 8
894 #define PAPIF_DMEM_LOCKED 9
895 #define PAPIF_DMEM_STACK 10
896 #define PAPIF_DMEM_PAGESIZE 11
897 #define PAPIF_DMEM_PTE 12
898 #define PAPIF_DMEM_MAXVAL 12
900 #define PAPI_MAX_INFO_TERMS 12 /* should match PAPI_EVENTS_IN_DERIVED_EVENT defined in papi_internal.h */
901 
923 enum {
924  PAPI_LOCATION_CORE = 0,
928 };
931 enum {
932  PAPI_DATATYPE_INT64 = 0,
936 };
939 enum {
942 };
945 enum {
950 };
953 enum {
958 };
960 
961  typedef struct event_info {
962  unsigned int event_code;
964  char symbol[PAPI_HUGE_STR_LEN];
965  char short_descr[PAPI_MIN_STR_LEN];
967  char long_descr[PAPI_HUGE_STR_LEN];
972  int component_index;
973  char units[PAPI_MIN_STR_LEN];
974  int location;
975  int data_type;
976  int value_type;
977  int timescope;
978  int update_type;
979  int update_freq;
981  /* PRESET SPECIFIC FIELDS FOLLOW */
982 
983 
984 
985  unsigned int count;
990  unsigned int event_type;
993  char derived[PAPI_MIN_STR_LEN];
996  char postfix[PAPI_2MAX_STR_LEN];
1001  unsigned int code[PAPI_MAX_INFO_TERMS];
1006  char name[PAPI_MAX_INFO_TERMS]
1007  [PAPI_2MAX_STR_LEN];
1011  char note[PAPI_HUGE_STR_LEN];
1017 
1018 
1019 
1020 
1024  int PAPI_accum(int EventSet, long long * values);
1025  int PAPI_add_event(int EventSet, int Event);
1026  int PAPI_add_named_event(int EventSet, const char *EventName);
1027  int PAPI_add_events(int EventSet, int *Events, int number);
1028  int PAPI_assign_eventset_component(int EventSet, int cidx);
1029  int PAPI_attach(int EventSet, unsigned long tid);
1030  int PAPI_cleanup_eventset(int EventSet);
1031  int PAPI_create_eventset(int *EventSet);
1032  int PAPI_detach(int EventSet);
1033  int PAPI_destroy_eventset(int *EventSet);
1034  int PAPI_enum_event(int *EventCode, int modifier);
1035  int PAPI_enum_cmp_event(int *EventCode, int modifier, int cidx);
1036  int PAPI_event_code_to_name(int EventCode, char *out);
1037  int PAPI_event_name_to_code(const char *in, int *out);
1039  int PAPI_get_event_info(int EventCode, PAPI_event_info_t * info);
1041  const PAPI_hw_info_t *PAPI_get_hardware_info(void);
1043  int PAPI_get_multiplex(int EventSet);
1044  int PAPI_get_opt(int option, PAPI_option_t * ptr);
1045  int PAPI_get_cmp_opt(int option, PAPI_option_t * ptr,int cidx);
1046  long long PAPI_get_real_cyc(void);
1047  long long PAPI_get_real_nsec(void);
1048  long long PAPI_get_real_usec(void);
1050  int PAPI_get_thr_specific(int tag, void **ptr);
1051  int PAPI_get_overflow_event_index(int Eventset, long long overflow_vector, int *array, int *number);
1052  long long PAPI_get_virt_cyc(void);
1053  long long PAPI_get_virt_nsec(void);
1054  long long PAPI_get_virt_usec(void);
1055  int PAPI_is_initialized(void);
1056  int PAPI_library_init(int version);
1057  int PAPI_list_events(int EventSet, int *Events, int *number);
1058  int PAPI_list_threads(unsigned long *tids, int *number);
1059  int PAPI_lock(int);
1060  int PAPI_multiplex_init(void);
1061  int PAPI_num_cmp_hwctrs(int cidx);
1062  int PAPI_num_events(int EventSet);
1063  int PAPI_overflow(int EventSet, int EventCode, int threshold,
1065  void PAPI_perror(const char *msg );
1066  int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset,
1067  unsigned scale, int EventSet, int EventCode,
1068  int threshold, int flags);
1069  int PAPI_query_event(int EventCode);
1070  int PAPI_query_named_event(const char *EventName);
1071  int PAPI_read(int EventSet, long long * values);
1072  int PAPI_read_ts(int EventSet, long long * values, long long *cyc);
1073  int PAPI_register_thread(void);
1074  int PAPI_remove_event(int EventSet, int EventCode);
1075  int PAPI_remove_named_event(int EventSet, const char *EventName);
1076  int PAPI_remove_events(int EventSet, int *Events, int number);
1077  int PAPI_reset(int EventSet);
1078  int PAPI_set_debug(int level);
1079  int PAPI_set_cmp_domain(int domain, int cidx);
1080  int PAPI_set_domain(int domain);
1081  int PAPI_set_cmp_granularity(int granularity, int cidx);
1082  int PAPI_set_granularity(int granularity);
1083  int PAPI_set_multiplex(int EventSet);
1084  int PAPI_set_opt(int option, PAPI_option_t * ptr);
1085  int PAPI_set_thr_specific(int tag, void *ptr);
1086  void PAPI_shutdown(void);
1087  int PAPI_sprofil(PAPI_sprofil_t * prof, int profcnt, int EventSet, int EventCode, int threshold, int flags);
1088  int PAPI_start(int EventSet);
1089  int PAPI_state(int EventSet, int *status);
1090  int PAPI_stop(int EventSet, long long * values);
1091  char *PAPI_strerror(int);
1092  unsigned long PAPI_thread_id(void);
1093  int PAPI_thread_init(unsigned long (*id_fn) (void));
1094  int PAPI_unlock(int);
1095  int PAPI_unregister_thread(void);
1096  int PAPI_write(int EventSet, long long * values);
1097  int PAPI_get_event_component(int EventCode);
1098  int PAPI_get_eventset_component(int EventSet);
1099  int PAPI_get_component_index(const char *name);
1100  int PAPI_disable_component(int cidx);
1101  int PAPI_disable_component_by_name(const char *name );
1115  int PAPI_accum_counters(long long * values, int array_len);
1116  int PAPI_num_counters(void);
1117  int PAPI_num_components(void);
1118  int PAPI_read_counters(long long * values, int array_len);
1119  int PAPI_start_counters(int *events, int array_len);
1120  int PAPI_stop_counters(long long * values, int array_len);
1121  int PAPI_flips(float *rtime, float *ptime, long long * flpins, float *mflips);
1122  int PAPI_flops(float *rtime, float *ptime, long long * flpops, float *mflops);
1123  int PAPI_ipc(float *rtime, float *ptime, long long * ins, float *ipc);
1124  int PAPI_epc(int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc);
1129 /* Backwards compatibility hacks. Remove eventually? */
1130 int PAPI_num_hwctrs(void);
1131 #define PAPI_COMPONENT_INDEX(a) PAPI_get_event_component(a)
1132 #define PAPI_descr_error(a) PAPI_strerror(a)
1134 #ifdef __cplusplus
1135 }
1136 #endif
1137 
1138 #pragma GCC visibility pop
1139 
1140 #endif
i inherit inherit
int PAPI_stop(int EventSet, long long *values)
Definition: papi.c:2314
int PAPI_is_initialized(void)
Definition: papi.c:6463
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
Definition: papi.c:796
int PAPI_add_event(int EventSet, int EventCode)
Definition: papi.c:1663
Hardware info structure.
Definition: papi.h:780
long long PAPI_get_virt_usec(void)
Definition: papi.c:6372
int PAPI_set_cmp_granularity(int granularity, int cidx)
Definition: papi.c:5622
int PAPI_reset(int EventSet)
Definition: papi.c:2459
long long flags
Definition: iozone.c:12330
const PAPI_shlib_info_t * PAPI_get_shared_lib_info(void)
Definition: papi.c:6144
int PAPI_disable_component_by_name(const char *name)
Definition: papi.c:6717
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
unsigned long PAPI_thread_id(void)
Definition: papi.c:162
int PAPI_write(int EventSet, long long *values)
Definition: papi.c:2813
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:1758
long long PAPI_get_virt_cyc(void)
Definition: papi.c:6300
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:4387
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
int PAPI_enum_event(int *EventCode, int modifier)
Definition: papi.c:1152
int PAPI_detach(int EventSet)
Definition: papi.c:3258
void(* PAPI_overflow_handler_t)(int EventSet, void *address, long long overflow_vector, void *context)
Definition: papi.h:566
int EventSet
get the executable&#39;s info
Definition: papi.h:707
int PAPI_register_thread(void)
Definition: papi.c:208
int count
Definition: iozone.c:22422
int PAPI_event_name_to_code(const char *in, int *out)
Definition: papi.c:1004
int PAPI_overflow(int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
Definition: papi.c:4788
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:848
void
Definition: iozone.c:18627
char units[MAX_EVENTS][BUFSIZ]
Definition: powercap_plot.c:15
int PAPI_remove_events(int EventSet, int *Events, int number)
Definition: papi.c:5931
long long PAPI_get_virt_nsec(void)
Definition: papi.c:6330
int PAPI_sprofil(PAPI_sprofil_t *prof, int profcnt, int EventSet, int EventCode, int threshold, int flags)
Definition: papi.c:5044
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3465
int PAPI_add_events(int EventSet, int *Events, int number)
Definition: papi.c:5843
#define PAPI_HUGE_STR_LEN
Definition: papi.h:467
int num_native_events
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
Definition: papi.c:835
int PAPI_add_named_event(int EventSet, const char *EventName)
Definition: papi.c:1876
char events[MAX_EVENTS][BUFSIZ]
int multiplex(void)
Definition: multiplex.c:35
int PAPI_set_cmp_domain(int domain, int cidx)
Definition: papi.c:5758
int PAPI_disable_component(int cidx)
Definition: papi.c:6666
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:3965
#define PAPI_2MAX_STR_LEN
Definition: papi.h:466
int PAPI_get_thr_specific(int tag, void **ptr)
Definition: papi.c:362
int PAPI_accum(int EventSet, long long *values)
Definition: papi.c:2745
static struct counter_info * event_info
static int cidx
#define PAPI_MH_MAX_LEVELS
Definition: papi.h:745
int PAPI_thread_init(unsigned long int(*id_fn)(void))
Definition: papi.c:123
int PAPI_library_init(int version)
Definition: papi.c:500
int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
Definition: papi.c:5438
long long debug
Definition: iozone.c:1374
#define PAPI_PMU_MAX
Definition: papi.h:469
char buf[200]
Definition: iozone.c:19609
int PAPI_num_hwctrs(void)
Definition: papi.c:3909
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:871
void PAPI_shutdown(void)
Definition: papi.c:4461
int PAPI_get_cmp_opt(int option, PAPI_option_t *ptr, int cidx)
Definition: papi.c:4335
const PAPI_exe_info_t * PAPI_get_executable_info(void)
Definition: papi.c:6114
int PAPI_num_events(int EventSet)
Definition: papi.c:4426
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4143
long long page_size
Definition: iozone.c:428
char *long long size
Definition: iozone.c:12023
int PAPI_get_component_index(const char *name)
Definition: papi.c:6610
void int num
Definition: iozone.c:22151
int PAPI_state(int EventSet, int *status)
Definition: papi.c:3053
int PAPI_query_named_event(const char *EventName)
Definition: papi.c:756
get the executable&#39;s address space info
Definition: papi.h:695
void *long long tid
Definition: iozone.c:18586
static int Event[MAX_EVENTS]
int(* PAPI_debug_handler_t)(int code)
Definition: papi.h:685
int PAPI_set_granularity(int granularity)
Definition: papi.c:5557
address range specification for range restricted counting if both are zero, range is disabled ...
Definition: papi.h:836
int PAPI_enum_cmp_event(int *EventCode, int modifier, int cidx)
Definition: papi.c:1357
mh for mem hierarchy maybe?
Definition: papi.h:773
void handler(int EventSet, void *address, long long overflow_vector, void *context)
Definition: rapl_overflow.c:20
int PAPI_cleanup_eventset(int EventSet)
Definition: papi.c:2890
char * addr
Definition: iozone.c:12026
int PAPI_assign_eventset_component(int EventSet, int cidx)
Definition: papi.c:1526
char version[]
Definition: fileop.c:134
int PAPI_create_eventset(int *EventSet)
Definition: papi.c:1464
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:915
static int threshold
#define PAPI_MAX_INFO_TERMS
Definition: papi.h:902
int PAPI_get_dmem_info(PAPI_dmem_info_t *dest)
Definition: papi.c:6063
goto out
Definition: pscanf.h:20
int PAPI_query_event(int EventCode)
Definition: papi.c:684
int PAPI_get_overflow_event_index(int EventSet, long long overflow_vector, int *array, int *number)
Definition: papi.c:6517
int PAPI_multiplex_init(void)
Definition: papi.c:2982
int PAPI_read_ts(int EventSet, long long *values, long long *cycles)
Definition: papi.c:2648
long long PAPI_get_real_usec(void)
Definition: papi.c:6264
long long status
Definition: iozone.c:1335
int PAPI_unregister_thread(void)
Definition: papi.c:244
int PAPI_set_thr_specific(int tag, void *ptr)
Definition: papi.c:438
char * PAPI_strerror(int errorCode)
Definition: papi.c:4603
char * name
Definition: iozone.c:23648
static char stack[2 *PAPI_HUGE_STR_LEN]
Definition: papi_preset.c:791
int PAPI_unlock(int lck)
Definition: papi.c:6421
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:464
long long PAPI_get_real_nsec(void)
Definition: papi.c:6237
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 data_type[MAX_EVENTS]
Definition: powercap_plot.c:16
int PAPI_set_multiplex(int EventSet)
Definition: papi.c:3333
unsigned long PAPI_thread_id_t
Definition: papi.h:557
int PAPI_destroy_eventset(int *EventSet)
Definition: papi.c:2014
int PAPI_remove_named_event(int EventSet, const char *EventName)
Definition: papi.c:1961
#define PAPI_MAX_STR_LEN
Definition: papi.h:465
int PAPI_set_domain(int domain)
Definition: papi.c:5688
int PAPI_attach(int EventSet, unsigned long tid)
Definition: papi.c:3201
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:6217
int PAPI_read(int EventSet, long long *values)
Definition: papi.c:2559
int PAPI_start(int EventSet)
Definition: papi.c:2096
void PAPI_perror(const char *msg)
Definition: papi.c:4653
int PAPI_get_multiplex(int EventSet)
Definition: papi.c:4028
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6185
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
int PAPI_lock(int lck)
Definition: papi.c:6401
static const PAPI_hw_info_t * hw_info
Definition: byte_profile.c:28
int PAPI_list_threads(PAPI_thread_id_t *tids, int *number)
Definition: papi.c:286
int PAPI_get_event_component(int EventCode)
Definition: papi.c:6583
char * PAPI_user_defined_events_file_t
Definition: papi.h:719
int PAPI_set_debug(int level)
Definition: papi.c:3126
#define PAPI_MAX_MEM_HIERARCHY_LEVELS
Definition: papi.h:746
int PAPI_list_events(int EventSet, int *Events, int *number)
Definition: papi.c:6001
int PAPI_get_eventset_component(int EventSet)
Definition: papi.c:1569
char * ptr
Definition: iozone.c:23586