PAPI  5.6.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
perf_event_uncore_lib.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * get_uncore_event (char *event, int size)
 
char * get_uncore_cbox_event (char *event_name, char *uncore_base, int size)
 

Function Documentation

char* get_uncore_cbox_event ( char *  event_name,
char *  uncore_base,
int  size 
)

Definition at line 106 of file perf_event_uncore_lib.c.

106  {
107 
108  const PAPI_hw_info_t *hwinfo;
109 
110  hwinfo = PAPI_get_hardware_info();
111  if ( hwinfo == NULL ) {
112  return NULL;
113  }
114 
115  if (hwinfo->vendor == PAPI_VENDOR_INTEL) {
116 
117  if ( hwinfo->cpuid_family == 6) {
118 
119  switch(hwinfo->cpuid_model) {
120 
121  case 26:
122  case 30:
123  case 31: /* Nehalem */
124  case 46: /* Nehalem EX */
125  /* No CBOX event? */
126  return NULL;
127  break;
128 
129  case 37:
130  case 44: /* Westmere */
131  case 47: /* Westmere EX */
132  /* No CBOX event? */
133  return NULL;
134  break;
135 
136  case 42: /* SandyBridge */
137  strncpy(event_name,"UNC_CBO_CACHE_LOOKUP:STATE_I:ANY_FILTER",size);
138  strncpy(uncore_base,"snb_unc_cbo",size);
139  return event_name;
140  break;
141 
142  case 58: /* IvyBridge */
143  strncpy(event_name,"UNC_CBO_CACHE_LOOKUP:STATE_I:ANY_FILTER",size);
144  strncpy(uncore_base,"ivb_unc_cbo",BUFSIZ);
145  return event_name;
146  break;
147 
148  case 62: /* Ivy Trail */
149  case 45: /* SandyBridge EP */
150  strncpy(event_name,"UNC_C_TOR_OCCUPANCY:ALL",size);
151  strncpy(uncore_base,"snbep_unc_cbo",size);
152  return event_name;
153  break;
154 
155  case 60:
156  case 70:
157  case 69: /* Haswell: note libpfm4 has no haswell unc support */
158  return NULL;
159  break;
160 
161  case 63: /*haswell EP*/
162  strncpy(event_name,"UNC_C_COUNTER0_OCCUPANCY",size);
163  strncpy(uncore_base,"hswep_unc_cbo",size);
164  return event_name;
165  break;
166 
167  case 61:
168  case 71:
169  case 86: /* Broadwell: note libpfm4 has no broadwell unc support */
170  return NULL;
171  break;
172 
173  case 79: /* Broadwell-EP */
174  strncpy(event_name,"UNC_C_COUNTER0_OCCUPANCY",size);
175  strncpy(uncore_base,"bdx_unc_cbo",size);
176  return event_name;
177  break;
178 
179  case 78:
180  case 94: /* Skylake: note libpfm4 has no skylake unc support */
181  return NULL;
182  break;
183 
184  case 85: /* Skylake-X */
185  /* note libpfm4 has no skylake-x unc support */
186  return NULL;
187  break;
188 
189  case 87: /*Knights Landing*/
190  strncpy(event_name,"UNC_M_D_CLOCKTICKS",size);
191  strncpy(uncore_base,"knl_unc_imc",size);
192  return event_name;
193  break;
194  }
195  }
196  return NULL;
197  }
198 
199  return NULL;
200 }
char event_name[2][PAPI_MAX_STR_LEN]
Definition: data_range.c:29
Hardware info structure.
Definition: papi.h:780
char *long long size
Definition: iozone.c:12023
int cpuid_model
Definition: papi.h:793
int cpuid_family
Definition: papi.h:792
#define PAPI_VENDOR_INTEL
Definition: papi.h:348
int vendor
Definition: papi.h:787
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6185

Here is the call graph for this function:

Here is the caller graph for this function:

char* get_uncore_event ( char *  event,
int  size 
)

Definition at line 7 of file perf_event_uncore_lib.c.

7  {
8 
9  const PAPI_hw_info_t *hwinfo;
10 
11  hwinfo = PAPI_get_hardware_info();
12  if ( hwinfo == NULL ) {
13  return NULL;
14  }
15 
16  if (hwinfo->vendor == PAPI_VENDOR_INTEL) {
17 
18  if ( hwinfo->cpuid_family == 6) {
19 
20  switch(hwinfo->cpuid_model) {
21 
22  case 26:
23  case 30:
24  case 31: /* Nehalem */
25  case 46: /* Nehalem EX */
26  strncpy(event,"nhm_unc::UNC_CLK_UNHALTED",size);
27  return event;
28  break;
29 
30  case 37:
31  case 44: /* Westmere */
32  case 47: /* Westmere EX */
33  strncpy(event,"wsm_unc::UNC_CLK_UNHALTED",size);
34  return event;
35  break;
36 
37  case 42: /* SandyBridge */
38  strncpy(event,"snb_unc_cbo0::UNC_CLOCKTICKS",size);
39  return event;
40  break;
41 
42  case 58: /* IvyBridge */
43  strncpy(event,"ivb_unc_cbo0::UNC_CLOCKTICKS",size);
44  return event;
45  break;
46 
47  case 62: /* Ivy Trail */
48  case 45: /* SandyBridge EP */
49  strncpy(event,"snbep_unc_imc0::UNC_M_CLOCKTICKS",size);
50  return event;
51  break;
52 
53  case 60:
54  case 70:
55  case 69: /* Haswell: note libpfm4 has no haswell unc support */
56  return NULL;
57  break;
58 
59  case 63: /*haswell EP*/
60  strncpy(event,"hswep_unc_cbo0::UNC_C_CLOCKTICKS",size);
61  return event;
62  break;
63 
64  case 61:
65  case 71:
66  case 86: /* Broadwell: note libpfm4 has no broadwell unc support */
67  return NULL;
68  break;
69 
70  case 79: /* Broadwell-EP */
71  strncpy(event,"bdx_unc_cbo0::UNC_C_CLOCKTICKS",size);
72  return event;
73  break;
74 
75  case 78:
76  case 94: /* Skylake: note libpfm4 has no skylake unc support */
77  return NULL;
78  break;
79 
80  case 85: /* Skylake-X */
81  /* note libpfm4 has no skylake-x unc support */
82  return NULL;
83  break;
84 
85  case 87: /*Knights Landing*/
86  strncpy(event,"knl_unc_imc0::UNC_M_D_CLOCKTICKS",size);
87  return event;
88  break;
89  }
90  }
91  return NULL;
92  }
93  else if (hwinfo->vendor == PAPI_VENDOR_AMD) {
94  if ( hwinfo->cpuid_family == 21) {
95  /* For kernel 3.9 at least */
96  strncpy(event,"DRAM_ACCESSES:ALL",size);
97  return event;
98  }
99  return NULL;
100  }
101 
102  return NULL;
103 }
Hardware info structure.
Definition: papi.h:780
char *long long size
Definition: iozone.c:12023
int cpuid_model
Definition: papi.h:793
int cpuid_family
Definition: papi.h:792
#define PAPI_VENDOR_INTEL
Definition: papi.h:348
int vendor
Definition: papi.h:787
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6185
#define PAPI_VENDOR_AMD
Definition: papi.h:349

Here is the call graph for this function:

Here is the caller graph for this function: