1PAPI_get_component_info(3) PAPI PAPI_get_component_info(3)
2
3
4
6 PAPI_get_component_info - get information about a specific software
7 component
8
9
11 C Interface
12 #include <papi.h>
13 const PAPI_component_info_t *PAPI_get_component_info(int cidx);
14 Fortran Interface
15 <none>
16
17
19 This function returns a pointer to a structure containing detailed
20 information about a specific software component in the PAPI library.
21 This includes versioning information, preset and native event informa‐
22 tion, and more. For full details, see the structure listing below.
23
24
26 On success, the function returns a valid non-NULL pointer. On error, a
27 NULL pointer is returned.
28
29
31 <none>
32
33
35 const PAPI_component_info_t *cmpinfo = NULL;
36
37 if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
38 exit(1);
39
40 if ((cmpinfo = PAPI_get_component_info(0)) == NULL)
41 exit(1);
42
43 printf("This component supports %d Preset Events and %d Native events.0,
44 cmpinfo->num_preset_events, cmpinfo->num_native_events);
45
46
48 The C data structure returned by this function is found in papi.h and
49 reproduced below:
50
51 typedef struct _papi_component_option {
52 char name[PAPI_MAX_STR_LEN]; /* Name of the component we're using, usually CVS RCS Id */
53 char version[PAPI_MIN_STR_LEN]; /* Version of this component, usually CVS Revision */
54 char support_version[PAPI_MIN_STR_LEN]; /* Version of the support library */
55 char kernel_version[PAPI_MIN_STR_LEN]; /* Version of the kernel PMC support driver */
56 int CmpIdx; /* Index into the vector array for this component; set at init time */
57 int num_cntrs; /* Number of hardware counters the substrate supports */
58 int num_mpx_cntrs; /* Number of multiplexed hardware counters the substrate or PAPI support: PAPI_MPX_DEF_DEG */
59 int num_preset_events; /* Number of preset events the substrate supports */
60 int num_native_events; /* Number of native events the substrate supports */
61 int default_domain; /* The default domain when this substrate is used: PAPI_DOM_USER */
62 int available_domains; /* Available domains; default: .default_domain */
63 int default_granularity; /* The default granularity when this substrate is used: PAPI_GRN_THR */
64 int available_granularities; /* Available granularities; default:.default_granularity */
65 int hardware_intr_sig; /* Signal used by hardware to deliver PMC events: PAPI_SIGNAL */
66 int opcode_match_width; /* Width of opcode matcher if exists, 0 if not */
67 int reserved_ints[4];
68 unsigned int hardware_intr:1; /* hw overflow intr, does not need to be emulated in software*/
69 unsigned int precise_intr:1; /* Performance interrupts happen precisely */
70 unsigned int posix1b_timers:1; /* Using POSIX 1b interval timers (timer_create) instead of setitimer */
71 unsigned int kernel_profile:1; /* Has kernel profiling support (buffered interrupts or sprofil-like) */
72 unsigned int kernel_multiplex:1; /* In kernel multiplexing */
73 unsigned int data_address_range:1; /* Supports data address range limiting */
74 unsigned int instr_address_range:1; /* Supports instruction address range limiting */
75 unsigned int fast_counter_read:1; /* Supports a user level PMC read instruction */
76 unsigned int fast_real_timer:1; /* Supports a fast real timer */
77 unsigned int fast_virtual_timer:1; /* Supports a fast virtual timer */
78 unsigned int attach:1; /* Supports attach */
79 unsigned int attach_must_ptrace:1; /* Attach must first ptrace and stop the thread/process*/
80 unsigned int edge_detect:1; /* Supports edge detection on events */
81 unsigned int invert:1; /* Supports invert detection on events */
82 unsigned int profile_ear:1; /* Supports data/instr/tlb miss address sampling */
83 unsigned int grouped_cntrs:1; /* Underlying hardware uses counter groups */
84 unsigned int reserved_bits:16;
85 } PAPI_component_info_t;
86
87
89 If called before PAPI_library_init() the behavior of the routine is
90 undefined.
91
92
94 PAPI_library_init(3), PAPI_get_opt(3), PAPI_get_dmem_info(3),
95 PAPI_get_hardware_info(3), PAPI_get_executable_info(3)
96
97
98
99PAPI Programmer's Reference April, 2007 PAPI_get_component_info(3)