PAPI  5.4.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,4,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_PMU_MAX 40 /* maximum number of pmu's supported by one component */
466 #define PAPI_DERIVED 0x1 /* Flag to indicate that the event is derived */
476 enum {
477  PAPI_ENUM_EVENTS = 0,
481  /* PAPI PRESET section */
495  /* PAPI native event related section */
504 };
506 #define PAPI_ENUM_ALL PAPI_ENUM_EVENTS
507 
508 #define PAPI_PRESET_BIT_MSC (1 << PAPI_PRESET_ENUM_MSC) /* Miscellaneous preset event bit */
509 #define PAPI_PRESET_BIT_INS (1 << PAPI_PRESET_ENUM_INS) /* Instruction related preset event bit */
510 #define PAPI_PRESET_BIT_IDL (1 << PAPI_PRESET_ENUM_IDL) /* Stalled or Idle preset event bit */
511 #define PAPI_PRESET_BIT_BR (1 << PAPI_PRESET_ENUM_BR) /* branch related preset events */
512 #define PAPI_PRESET_BIT_CND (1 << PAPI_PRESET_ENUM_CND) /* conditional preset events */
513 #define PAPI_PRESET_BIT_MEM (1 << PAPI_PRESET_ENUM_MEM) /* memory related preset events */
514 #define PAPI_PRESET_BIT_CACH (1 << PAPI_PRESET_ENUM_CACH) /* cache related preset events */
515 #define PAPI_PRESET_BIT_L1 (1 << PAPI_PRESET_ENUM_L1) /* L1 cache related preset events */
516 #define PAPI_PRESET_BIT_L2 (1 << PAPI_PRESET_ENUM_L2) /* L2 cache related preset events */
517 #define PAPI_PRESET_BIT_L3 (1 << PAPI_PRESET_ENUM_L3) /* L3 cache related preset events */
518 #define PAPI_PRESET_BIT_TLB (1 << PAPI_PRESET_ENUM_TLB) /* Translation Lookaside Buffer events */
519 #define PAPI_PRESET_BIT_FP (1 << PAPI_PRESET_ENUM_FP) /* Floating Point related preset events */
521 #define PAPI_NTV_GROUP_AND_MASK 0x00FF0000 /* bits occupied by group number */
522 #define PAPI_NTV_GROUP_SHIFT 16 /* bit shift to encode group number */
525 /*
526 The Low Level API
527 
528 The following functions represent the low level portion of the
529 PerfAPI. These functions provide greatly increased efficiency and
530 functionality over the high level API presented in the next
531 section. All of the following functions are callable from both C and
532 Fortran except where noted. As mentioned in the introduction, the low
533 level API is only as powerful as the component upon which it is
534 built. Thus some features may not be available on every platform. The
535 converse may also be true, that more advanced features may be
536 available and defined in the header file. The user is encouraged to
537 read the documentation carefully. */
538 
539 
540 #include <signal.h>
541 
542 /* Earlier versions of PAPI define a special long_long type to mask
543  an incompatibility between the Windows compiler and gcc-style compilers.
544  That problem no longer exists, so long_long has been purged from the source.
545  The defines below preserve backward compatibility. Their use is deprecated,
546  but will continue to be supported in the near term.
547 */
548 #define long_long long long
549 #define u_long_long unsigned long long
553  typedef unsigned long PAPI_thread_id_t;
554 
556  typedef struct _papi_all_thr_spec {
557  int num;
558  PAPI_thread_id_t *id;
559  void **data;
562  typedef void (*PAPI_overflow_handler_t) (int EventSet, void *address,
563  long long overflow_vector, void *context);
565  /* Handle C99 compilation */
566  /* All caddr_ts should become unsigned longs eventually. */
567 #ifdef __STDC_VERSION__
568  #if (__STDC_VERSION__ == 199901L)
569  typedef char *caddr_t;
570  #else
571 
572  #endif
573 #endif
574 
576  typedef struct _papi_sprofil {
577  void *pr_base;
578  unsigned pr_size;
579  caddr_t pr_off;
580  unsigned pr_scale;
584  } PAPI_sprofil_t;
585 
587  typedef struct _papi_itimer_option {
588  int itimer_num;
589  int itimer_sig;
590  int ns;
591  int flags;
595  typedef struct _papi_inherit_option {
596  int eventset;
597  int inherit;
601  typedef struct _papi_domain_option {
602  int def_cidx;
603  int eventset;
604  int domain;
608  typedef struct _papi_granularity_option {
609  int def_cidx;
610  int eventset;
611  int granularity;
615  typedef struct _papi_preload_option {
616  char lib_preload_env[PAPI_MAX_STR_LEN];
617  char lib_preload_sep;
618  char lib_dir_env[PAPI_MAX_STR_LEN];
619  char lib_dir_sep;
623  typedef struct _papi_component_option {
624  char name[PAPI_MAX_STR_LEN];
625  char short_name[PAPI_MIN_STR_LEN];
627  char description[PAPI_MAX_STR_LEN];
628  char version[PAPI_MIN_STR_LEN];
629  char support_version[PAPI_MIN_STR_LEN];
630  char kernel_version[PAPI_MIN_STR_LEN];
631  char disabled_reason[PAPI_MAX_STR_LEN];
632  int disabled;
633  int CmpIdx;
634  int num_cntrs;
635  int num_mpx_cntrs;
636  int num_preset_events;
638  int default_domain;
639  int available_domains;
640  int default_granularity;
641  int available_granularities;
642  int hardware_intr_sig;
643 // int opcode_match_width; /**< Width of opcode matcher if exists, 0 if not */
644  int component_type;
645  char *pmu_names[PAPI_PMU_MAX];
646  int reserved[8]; /* */
647  unsigned int hardware_intr:1;
648  unsigned int precise_intr:1;
649  unsigned int posix1b_timers:1;
650  unsigned int kernel_profile:1;
651  unsigned int kernel_multiplex:1;
652 // unsigned int data_address_range:1; /**< Supports data address range limiting */
653 // unsigned int instr_address_range:1; /**< Supports instruction address range limiting */
654  unsigned int fast_counter_read:1;
655  unsigned int fast_real_timer:1;
656  unsigned int fast_virtual_timer:1;
657  unsigned int attach:1;
658  unsigned int attach_must_ptrace:1;
659 // unsigned int edge_detect:1; /**< Supports edge detection on events */
660 // unsigned int invert:1; /**< Supports invert detection on events */
661 // unsigned int profile_ear:1; /**< Supports data/instr/tlb miss address sampling */
662 // unsigned int cntr_groups:1; /**< Underlying hardware uses counter groups (e.g. POWER5)*/
663  unsigned int cntr_umasks:1;
664 // unsigned int cntr_IEAR_events:1; /**< counters support instr event addr register */
665 // unsigned int cntr_DEAR_events:1; /**< counters support data event addr register */
666 // unsigned int cntr_OPCM_events:1; /**< counter events support opcode matching */
667  /* This should be a granularity option */
668  unsigned int cpu:1;
669  unsigned int inherit:1;
670  unsigned int reserved_bits:12;
674  typedef struct _papi_mpx_info {
675  int timer_sig;
676  int timer_num;
677  int timer_us;
680  typedef int (*PAPI_debug_handler_t) (int code);
681 
683  typedef struct _papi_debug_option {
684  int level;
690  typedef struct _papi_address_map {
691  char name[PAPI_HUGE_STR_LEN];
692  caddr_t text_start;
693  caddr_t text_end;
694  caddr_t data_start;
695  caddr_t data_end;
696  caddr_t bss_start;
697  caddr_t bss_end;
702  typedef struct _papi_program_info {
703  char fullname[PAPI_HUGE_STR_LEN];
704  PAPI_address_map_t address_info;
708  typedef struct _papi_shared_lib_info {
709  PAPI_address_map_t *map;
710  int count;
714 typedef char* PAPI_user_defined_events_file_t;
715 
716  /* The following defines and next for structures define the memory heirarchy */
717  /* All sizes are in BYTES */
718  /* Associativity:
719  0: Undefined;
720  1: Direct Mapped
721  SHRT_MAX: Full
722  Other values == associativity
723  */
724 #define PAPI_MH_TYPE_EMPTY 0x0
725 #define PAPI_MH_TYPE_INST 0x1
726 #define PAPI_MH_TYPE_DATA 0x2
727 #define PAPI_MH_TYPE_VECTOR 0x4
728 #define PAPI_MH_TYPE_TRACE 0x8
729 #define PAPI_MH_TYPE_UNIFIED (PAPI_MH_TYPE_INST|PAPI_MH_TYPE_DATA)
730 #define PAPI_MH_CACHE_TYPE(a) (a & 0xf)
731 #define PAPI_MH_TYPE_WT 0x00 /* write-through cache */
732 #define PAPI_MH_TYPE_WB 0x10 /* write-back cache */
733 #define PAPI_MH_CACHE_WRITE_POLICY(a) (a & 0xf0)
734 #define PAPI_MH_TYPE_UNKNOWN 0x000
735 #define PAPI_MH_TYPE_LRU 0x100
736 #define PAPI_MH_TYPE_PSEUDO_LRU 0x200
737 #define PAPI_MH_CACHE_REPLACEMENT_POLICY(a) (a & 0xf00)
738 #define PAPI_MH_TYPE_TLB 0x1000 /* tlb, not memory cache */
739 #define PAPI_MH_TYPE_PREF 0x2000 /* prefetch buffer */
740 #define PAPI_MH_MAX_LEVELS 6 /* # descriptors for each TLB or cache level */
741 #define PAPI_MAX_MEM_HIERARCHY_LEVELS 4
744  typedef struct _papi_mh_tlb_info {
745  int type;
746  int num_entries;
748  int associativity;
752  typedef struct _papi_mh_cache_info {
753  int type;
754  int size;
755  int line_size;
756  int num_lines;
757  int associativity;
761  typedef struct _papi_mh_level_info {
768  typedef struct _papi_mh_info {
769  int levels;
775  typedef struct _papi_hw_info {
776  int ncpu;
777  int threads;
778  int cores;
779  int sockets;
780  int nnodes;
781  int totalcpus;
782  int vendor;
783  char vendor_string[PAPI_MAX_STR_LEN];
784  int model;
785  char model_string[PAPI_MAX_STR_LEN];
786  float revision;
787  int cpuid_family;
788  int cpuid_model;
789  int cpuid_stepping;
791  int cpu_max_mhz;
792  int cpu_min_mhz;
794  PAPI_mh_info_t mem_hierarchy;
795  int virtualized;
796  char virtual_vendor_string[PAPI_MAX_STR_LEN];
798  char virtual_vendor_version[PAPI_MAX_STR_LEN];
801  /* Legacy Values, do not use */
802  float mhz;
803  int clock_mhz;
805  /* For future expansion */
806  int reserved[8];
807 
809 
811  typedef struct _papi_attach_option {
812  int eventset;
813  unsigned long tid;
817  typedef struct _papi_cpu_option {
818  int eventset;
819  unsigned int cpu_num;
823  typedef struct _papi_multiplex_option {
824  int eventset;
825  int ns;
826  int flags;
831  typedef struct _papi_addr_range_option {
832  int eventset;
833  caddr_t start;
834  caddr_t end;
835  int start_off;
836  int end_off;
843  typedef union
844  {
857  PAPI_shlib_info_t *shlib_info;
858  PAPI_exe_info_t *exe_info;
861  PAPI_user_defined_events_file_t events_file;
866  typedef struct _dmem_t {
867  long long peak;
868  long long size;
869  long long resident;
870  long long high_water_mark;
871  long long shared;
872  long long text;
873  long long library;
874  long long heap;
875  long long locked;
876  long long stack;
877  long long pagesize;
878  long long pte;
881 /* Fortran offsets into PAPI_dmem_info_t structure. */
882 
883 #define PAPIF_DMEM_VMPEAK 1
884 #define PAPIF_DMEM_VMSIZE 2
885 #define PAPIF_DMEM_RESIDENT 3
886 #define PAPIF_DMEM_HIGH_WATER 4
887 #define PAPIF_DMEM_SHARED 5
888 #define PAPIF_DMEM_TEXT 6
889 #define PAPIF_DMEM_LIBRARY 7
890 #define PAPIF_DMEM_HEAP 8
891 #define PAPIF_DMEM_LOCKED 9
892 #define PAPIF_DMEM_STACK 10
893 #define PAPIF_DMEM_PAGESIZE 11
894 #define PAPIF_DMEM_PTE 12
895 #define PAPIF_DMEM_MAXVAL 12
897 #define PAPI_MAX_INFO_TERMS 12 /* should match PAPI_EVENTS_IN_DERIVED_EVENT defined in papi_internal.h */
898 
920 enum {
921  PAPI_LOCATION_CORE = 0,
925 };
928 enum {
929  PAPI_DATATYPE_INT64 = 0,
933 };
936 enum {
939 };
942 enum {
947 };
950 enum {
955 };
957 
958  typedef struct event_info {
959  unsigned int event_code;
961  char symbol[PAPI_HUGE_STR_LEN];
962  char short_descr[PAPI_MIN_STR_LEN];
964  char long_descr[PAPI_HUGE_STR_LEN];
969  int component_index;
970  char units[PAPI_MIN_STR_LEN];
971  int location;
972  int data_type;
973  int value_type;
974  int timescope;
975  int update_type;
976  int update_freq;
978  /* PRESET SPECIFIC FIELDS FOLLOW */
979 
980 
981 
982  unsigned int count;
987  unsigned int event_type;
990  char derived[PAPI_MIN_STR_LEN];
993  char postfix[PAPI_2MAX_STR_LEN];
998  unsigned int code[PAPI_MAX_INFO_TERMS];
1003  char name[PAPI_MAX_INFO_TERMS]
1004  [PAPI_2MAX_STR_LEN];
1008  char note[PAPI_HUGE_STR_LEN];
1014 
1015 
1016 
1017 
1021  int PAPI_accum(int EventSet, long long * values);
1022  int PAPI_add_event(int EventSet, int Event);
1023  int PAPI_add_named_event(int EventSet, char *EventName);
1024  int PAPI_add_events(int EventSet, int *Events, int number);
1025  int PAPI_assign_eventset_component(int EventSet, int cidx);
1026  int PAPI_attach(int EventSet, unsigned long tid);
1027  int PAPI_cleanup_eventset(int EventSet);
1028  int PAPI_create_eventset(int *EventSet);
1029  int PAPI_detach(int EventSet);
1030  int PAPI_destroy_eventset(int *EventSet);
1031  int PAPI_enum_event(int *EventCode, int modifier);
1032  int PAPI_enum_cmp_event(int *EventCode, int modifier, int cidx);
1033  int PAPI_event_code_to_name(int EventCode, char *out);
1034  int PAPI_event_name_to_code(char *in, int *out);
1036  int PAPI_get_event_info(int EventCode, PAPI_event_info_t * info);
1038  const PAPI_hw_info_t *PAPI_get_hardware_info(void);
1040  int PAPI_get_multiplex(int EventSet);
1041  int PAPI_get_opt(int option, PAPI_option_t * ptr);
1042  int PAPI_get_cmp_opt(int option, PAPI_option_t * ptr,int cidx);
1043  long long PAPI_get_real_cyc(void);
1044  long long PAPI_get_real_nsec(void);
1045  long long PAPI_get_real_usec(void);
1047  int PAPI_get_thr_specific(int tag, void **ptr);
1048  int PAPI_get_overflow_event_index(int Eventset, long long overflow_vector, int *array, int *number);
1049  long long PAPI_get_virt_cyc(void);
1050  long long PAPI_get_virt_nsec(void);
1051  long long PAPI_get_virt_usec(void);
1052  int PAPI_is_initialized(void);
1053  int PAPI_library_init(int version);
1054  int PAPI_list_events(int EventSet, int *Events, int *number);
1055  int PAPI_list_threads(unsigned long *tids, int *number);
1056  int PAPI_lock(int);
1057  int PAPI_multiplex_init(void);
1058  int PAPI_num_cmp_hwctrs(int cidx);
1059  int PAPI_num_events(int EventSet);
1060  int PAPI_overflow(int EventSet, int EventCode, int threshold,
1062  void PAPI_perror(char *msg );
1063  int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset,
1064  unsigned scale, int EventSet, int EventCode,
1065  int threshold, int flags);
1066  int PAPI_query_event(int EventCode);
1067  int PAPI_query_named_event(char *EventName);
1068  int PAPI_read(int EventSet, long long * values);
1069  int PAPI_read_ts(int EventSet, long long * values, long long *cyc);
1070  int PAPI_register_thread(void);
1071  int PAPI_remove_event(int EventSet, int EventCode);
1072  int PAPI_remove_named_event(int EventSet, char *EventName);
1073  int PAPI_remove_events(int EventSet, int *Events, int number);
1074  int PAPI_reset(int EventSet);
1075  int PAPI_set_debug(int level);
1076  int PAPI_set_cmp_domain(int domain, int cidx);
1077  int PAPI_set_domain(int domain);
1078  int PAPI_set_cmp_granularity(int granularity, int cidx);
1079  int PAPI_set_granularity(int granularity);
1080  int PAPI_set_multiplex(int EventSet);
1081  int PAPI_set_opt(int option, PAPI_option_t * ptr);
1082  int PAPI_set_thr_specific(int tag, void *ptr);
1083  void PAPI_shutdown(void);
1084  int PAPI_sprofil(PAPI_sprofil_t * prof, int profcnt, int EventSet, int EventCode, int threshold, int flags);
1085  int PAPI_start(int EventSet);
1086  int PAPI_state(int EventSet, int *status);
1087  int PAPI_stop(int EventSet, long long * values);
1088  char *PAPI_strerror(int);
1089  unsigned long PAPI_thread_id(void);
1090  int PAPI_thread_init(unsigned long (*id_fn) (void));
1091  int PAPI_unlock(int);
1092  int PAPI_unregister_thread(void);
1093  int PAPI_write(int EventSet, long long * values);
1094  int PAPI_get_event_component(int EventCode);
1095  int PAPI_get_eventset_component(int EventSet);
1096  int PAPI_get_component_index(char *name);
1097  int PAPI_disable_component(int cidx);
1098  int PAPI_disable_component_by_name( char *name );
1112  int PAPI_accum_counters(long long * values, int array_len);
1113  int PAPI_num_counters(void);
1114  int PAPI_num_components(void);
1115  int PAPI_read_counters(long long * values, int array_len);
1116  int PAPI_start_counters(int *events, int array_len);
1117  int PAPI_stop_counters(long long * values, int array_len);
1118  int PAPI_flips(float *rtime, float *ptime, long long * flpins, float *mflips);
1119  int PAPI_flops(float *rtime, float *ptime, long long * flpops, float *mflops);
1120  int PAPI_ipc(float *rtime, float *ptime, long long * ins, float *ipc);
1121  int PAPI_epc(int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc);
1126 /* Backwards compatibility hacks. Remove eventually? */
1127 int PAPI_num_hwctrs(void);
1128 #define PAPI_COMPONENT_INDEX(a) PAPI_get_event_component(a)
1129 #define PAPI_descr_error(a) PAPI_strerror(a)
1131 #ifdef __cplusplus
1132 }
1133 #endif
1134 #endif
i inherit inherit
int PAPI_stop(int EventSet, long long *values)
Definition: papi.c:2258
int PAPI_is_initialized(void)
Definition: papi.c:6389
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
Definition: papi.c:807
int PAPI_add_event(int EventSet, int EventCode)
Definition: papi.c:1622
void PAPI_perror(char *msg)
Definition: papi.c:4579
Hardware info structure.
Definition: papi.h:777
long long PAPI_get_virt_usec(void)
Definition: papi.c:6298
int PAPI_set_cmp_granularity(int granularity, int cidx)
Definition: papi.c:5548
int PAPI_reset(int EventSet)
Definition: papi.c:2403
long long flags
Definition: iozone.c:12330
int PAPI_add_named_event(int EventSet, char *EventName)
Definition: papi.c:1835
const PAPI_shlib_info_t * PAPI_get_shared_lib_info(void)
Definition: papi.c:6070
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
unsigned long PAPI_thread_id(void)
Definition: papi.c:159
int PAPI_write(int EventSet, long long *values)
Definition: papi.c:2757
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:1717
long long PAPI_get_virt_cyc(void)
Definition: papi.c:6226
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 EventSet
Definition: data_range.c:25
int PAPI_accum_counters(long long *values, int array_len)
Definition: papi_hl.c:756
int PAPI_num_components(void)
Definition: papi.c:4326
int PAPI_enum_event(int *EventCode, int modifier)
Definition: papi.c:1150
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
int PAPI_detach(int EventSet)
Definition: papi.c:3202
void(* PAPI_overflow_handler_t)(int EventSet, void *address, long long overflow_vector, void *context)
Definition: papi.h:564
get the executable&#39;s info
Definition: papi.h:704
int PAPI_register_thread(void)
Definition: papi.c:205
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:4714
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:845
void
Definition: iozone.c:18627
int PAPI_remove_events(int EventSet, int *Events, int number)
Definition: papi.c:5857
long long PAPI_get_virt_nsec(void)
Definition: papi.c:6256
int PAPI_sprofil(PAPI_sprofil_t *prof, int profcnt, int EventSet, int EventCode, int threshold, int flags)
Definition: papi.c:4970
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3409
int PAPI_add_events(int EventSet, int *Events, int number)
Definition: papi.c:5769
#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:846
int PAPI_disable_component_by_name(char *name)
Definition: papi.c:6643
char events[MAX_EVENTS][BUFSIZ]
int multiplex(void)
Definition: multiplex.c:35
int PAPI_set_cmp_domain(int domain, int cidx)
Definition: papi.c:5684
int PAPI_disable_component(int cidx)
Definition: papi.c:6592
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:3904
#define PAPI_2MAX_STR_LEN
Definition: papi.h:464
int PAPI_get_thr_specific(int tag, void **ptr)
Definition: papi.c:359
int PAPI_accum(int EventSet, long long *values)
Definition: papi.c:2689
static struct counter_info * event_info
#define PAPI_MH_MAX_LEVELS
Definition: papi.h:742
int PAPI_thread_init(unsigned long int(*id_fn)(void))
Definition: papi.c:120
int PAPI_library_init(int version)
Definition: papi.c:497
int PAPI_profil(void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
Definition: papi.c:5364
long long debug
Definition: iozone.c:1374
#define PAPI_PMU_MAX
Definition: papi.h:467
char buf[200]
Definition: iozone.c:19609
int PAPI_num_hwctrs(void)
Definition: papi.c:3848
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:868
void PAPI_shutdown(void)
Definition: papi.c:4400
int PAPI_get_cmp_opt(int option, PAPI_option_t *ptr, int cidx)
Definition: papi.c:4274
const PAPI_exe_info_t * PAPI_get_executable_info(void)
Definition: papi.c:6040
int PAPI_num_events(int EventSet)
Definition: papi.c:4365
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4082
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:2997
get the executable&#39;s address space info
Definition: papi.h:692
void *long long tid
Definition: iozone.c:18586
int(* PAPI_debug_handler_t)(int code)
Definition: papi.h:682
int PAPI_set_granularity(int granularity)
Definition: papi.c:5483
int PAPI_get_component_index(char *name)
Definition: papi.c:6536
address range specification for range restricted counting if both are zero, range is disabled ...
Definition: papi.h:833
int PAPI_enum_cmp_event(int *EventCode, int modifier, int cidx)
Definition: papi.c:1324
uint32_t id
Definition: linux-cuda.c:293
mh for mem hierarchy maybe?
Definition: papi.h:770
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:2834
char * addr
Definition: iozone.c:12026
int PAPI_assign_eventset_component(int EventSet, int cidx)
Definition: papi.c:1485
char version[]
Definition: fileop.c:134
int PAPI_create_eventset(int *EventSet)
Definition: papi.c:1424
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:926
int threshold
#define PAPI_MAX_INFO_TERMS
Definition: papi.h:899
int PAPI_event_name_to_code(char *in, int *out)
Definition: papi.c:1010
int PAPI_get_dmem_info(PAPI_dmem_info_t *dest)
Definition: papi.c:5989
goto out
Definition: pscanf.h:20
int PAPI_query_event(int EventCode)
Definition: papi.c:698
int PAPI_get_overflow_event_index(int EventSet, long long overflow_vector, int *array, int *number)
Definition: papi.c:6443
int PAPI_multiplex_init(void)
Definition: papi.c:2926
int PAPI_read_ts(int EventSet, long long *values, long long *cycles)
Definition: papi.c:2592
long long PAPI_get_real_usec(void)
Definition: papi.c:6190
long long status
Definition: iozone.c:1335
int PAPI_unregister_thread(void)
Definition: papi.c:241
int PAPI_set_thr_specific(int tag, void *ptr)
Definition: papi.c:435
char * PAPI_strerror(int errorCode)
Definition: papi.c:4529
int PAPI_query_named_event(char *EventName)
Definition: papi.c:767
char * name
Definition: iozone.c:23648
int PAPI_unlock(int lck)
Definition: papi.c:6347
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:6163
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:3277
unsigned long PAPI_thread_id_t
Definition: papi.h:555
int PAPI_destroy_eventset(int *EventSet)
Definition: papi.c:1971
#define PAPI_MAX_STR_LEN
Definition: papi.h:463
int PAPI_set_domain(int domain)
Definition: papi.c:5614
int PAPI_attach(int EventSet, unsigned long tid)
Definition: papi.c:3145
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:6143
int PAPI_read(int EventSet, long long *values)
Definition: papi.c:2503
int PAPI_start(int EventSet)
Definition: papi.c:2053
int PAPI_get_multiplex(int EventSet)
Definition: papi.c:3967
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6111
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
int PAPI_lock(int lck)
Definition: papi.c:6327
int PAPI_remove_named_event(int EventSet, char *EventName)
Definition: papi.c:1919
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:283
int PAPI_get_event_component(int EventCode)
Definition: papi.c:6509
char * PAPI_user_defined_events_file_t
Definition: papi.h:716
int PAPI_set_debug(int level)
Definition: papi.c:3070
#define PAPI_MAX_MEM_HIERARCHY_LEVELS
Definition: papi.h:743
int PAPI_list_events(int EventSet, int *Events, int *number)
Definition: papi.c:5927
int PAPI_get_eventset_component(int EventSet)
Definition: papi.c:1528
char * ptr
Definition: iozone.c:23586