kconfig: use pkg-config for ncurses detection
[akaros.git] / user / perfmon / tests / validate_x86.c
1 /*
2  * validate_x86.c - validate event tables + encodings
3  *
4  * Copyright (c) 2010 Google, Inc
5  * Contributed by Stephane Eranian <eranian@gmail.com>
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11  * of the Software, and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * This file is part of libpfm, a performance monitoring support library for
25  * applications on Linux.
26  */
27 #include <sys/types.h>
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <inttypes.h>
31 #include <stdarg.h>
32 #include <errno.h>
33 #include <unistd.h>
34 #include <string.h>
35
36 #include <perfmon/pfmlib.h>
37
38 #define MAX_ENCODING    8
39 #define SRC_LINE        .line = __LINE__
40
41 typedef struct {
42         const char *name;
43         const char *fstr;
44         uint64_t codes[MAX_ENCODING];
45         int ret, count;
46         int line;
47 } test_event_t;
48
49 static const test_event_t x86_test_events[]={
50         { SRC_LINE,
51           .name = "core::INST_RETIRED:ANY_P",
52           .ret  = PFM_SUCCESS,
53           .count = 1,
54           .codes[0] = 0x5300c0ull,
55         },
56         { SRC_LINE,
57           .name = "core::INST_RETIRED:ANY_P:ANY_P",
58           .ret  = PFM_SUCCESS,
59           .count = 1,
60           .codes[0] = 0x5300c0ull,
61         },
62         { SRC_LINE,
63           .name = "core::INST_RETIRED:ANY_P:DEAD",
64           .ret  = PFM_ERR_ATTR, /* cannot know if it is umask or mod */
65           .count = 0,
66           .codes[0] = 0ull,
67         },
68         { SRC_LINE,
69           .name = "core::INST_RETIRED:ANY_P:u:u",
70           .ret  = PFM_SUCCESS,
71           .count = 1,
72           .codes[0] = 0x5100c0ull,
73         },
74         { SRC_LINE,
75           .name = "core::INST_RETIRED:ANY_P:u=0:k=1:u=1",
76           .ret  = PFM_ERR_ATTR_SET,
77           .count = 0,
78           .codes[0] = 0ull,
79         },
80         { SRC_LINE,
81           .name = "core::INST_RETIRED:ANY_P:c=1:i",
82           .ret  = PFM_SUCCESS,
83           .count = 1,
84           .codes[0] = 0x1d300c0ull,
85         },
86         { SRC_LINE,
87           .name = "core::INST_RETIRED:ANY_P:c=1:i=1",
88           .ret  = PFM_SUCCESS,
89           .count = 1,
90           .codes[0] = 0x1d300c0ull,
91         },
92         { SRC_LINE,
93           .name = "core::INST_RETIRED:ANY_P:c=2",
94           .ret = PFM_SUCCESS,
95           .count = 1,
96           .codes[0] = 0x25300c0ull,
97         },
98         { SRC_LINE,
99           .name = "core::INST_RETIRED:ANY_P:c=320",
100           .ret  = PFM_ERR_ATTR_VAL,
101           .count = 0,
102           .codes[0] = 0ull,
103         },
104         { SRC_LINE,
105           .name = "core::INST_RETIRED:ANY_P:t=1",
106           .ret  = PFM_ERR_ATTR,
107           .count = 0,
108           .codes[0] = 0ull,
109         },
110         { SRC_LINE,
111           .name = "core::L2_LINES_IN",
112           .ret  = PFM_SUCCESS,
113           .count = 1,
114           .codes[0] = 0x537024ull,
115         },
116         { SRC_LINE,
117           .name = "core::L2_LINES_IN:SELF",
118           .ret  = PFM_SUCCESS,
119           .count = 1,
120           .codes[0] = 0x537024ull,
121           .fstr = "core::L2_LINES_IN:SELF:ANY:k=1:u=1:e=0:i=0:c=0",
122         },
123         { SRC_LINE,
124           .name = "core::L2_LINES_IN:SELF:BOTH_CORES",
125           .ret  = PFM_ERR_FEATCOMB,
126           .count = 0,
127           .codes[0] = 0ull,
128         },
129         { SRC_LINE,
130           .name = "core::L2_LINES_IN:SELF:PREFETCH",
131           .ret  = PFM_SUCCESS,
132           .count = 1,
133           .codes[0] = 0x535024ull,
134         },
135         { SRC_LINE,
136           .name = "core::L2_LINES_IN:SELF:PREFETCH:ANY",
137           .ret  = PFM_ERR_FEATCOMB,
138           .count = 0,
139           .codes[0] = 0ull,
140         },
141         { SRC_LINE,
142           .name = "core::RS_UOPS_DISPATCHED_NONE",
143           .ret  = PFM_SUCCESS,
144           .count = 1,
145           .codes[0] = 0x1d300a0ull,
146         },
147         { SRC_LINE,
148           .name = "core::RS_UOPS_DISPATCHED_NONE:c=2",
149           .ret  = PFM_ERR_ATTR_SET,
150           .count = 1,
151           .codes[0] = 0ull,
152         },
153         { SRC_LINE,
154           .name = "core::branch_instructions_retired",
155           .ret  = PFM_SUCCESS,
156           .count = 1,
157           .codes[0] = 0x5300c4ull,
158           .fstr = "core::BR_INST_RETIRED:ANY:k=1:u=1:e=0:i=0:c=0"
159         },
160         { SRC_LINE,
161           .name = "nhm::branch_instructions_retired",
162           .ret  = PFM_SUCCESS,
163           .count = 1,
164           .codes[0] = 0x5300c4ull,
165           .fstr = "nhm::BR_INST_RETIRED:ALL_BRANCHES:k=1:u=1:e=0:i=0:c=0:t=0"
166         },
167         { SRC_LINE,
168           .name = "wsm::BRANCH_INSTRUCTIONS_RETIRED",
169           .ret  = PFM_SUCCESS,
170           .count = 1,
171           .codes[0] = 0x5300c4ull, /* architected encoding, guaranteed to exist */
172           .fstr = "wsm::BR_INST_RETIRED:ALL_BRANCHES:k=1:u=1:e=0:i=0:c=0:t=0"
173         },
174         { SRC_LINE,
175           .name = "nhm::ARITH:DIV:k",
176           .ret  = PFM_SUCCESS,
177           .count = 1,
178           .codes[0] = 0x1d60114ull,
179           .fstr = "nhm::ARITH:CYCLES_DIV_BUSY:k=1:u=0:e=1:i=1:c=1:t=0",
180         },
181         { SRC_LINE,
182           .name = "nhm::ARITH:CYCLES_DIV_BUSY:k=1:u=1:e=1:i=1:c=1:t=0",
183           .ret  = PFM_SUCCESS,
184           .count = 1,
185           .codes[0] = 0x1d70114ull,
186           .fstr = "nhm::ARITH:CYCLES_DIV_BUSY:k=1:u=1:e=1:i=1:c=1:t=0",
187         },
188         { SRC_LINE,
189           .name = "wsm::UOPS_EXECUTED:CORE_STALL_COUNT:u",
190           .ret  = PFM_SUCCESS,
191           .count = 1,
192           .codes[0] = 0x1f53fb1ull,
193           .fstr = "wsm::UOPS_EXECUTED:CORE_STALL_CYCLES:k=0:u=1:e=1:i=1:c=1:t=1",
194         },
195         { SRC_LINE,
196           .name = "wsm::UOPS_EXECUTED:CORE_STALL_COUNT:u:t=0",
197           .ret  = PFM_ERR_ATTR_SET,
198           .count = 0,
199           .codes[0] = 0ull,
200         },
201         { SRC_LINE,
202           .name = "wsm_unc::unc_qmc_writes:full_any:partial_any",
203           .ret  = PFM_ERR_FEATCOMB,
204           .count = 0,
205           .codes[0] = 0ull,
206         },
207         { SRC_LINE,
208           .name = "wsm_unc::unc_qmc_writes",
209           .ret  = PFM_SUCCESS,
210           .count = 1,
211           .codes[0] = 0x50072full,
212           .fstr = "wsm_unc::UNC_QMC_WRITES:FULL_ANY:e=0:i=0:c=0:o=0",
213         },
214         { SRC_LINE,
215           .name = "wsm_unc::unc_qmc_writes:full_any",
216           .ret  = PFM_SUCCESS,
217           .count = 1,
218           .codes[0] = 0x50072full,
219           .fstr = "wsm_unc::UNC_QMC_WRITES:FULL_ANY:e=0:i=0:c=0:o=0",
220         },
221         { SRC_LINE,
222           .name = "wsm_unc::unc_qmc_writes:full_ch0",
223           .ret  = PFM_SUCCESS,
224           .count = 1,
225           .codes[0] = 0x50012full,
226           .fstr = "wsm_unc::UNC_QMC_WRITES:FULL_CH0:e=0:i=0:c=0:o=0",
227         },
228         { SRC_LINE,
229           .name = "wsm_unc::unc_qmc_writes:partial_any",
230           .ret  = PFM_SUCCESS,
231           .count = 1,
232           .codes[0] = 0x50382full,
233           .fstr = "wsm_unc::UNC_QMC_WRITES:PARTIAL_ANY:e=0:i=0:c=0:o=0",
234         },
235         { SRC_LINE,
236           .name = "wsm_unc::unc_qmc_writes:partial_ch0",
237           .ret  = PFM_SUCCESS,
238           .count = 1,
239           .codes[0] = 0x50082full,
240           .fstr = "wsm_unc::UNC_QMC_WRITES:PARTIAL_CH0:e=0:i=0:c=0:o=0",
241         },
242         { SRC_LINE,
243           .name = "wsm_unc::unc_qmc_writes:partial_ch0:partial_ch1",
244           .ret  = PFM_SUCCESS,
245           .count = 1,
246           .codes[0] = 0x50182full,
247           .fstr = "wsm_unc::UNC_QMC_WRITES:PARTIAL_CH0:PARTIAL_CH1:e=0:i=0:c=0:o=0",
248         },
249         { SRC_LINE,
250           .name = "amd64_fam10h_barcelona::DISPATCHED_FPU",
251           .ret  = PFM_SUCCESS,
252           .count = 1,
253           .codes[0] = 0x533f00ull,
254           .fstr = "amd64_fam10h_barcelona::DISPATCHED_FPU:ALL:k=1:u=1:e=0:i=0:c=0:h=0:g=0"
255         },
256         { SRC_LINE,
257           .name = "amd64_fam10h_barcelona::DISPATCHED_FPU:k:u=0",
258           .ret  = PFM_SUCCESS,
259           .count = 1,
260           .codes[0] = 0x523f00ull,
261           .fstr = "amd64_fam10h_barcelona::DISPATCHED_FPU:ALL:k=1:u=0:e=0:i=0:c=0:h=0:g=0"
262         },
263         { SRC_LINE,
264           .name = "amd64_fam10h_barcelona::DISPATCHED_FPU:OPS_ADD:OPS_MULTIPLY",
265           .ret  = PFM_SUCCESS,
266           .count = 1,
267           .codes[0] = 0x530300ull,
268           .fstr = "amd64_fam10h_barcelona::DISPATCHED_FPU:OPS_ADD:OPS_MULTIPLY:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
269         },
270         { SRC_LINE,
271           .name = "amd64_fam10h_barcelona::L2_CACHE_MISS:ALL:DATA",
272           .ret  = PFM_ERR_FEATCOMB,
273           .count = 0,
274           .codes[0] = 0ull,
275         },
276         { SRC_LINE,
277           .name = "amd64_fam10h_barcelona::MEMORY_CONTROLLER_REQUESTS",
278           .ret  = PFM_SUCCESS,
279           .count = 1,
280           .codes[0] = 0x10053fff0ull,
281           .fstr = "amd64_fam10h_barcelona::MEMORY_CONTROLLER_REQUESTS:ALL:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
282         },
283         { SRC_LINE,
284           .name = "amd64_k8_revb::RETURN_STACK_OVERFLOWS:g=1:u",
285           .ret  = PFM_ERR_ATTR,
286           .count = 0,
287           .codes[0] = 0ull,
288         },
289         { SRC_LINE,
290           .name = "amd64_k8_revb::RETURN_STACK_HITS:e=1",
291           .ret  = PFM_SUCCESS,
292           .count = 1,
293           .codes[0] = 0x570088ull,
294           .fstr = "amd64_k8_revb::RETURN_STACK_HITS:k=1:u=1:e=1:i=0:c=0",
295         },
296         { SRC_LINE,
297           .name = "amd64_k8_revb::PROBE:ALL",
298           .ret  = PFM_SUCCESS,
299           .count = 1,
300           .codes[0] = 0x533fecull,
301           .fstr = "amd64_k8_revb::PROBE:ALL:k=1:u=1:e=0:i=0:c=0",
302         },
303         { SRC_LINE,
304           .name = "amd64_k8_revc::PROBE:ALL",
305           .ret  = PFM_SUCCESS,
306           .count = 1,
307           .codes[0] = 0x533fecull,
308           .fstr = "amd64_k8_revc::PROBE:ALL:k=1:u=1:e=0:i=0:c=0",
309         },
310         { SRC_LINE,
311           .name = "amd64_k8_revd::PROBE:ALL",
312           .ret  = PFM_SUCCESS,
313           .count = 1,
314           .codes[0] = 0x537fecull,
315           .fstr = "amd64_k8_revd::PROBE:ALL:k=1:u=1:e=0:i=0:c=0"
316         },
317         { SRC_LINE,
318           .name = "amd64_k8_reve::PROBE:ALL",
319           .ret  = PFM_SUCCESS,
320           .count = 1,
321           .codes[0] = 0x537fecull,
322           .fstr = "amd64_k8_reve::PROBE:ALL:k=1:u=1:e=0:i=0:c=0"
323         },
324         { SRC_LINE,
325           .name = "amd64_k8_revf::PROBE:ALL",
326           .ret  = PFM_SUCCESS,
327           .count = 1,
328           .codes[0] = 0x537fecull,
329           .fstr = "amd64_k8_revf::PROBE:ALL:k=1:u=1:e=0:i=0:c=0"
330         },
331         { SRC_LINE,
332           .name = "amd64_k8_revg::PROBE:ALL",
333           .ret  = PFM_SUCCESS,
334           .count = 1,
335           .codes[0] = 0x537fecull,
336           .fstr = "amd64_k8_revg::PROBE:ALL:k=1:u=1:e=0:i=0:c=0"
337         },
338         { SRC_LINE,
339           .name = "amd64_fam10h_barcelona::L1_DTLB_MISS_AND_L2_DTLB_HIT:L2_1G_TLB_HIT",
340           .ret  = PFM_ERR_ATTR,
341           .count = 0,
342           .codes[0] = 0ull,
343         },
344         { SRC_LINE,
345           .name = "amd64_fam10h_barcelona::L1_DTLB_MISS_AND_L2_DTLB_HIT:ALL",
346           .ret  = PFM_SUCCESS,
347           .count = 1,
348           .codes[0] = 0x530345ull,
349           .fstr = "amd64_fam10h_barcelona::L1_DTLB_MISS_AND_L2_DTLB_HIT:ALL:k=1:u=1:e=0:i=0:c=0:h=0:g=0"
350         },
351         { SRC_LINE,
352           .name = "amd64_fam10h_shanghai::L1_DTLB_MISS_AND_L2_DTLB_HIT:ALL",
353           .ret  = PFM_SUCCESS,
354           .count = 1,
355           .codes[0] = 0x530745ull,
356           .fstr = "amd64_fam10h_shanghai::L1_DTLB_MISS_AND_L2_DTLB_HIT:ALL:k=1:u=1:e=0:i=0:c=0:h=0:g=0"
357         },
358         { SRC_LINE,
359           .name = "amd64_fam10h_istanbul::L1_DTLB_MISS_AND_L2_DTLB_HIT:ALL",
360           .ret  = PFM_SUCCESS,
361           .count = 1,
362           .codes[0] = 0x530745ull,
363           .fstr = "amd64_fam10h_istanbul::L1_DTLB_MISS_AND_L2_DTLB_HIT:ALL:k=1:u=1:e=0:i=0:c=0:h=0:g=0"
364         },
365         { SRC_LINE,
366           .name = "amd64_fam10h_barcelona::READ_REQUEST_TO_L3_CACHE",
367           .ret  = PFM_SUCCESS,
368           .count = 1,
369           .codes[0] = 0x40053f7e0ull,
370           .fstr = "amd64_fam10h_barcelona::READ_REQUEST_TO_L3_CACHE:ANY_READ:ALL_CORES:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
371         },
372         { SRC_LINE,
373           .name = "amd64_fam10h_shanghai::READ_REQUEST_TO_L3_CACHE",
374           .ret  = PFM_SUCCESS,
375           .count = 1,
376           .codes[0] = 0x40053f7e0ull,
377           .fstr = "amd64_fam10h_shanghai::READ_REQUEST_TO_L3_CACHE:ANY_READ:ALL_CORES:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
378         },
379         { SRC_LINE,
380           .name = "core::RAT_STALLS:ANY:u:c=1,cycles", /* must cut at comma */
381           .ret  = PFM_SUCCESS,
382           .count = 1,
383           .codes[0] = 0x1510fd2ull,
384           .fstr = "core::RAT_STALLS:ANY:k=0:u=1:e=0:i=0:c=1"
385         },
386         { SRC_LINE,
387           .name = "wsm::mem_uncore_retired:remote_dram",
388           .ret  = PFM_SUCCESS,
389           .count = 1,
390           .codes[0] = 0x53200f,
391           .fstr = "wsm::MEM_UNCORE_RETIRED:REMOTE_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
392         },
393         { SRC_LINE,
394           .name = "wsm_dp::mem_uncore_retired:remote_dram",
395           .ret  = PFM_SUCCESS,
396           .count = 1,
397           .codes[0] = 0x53100f,
398           .fstr = "wsm_dp::MEM_UNCORE_RETIRED:REMOTE_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
399         },
400         { SRC_LINE,
401           .name = "wsm::mem_uncore_retired:local_dram",
402           .ret  = PFM_SUCCESS,
403           .count = 1,
404           .codes[0] = 0x53100f,
405           .fstr = "wsm::MEM_UNCORE_RETIRED:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
406         },
407         { SRC_LINE,
408           .name = "wsm_dp::mem_uncore_retired:local_dram",
409           .ret  = PFM_ERR_ATTR,
410           .count = 1,
411           .codes[0] = 0,
412         },
413         { SRC_LINE,
414           .name = "nhm::mem_uncore_retired:uncacheable",
415           .ret  = PFM_ERR_ATTR,
416           .count = 1,
417           .codes[0] = 0,
418         },
419         { SRC_LINE,
420           .name = "nhm::mem_uncore_retired:l3_data_miss_unknown",
421           .ret  = PFM_ERR_ATTR,
422           .count = 1,
423           .codes[0] = 0,
424         },
425         { SRC_LINE,
426           .name = "nhm_ex::mem_uncore_retired:uncacheable",
427           .ret  = PFM_SUCCESS,
428           .count = 1,
429           .codes[0] = 0x53800f,
430           .fstr = "nhm_ex::MEM_UNCORE_RETIRED:UNCACHEABLE:k=1:u=1:e=0:i=0:c=0:t=0",
431         },
432         { SRC_LINE,
433           .name = "nhm_ex::mem_uncore_retired:l3_data_miss_unknown",
434           .ret  = PFM_SUCCESS,
435           .count = 1,
436           .codes[0] = 0x53010f,
437           .fstr = "nhm_ex::MEM_UNCORE_RETIRED:L3_DATA_MISS_UNKNOWN:k=1:u=1:e=0:i=0:c=0:t=0",
438         },
439         { SRC_LINE,
440           .name = "nhm::mem_uncore_retired:local_dram",
441           .ret  = PFM_SUCCESS,
442           .count = 1,
443           .codes[0] = 0x53200f,
444           .fstr = "nhm::MEM_UNCORE_RETIRED:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
445         },
446         { SRC_LINE,
447           .name = "nhm_ex::mem_uncore_retired:local_dram",
448           .ret  = PFM_SUCCESS,
449           .count = 1,
450           .codes[0] = 0x53200f,
451           .fstr = "nhm_ex::MEM_UNCORE_RETIRED:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
452         },
453         { SRC_LINE,
454           .name = "wsm::offcore_response_0:k",
455           .ret  = PFM_SUCCESS,
456           .count = 2,
457           .codes[0] = 0x5201b7,
458           .codes[1] = 0xffff,
459           .fstr = "wsm::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:k=1:u=0:e=0:i=0:c=0:t=0",
460         },
461         { SRC_LINE,
462           .name = "wsm::offcore_response_0:local_dram",
463           .ret  = PFM_SUCCESS,
464           .count = 2,
465           .codes[0] = 0x5301b7,
466           .codes[1] = 0x20ff,
467           .fstr = "wsm::OFFCORE_RESPONSE_0:ANY_REQUEST:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
468         },
469         { SRC_LINE,
470           .name = "wsm::offcore_response_0:PF_IFETCH",
471           .ret  = PFM_SUCCESS,
472           .count = 2,
473           .codes[0] = 0x5301b7,
474           .codes[1] = 0xff40,
475           .fstr = "wsm::OFFCORE_RESPONSE_0:PF_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
476         },
477         { SRC_LINE,
478           .name = "wsm::offcore_response_0:ANY_DATA:LOCAL_DRAM",
479           .ret  = PFM_SUCCESS,
480           .count = 2,
481           .codes[0] = 0x5301b7,
482           .codes[1] = 0x2033,
483           .fstr = "wsm::OFFCORE_RESPONSE_0:DMND_DATA_RD:DMND_RFO:PF_DATA_RD:PF_RFO:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
484         },
485         { SRC_LINE,
486           .name = "wsm::offcore_response_0:DMND_RFO:DMND_DATA_RD:LOCAL_DRAM:REMOTE_DRAM",
487           .ret  = PFM_SUCCESS,
488           .count = 2,
489           .codes[0] = 0x5301b7,
490           .codes[1] = 0x6003,
491           .fstr = "wsm::OFFCORE_RESPONSE_0:DMND_DATA_RD:DMND_RFO:LOCAL_DRAM:REMOTE_DRAM:k=1:u=1:e=0:i=0:c=0:t=0"
492         },
493         { SRC_LINE,
494           .name = "wsm::offcore_response_1:local_dram",
495           .ret  = PFM_SUCCESS,
496           .count = 2,
497           .codes[0] = 0x5301bb,
498           .codes[1] = 0x20ff,
499           .fstr = "wsm::OFFCORE_RESPONSE_1:ANY_REQUEST:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
500         },
501         { SRC_LINE,
502           .name = "wsm::offcore_response_1:PF_IFETCH",
503           .ret  = PFM_SUCCESS,
504           .count = 2,
505           .codes[0] = 0x5301bb,
506           .codes[1] = 0xff40,
507           .fstr = "wsm::OFFCORE_RESPONSE_1:PF_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
508         },
509         { SRC_LINE,
510           .name = "wsm::offcore_response_1:ANY_DATA:LOCAL_DRAM",
511           .ret  = PFM_SUCCESS,
512           .count = 2,
513           .codes[0] = 0x5301bb,
514           .codes[1] = 0x2033,
515           .fstr = "wsm::OFFCORE_RESPONSE_1:DMND_DATA_RD:DMND_RFO:PF_DATA_RD:PF_RFO:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
516         },
517         { SRC_LINE,
518           .name = "wsm::offcore_response_1:DMND_RFO:DMND_DATA_RD:LOCAL_DRAM:REMOTE_DRAM",
519           .ret  = PFM_SUCCESS,
520           .count = 2,
521           .codes[0] = 0x5301bb,
522           .codes[1] = 0x6003,
523           .fstr = "wsm::OFFCORE_RESPONSE_1:DMND_DATA_RD:DMND_RFO:LOCAL_DRAM:REMOTE_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
524         },
525         { SRC_LINE,
526           .name = "wsm::offcore_response_0:ANY_LLC_MISS",
527           .ret  = PFM_SUCCESS,
528           .count = 2,
529           .codes[0] = 0x5301b7,
530           .codes[1] = 0xf8ff,
531           .fstr = "wsm::OFFCORE_RESPONSE_0:ANY_REQUEST:REMOTE_CACHE_HITM:REMOTE_CACHE_FWD:LOCAL_DRAM:REMOTE_DRAM:NON_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
532         },
533         { SRC_LINE,
534           .name = "wsm_dp::offcore_response_0:ANY_LLC_MISS",
535           .ret  = PFM_SUCCESS,
536           .count = 2,
537           .codes[0] = 0x5301b7,
538           .codes[1] = 0xf8ff,
539           .fstr = "wsm_dp::OFFCORE_RESPONSE_0:ANY_REQUEST:REMOTE_CACHE_HITM:LOCAL_DRAM_AND_REMOTE_CACHE_HIT:REMOTE_DRAM:OTHER_LLC_MISS:NON_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
540         },
541         { SRC_LINE,
542           .name = "wsm_dp::offcore_response_0:LOCAL_CACHE",
543           .ret  = PFM_SUCCESS,
544           .count = 2,
545           .codes[0] = 0x5301b7,
546           .codes[1] = 0x7ff,
547           .fstr = "wsm_dp::OFFCORE_RESPONSE_0:ANY_REQUEST:UNCORE_HIT:OTHER_CORE_HIT_SNP:OTHER_CORE_HITM:k=1:u=1:e=0:i=0:c=0:t=0",
548         },
549         { SRC_LINE,
550           .name = "wsm_dp::offcore_response_0:ANY_CACHE_DRAM",
551           .ret  = PFM_SUCCESS,
552           .count = 2,
553           .codes[0] = 0x5301b7,
554           .codes[1] = 0x7fff,
555           .fstr = "wsm_dp::OFFCORE_RESPONSE_0:ANY_REQUEST:UNCORE_HIT:OTHER_CORE_HIT_SNP:OTHER_CORE_HITM:REMOTE_CACHE_HITM:LOCAL_DRAM_AND_REMOTE_CACHE_HIT:REMOTE_DRAM:OTHER_LLC_MISS:k=1:u=1:e=0:i=0:c=0:t=0",
556         },
557         { SRC_LINE,
558           .name = "nhm::offcore_response_0:k",
559           .ret  = PFM_SUCCESS,
560           .count = 2,
561           .codes[0] = 0x5201b7,
562           .codes[1] = 0xffff,
563           .fstr = "nhm::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:k=1:u=0:e=0:i=0:c=0:t=0",
564         },
565         { SRC_LINE,
566           .name = "nhm::offcore_response_0:local_dram",
567           .ret  = PFM_SUCCESS,
568           .count = 2,
569           .codes[0] = 0x5301b7,
570           .codes[1] = 0x40ff,
571           .fstr = "nhm::OFFCORE_RESPONSE_0:ANY_REQUEST:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
572         },
573         { SRC_LINE,
574           .name = "nhm::offcore_response_0:any_llc_miss",
575           .ret  = PFM_SUCCESS,
576           .count = 2,
577           .codes[0] = 0x5301b7,
578           .codes[1] = 0xf8ff,
579           .fstr = "nhm::OFFCORE_RESPONSE_0:ANY_REQUEST:REMOTE_CACHE_HITM:REMOTE_CACHE_FWD:REMOTE_DRAM:LOCAL_DRAM:NON_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
580         },
581         { SRC_LINE,
582           .name = "nhm::offcore_response_0:any_dram",
583           .ret  = PFM_SUCCESS,
584           .count = 2,
585           .codes[0] = 0x5301b7,
586           .codes[1] = 0x60ff,
587           .fstr = "nhm::OFFCORE_RESPONSE_0:ANY_REQUEST:REMOTE_DRAM:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
588         },
589         { SRC_LINE,
590           .name = "nhm::offcore_response_0:PF_IFETCH",
591           .ret  = PFM_SUCCESS,
592           .count = 2,
593           .codes[0] = 0x5301b7,
594           .codes[1] = 0xff40,
595           .fstr = "nhm::OFFCORE_RESPONSE_0:PF_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
596         },
597         { SRC_LINE,
598           .name = "nhm::offcore_response_0:ANY_DATA:LOCAL_DRAM",
599           .ret  = PFM_SUCCESS,
600           .count = 2,
601           .codes[0] = 0x5301b7,
602           .codes[1] = 0x4033,
603           .fstr = "nhm::OFFCORE_RESPONSE_0:DMND_DATA_RD:DMND_RFO:PF_DATA_RD:PF_RFO:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
604         },
605         { SRC_LINE,
606           .name = "nhm::offcore_response_0:DMND_RFO:DMND_DATA_RD:LOCAL_DRAM:REMOTE_DRAM",
607           .ret  = PFM_SUCCESS,
608           .count = 2,
609           .codes[0] = 0x5301b7,
610           .codes[1] = 0x6003,
611           .fstr = "nhm::OFFCORE_RESPONSE_0:DMND_DATA_RD:DMND_RFO:REMOTE_DRAM:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
612         },
613         { SRC_LINE,
614           .name = "amd64_k8_revg::DISPATCHED_FPU:0xff:k",
615           .ret  = PFM_SUCCESS,
616           .count = 1,
617           .codes[0] = 0x52ff00ull,
618           .fstr = "amd64_k8_revg::DISPATCHED_FPU:0xff:k=1:u=0:e=0:i=0:c=0"
619         },
620         { SRC_LINE,
621           .name = "amd64_k8_revg::DISPATCHED_FPU:0x4ff",
622           .ret  = PFM_ERR_ATTR,
623           .count = 0,
624         },
625         { SRC_LINE,
626           .name = "amd64_fam10h_barcelona::DISPATCHED_FPU:0x4ff:u",
627           .ret  = PFM_ERR_ATTR
628         },
629         { SRC_LINE,
630           .name = "amd64_fam10h_barcelona::DISPATCHED_FPU:0xff:u",
631           .ret  = PFM_SUCCESS,
632           .count = 1,
633           .codes[0] = 0x51ff00ull,
634           .fstr = "amd64_fam10h_barcelona::DISPATCHED_FPU:0xff:k=0:u=1:e=0:i=0:c=0:h=0:g=0"
635         },
636         { SRC_LINE,
637           .name = "wsm::inst_retired:0xff:k",
638           .ret  = PFM_SUCCESS,
639           .count = 1,
640           .codes[0] = 0x52ffc0,
641           .fstr = "wsm::INST_RETIRED:0xff:k=1:u=0:e=0:i=0:c=0:t=0",
642         },
643         { SRC_LINE,
644           .name = "wsm::uops_issued:0xff:stall_cycles",
645           .ret  = PFM_ERR_ATTR,
646           .count = 0,
647         },
648         { SRC_LINE,
649           .name = "wsm::uops_issued:0xff:0xf1",
650           .ret  = PFM_ERR_ATTR,
651           .count = 0,
652         },
653         { SRC_LINE,
654           .name = "wsm::uops_issued:0xff=",
655           .ret  = PFM_ERR_ATTR_VAL,
656           .count = 0,
657         },
658         { SRC_LINE,
659           .name = "wsm::uops_issued:123",
660           .ret  = PFM_ERR_ATTR,
661           .count = 0,
662         },
663         { SRC_LINE,
664           .name = "wsm::uops_issued:0xfff",
665           .ret  = PFM_ERR_ATTR,
666           .count = 0,
667         },
668         { SRC_LINE,
669           .name = "netburst::global_power_events",
670           .ret  = PFM_SUCCESS,
671           .count = 2,
672           .codes[0] = 0x2600020f,
673           .codes[1] = 0x3d000,
674           .fstr = "netburst::global_power_events:RUNNING:k=1:u=1:e=0:cmpl=0:thr=0",
675         },
676         { SRC_LINE,
677           .name = "netburst::global_power_events:RUNNING:u:k",
678           .ret  = PFM_SUCCESS,
679           .count = 2,
680           .codes[0] = 0x2600020f,
681           .codes[1] = 0x3d000,
682           .fstr = "netburst::global_power_events:RUNNING:k=1:u=1:e=0:cmpl=0:thr=0",
683         },
684         { SRC_LINE,
685           .name = "netburst::global_power_events:RUNNING:e",
686           .ret  = PFM_SUCCESS,
687           .count = 2,
688           .codes[0] = 0x2600020f,
689           .codes[1] = 0x107d000,
690           .fstr = "netburst::global_power_events:RUNNING:k=1:u=1:e=1:cmpl=0:thr=0",
691         },
692         { SRC_LINE,
693           .name = "netburst::global_power_events:RUNNING:cmpl:e:u",
694           .ret  = PFM_SUCCESS,
695           .count = 2,
696           .codes[0] = 0x26000205,
697           .codes[1] = 0x10fd000,
698           .fstr = "netburst::global_power_events:RUNNING:k=0:u=1:e=1:cmpl=1:thr=0",
699         },
700         { SRC_LINE,
701           .name = "netburst::global_power_events:RUNNING:cmpl:thr=8:u",
702           .ret  = PFM_SUCCESS,
703           .count = 2,
704           .codes[0] = 0x26000205,
705           .codes[1] = 0x8fd000,
706           .fstr = "netburst::global_power_events:RUNNING:k=0:u=1:e=0:cmpl=1:thr=8",
707         },
708         { SRC_LINE,
709           .name = "netburst::global_power_events:RUNNING:cmpl:thr=32:u",
710           .ret  = PFM_ERR_ATTR_VAL,
711           .count = 0,
712         },
713         { SRC_LINE,
714           .name = "netburst::instr_completed:nbogus",
715           .ret  = PFM_ERR_NOTFOUND,
716           .count = 0,
717         },
718         { SRC_LINE,
719           .name = "netburst_p::instr_completed:nbogus",
720           .ret  = PFM_SUCCESS,
721           .count = 2,
722           .codes[0] = 0xe00020f,
723           .codes[1] = 0x39000,
724           .fstr = "netburst_p::instr_completed:NBOGUS:k=1:u=1:e=0:cmpl=0:thr=0",
725         },
726         { SRC_LINE,
727           .name = "snb::cpl_cycles:ring0_trans:u",
728           .ret  = PFM_SUCCESS,
729           .count = 1,
730           .codes[0] = 0x155015c,
731           .fstr = "snb::CPL_CYCLES:RING0:k=0:u=1:e=1:i=0:c=1:t=0",
732         },
733         { SRC_LINE,
734           .name = "snb::cpl_cycles:ring0_trans:e=1",
735           .ret  = PFM_SUCCESS,
736           .count = 1,
737           .codes[0] = 0x157015cull,
738         },
739         { SRC_LINE,
740           .name = "snb::OFFCORE_REQUESTS_OUTSTanding:ALL_DATA_RD_CYCLES",
741           .ret  = PFM_SUCCESS,
742           .count = 1,
743           .codes[0] = 0x1530860,
744           .fstr = "snb::OFFCORE_REQUESTS_OUTSTANDING:ALL_DATA_RD:k=1:u=1:e=0:i=0:c=1:t=0",
745         },
746         { SRC_LINE,
747           .name = "snb::uops_issued:core_stall_cycles:u:k",
748           .ret  = PFM_SUCCESS,
749           .count = 1,
750           .codes[0] = 0x1f3010e,
751           .fstr = "snb::UOPS_ISSUED:ANY:k=1:u=1:e=0:i=1:c=1:t=1",
752         },
753         { SRC_LINE,
754           .name = "snb::LLC_REFERences:k:t=1",
755           .ret  = PFM_SUCCESS,
756           .count = 1,
757           .codes[0] = 0x724f2e,
758           .fstr = "snb::LAST_LEVEL_CACHE_REFERENCES:k=1:u=0:e=0:i=0:c=0:t=1",
759         },
760         { SRC_LINE,
761           .name = "snb::ITLB:0x1",
762           .ret  = PFM_SUCCESS,
763           .count = 1,
764           .codes[0] = 0x5301ae,
765           .fstr = "snb::ITLB:0x1:k=1:u=1:e=0:i=0:c=0:t=0",
766         },
767         { SRC_LINE,
768           .name = "snb::offcore_response_0:DMND_RFO:ANY_RESPONSE",
769           .ret  = PFM_SUCCESS,
770           .count = 2,
771           .codes[0] = 0x5301b7,
772           .codes[1] = 0x10002,
773           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
774         },
775         { SRC_LINE,
776           .name = "snb::offcore_response_0:DMND_RFO:ANY_REQUEST",
777           .count = 2,
778           .codes[0] = 0x5301b7,
779           .codes[1] = 0x18fff,
780         },
781         { SRC_LINE,
782           .name = "snb::offcore_response_0:DMND_RFO",
783           .count = 2,
784           .codes[0] = 0x5301b7,
785           .codes[1] = 0x10002,
786           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
787         },
788         { SRC_LINE,
789           .name = "snb::offcore_response_0:any_response",
790           .count = 2,
791           .codes[0] = 0x5301b7,
792           .codes[1] = 0x18fff,
793           .fstr = "snb::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
794         },
795         { SRC_LINE,
796           .name = "snb::offcore_response_0:NO_SUPP:SNP_NONE:PF_RFO:PF_IFETCH",
797           .count = 2,
798           .codes[0] = 0x5301b7,
799           .codes[1] = 0x80020060,
800           .fstr = "snb::OFFCORE_RESPONSE_0:PF_RFO:PF_IFETCH:NO_SUPP:SNP_NONE:k=1:u=1:e=0:i=0:c=0:t=0",
801         },
802         { SRC_LINE,
803           .name = "snb::offcore_response_1:DMND_RFO:ANY_RESPONSE",
804           .ret  = PFM_SUCCESS,
805           .count = 2,
806           .codes[0] = 0x5301bb,
807           .codes[1] = 0x10002,
808           .fstr = "snb::OFFCORE_RESPONSE_1:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
809         },
810         { SRC_LINE,
811           .name = "snb::offcore_response_1:DMND_RFO:ANY_REQUEST",
812           .count = 2,
813           .codes[0] = 0x5301bb,
814           .codes[1] = 0x18fff,
815         },
816         { SRC_LINE,
817           .name = "snb::offcore_response_1:DMND_RFO",
818           .count = 2,
819           .codes[0] = 0x5301bb,
820           .codes[1] = 0x10002,
821           .fstr = "snb::OFFCORE_RESPONSE_1:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
822         },
823         { SRC_LINE,
824           .name = "snb::offcore_response_1:any_response",
825           .count = 2,
826           .codes[0] = 0x5301bb,
827           .codes[1] = 0x18fff,
828           .fstr = "snb::OFFCORE_RESPONSE_1:ANY_REQUEST:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
829         },
830         { SRC_LINE,
831           .name = "snb::offcore_response_1:NO_SUPP:SNP_NONE:PF_RFO:PF_IFETCH",
832           .count = 2,
833           .codes[0] = 0x5301bb,
834           .codes[1] = 0x80020060,
835           .fstr = "snb::OFFCORE_RESPONSE_1:PF_RFO:PF_IFETCH:NO_SUPP:SNP_NONE:k=1:u=1:e=0:i=0:c=0:t=0",
836         },
837         { SRC_LINE,
838           .name = "snb::offcore_response_1:ANY_REQUEST:LLC_MISS_LOCAL_DRAM",
839           .count = 2,
840           .codes[0] = 0x5301bb,
841           .codes[1] = 0x3f80408fffull,
842           .fstr = "snb::OFFCORE_RESPONSE_1:DMND_DATA_RD:DMND_RFO:DMND_IFETCH:WB:PF_DATA_RD:PF_RFO:PF_IFETCH:PF_LLC_DATA_RD:PF_LLC_RFO:PF_LLC_IFETCH:BUS_LOCKS:STRM_ST:OTHER:MISS_DRAM:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0",
843         },
844         { SRC_LINE,
845           .name = "amd64_fam14h_bobcat::MAB_REQUESTS:DC_BUFFER_0",
846           .ret  = PFM_SUCCESS,
847           .count = 1,
848           .codes[0] = 0x530068,
849           .fstr = "amd64_fam14h_bobcat::MAB_REQUESTS:DC_BUFFER_0:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
850         },
851         { SRC_LINE,
852           .name = "amd64_fam14h_bobcat::MAB_REQUESTS:DC_BUFFER_0:DC_BUFFER_1",
853           .ret  = PFM_ERR_FEATCOMB,
854         },
855         { SRC_LINE,
856           .name = "amd64_fam14h_bobcat::MAB_REQUESTS:DC_BUFFER_0:IC_BUFFER_0",
857           .ret  = PFM_ERR_FEATCOMB,
858         },
859         { SRC_LINE,
860           .name = "amd64_fam14h_bobcat::MAB_REQUESTS:ANY_DC_BUFFER",
861           .ret  = PFM_SUCCESS,
862           .count = 1,
863           .codes[0] = 0x530b68,
864           .fstr = "amd64_fam14h_bobcat::MAB_REQUESTS:ANY_DC_BUFFER:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
865         },
866         { SRC_LINE,
867           .name = "amd64_fam14h_bobcat::MAB_REQUESTS:ANY_IC_BUFFER",
868           .ret  = PFM_SUCCESS,
869           .count = 1,
870           .codes[0] = 0x530a68,
871           .fstr = "amd64_fam14h_bobcat::MAB_REQUESTS:ANY_IC_BUFFER:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
872         },
873         { SRC_LINE,
874           .name = "amd64_fam14h_bobcat::MAB_REQUESTS:ANY_IC_BUFFER:IC_BUFFER_1",
875           .ret  = PFM_ERR_FEATCOMB,
876         },
877
878         { SRC_LINE,
879           .name = "core::INST_RETIRED:ANY_P:e",
880           .ret  = PFM_ERR_ATTR,
881         },
882         { SRC_LINE,
883           .name = "core::INST_RETIRED:ANY_P:e:c=1",
884           .ret  = PFM_SUCCESS,
885           .count = 1,
886           .codes[0] = 0x15700c0ull,
887         },
888         { SRC_LINE,
889           .name = "atom::INST_RETIRED:ANY_P:e",
890           .ret  = PFM_SUCCESS,
891           .count = 1,
892           .codes[0] = 0x5700c0ull,
893         },
894         { SRC_LINE,
895           .name = "atom::INST_RETIRED:ANY_P:e:c=1",
896           .ret  = PFM_SUCCESS,
897           .count = 1,
898           .codes[0] = 0x15700c0ull,
899         },
900         { SRC_LINE,
901           .name = "nhm::INST_RETIRED:ANY_P:e",
902           .ret  = PFM_ERR_ATTR,
903         },
904         { SRC_LINE,
905           .name = "nhm::INST_RETIRED:ANY_P:e:c=1",
906           .ret  = PFM_SUCCESS,
907           .count = 1,
908           .codes[0] = 0x15700c0ull,
909         },
910         { SRC_LINE,
911           .name = "wsm::INST_RETIRED:ANY_P:e",
912           .ret  = PFM_ERR_ATTR,
913         },
914         { SRC_LINE,
915           .name = "wsm::INST_RETIRED:ANY_P:e:c=1",
916           .ret  = PFM_SUCCESS,
917           .count = 1,
918           .codes[0] = 0x15700c0ull,
919         },
920         { SRC_LINE,
921           .name = "snb::INST_RETIRED:ANY_P:e",
922           .ret  = PFM_ERR_ATTR,
923         },
924         { SRC_LINE,
925           .name = "snb::INST_RETIRED:ANY_P:e:c=1",
926           .ret  = PFM_SUCCESS,
927           .count = 1,
928           .codes[0] = 0x15700c0ull,
929         },
930         { SRC_LINE,
931           .name = "snb::INST_RETIRED:ANY_P:e:c=1",
932           .ret  = PFM_SUCCESS,
933           .count = 1,
934           .codes[0] = 0x15700c0ull,
935         },
936         { SRC_LINE,
937           .name = "snb::offcore_response_0:any_request",
938           .ret  = PFM_SUCCESS,
939           .count = 2,
940           .codes[0] = 0x5301b7ull,
941           .codes[1]= 0x18fffull,
942           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_DATA_RD:DMND_RFO:DMND_IFETCH:WB:PF_DATA_RD:PF_RFO:PF_IFETCH:PF_LLC_DATA_RD:PF_LLC_RFO:PF_LLC_IFETCH:BUS_LOCKS:STRM_ST:OTHER:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
943         },
944         { SRC_LINE,
945           .name = "snb::offcore_response_0:dmnd_data_rd",
946           .ret  = PFM_SUCCESS,
947           .count = 2,
948           .codes[0] = 0x5301b7ull,
949           .codes[1]=0x10001ull,
950           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_DATA_RD:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
951         },
952         { SRC_LINE,
953           .name = "snb::offcore_response_0:dmnd_data_rd:llc_hite",
954           .ret  = PFM_SUCCESS,
955           .count = 2,
956           .codes[0] = 0x5301b7ull,
957           .codes[1]=0x3f80080001ull,
958           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_DATA_RD:LLC_HITE:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0",
959         },
960         { SRC_LINE,
961           .name = "snb::offcore_response_0:dmnd_data_rd:llc_hite:snp_any",
962           .ret  = PFM_SUCCESS,
963           .count = 2,
964           .codes[0] = 0x5301b7ull,
965           .codes[1]=0x3f80080001ull,
966           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_DATA_RD:LLC_HITE:SNP_NONE:SNP_NOT_NEEDED:SNP_MISS:SNP_NO_FWD:SNP_FWD:HITM:NON_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
967         },
968         { SRC_LINE,
969           .name = "snb::offcore_response_0:dmnd_data_rd:llc_hite:hitm",
970           .ret  = PFM_SUCCESS,
971           .count = 2,
972           .codes[0] = 0x5301b7ull,
973           .codes[1]=0x1000080001ull,
974           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_DATA_RD:LLC_HITE:HITM:k=1:u=1:e=0:i=0:c=0:t=0",
975         },
976         { SRC_LINE,
977           .name = "snb::offcore_response_0:dmnd_data_rd:any_response",
978           .ret  = PFM_SUCCESS,
979           .count = 2,
980           .codes[0] = 0x5301b7ull,
981           .codes[1]=0x10001ull,
982           .fstr = "snb::OFFCORE_RESPONSE_0:DMND_DATA_RD:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
983         },
984         { SRC_LINE,
985           .name = "snb::offcore_response_0:dmnd_data_rd:any_response:snp_any",
986           .ret  = PFM_ERR_FEATCOMB,
987         },
988         { SRC_LINE,
989           .name = "snb::offcore_response_0:dmnd_data_rd:any_response:llc_hitmesf",
990           .ret  = PFM_ERR_FEATCOMB,
991         },
992         { SRC_LINE,
993           .name = "snb::offcore_response_0:any_response",
994           .ret  = PFM_SUCCESS,
995           .count = 2,
996           .codes[0] = 0x5301b7ull,
997           .codes[1]=0x18fffull,
998           .fstr = "snb::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
999         },
1000         { SRC_LINE,
1001           .name = "amd64_fam11h_turion::MAB_REQUESTS:DC_BUFFER_0",
1002           .ret  = PFM_ERR_NOTFOUND,
1003         },
1004         { SRC_LINE,
1005           .name = "amd64_fam11h_turion::RETIRED_INSTRUCTIONS",
1006           .ret  = PFM_SUCCESS,
1007           .count = 1,
1008           .codes[0] = 0x5300c0,
1009           .fstr = "amd64_fam11h_turion::RETIRED_INSTRUCTIONS:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
1010         },
1011         { SRC_LINE,
1012           .name = "amd64_fam11h_turion::RETIRED_UOPS:k",
1013           .ret  = PFM_SUCCESS,
1014           .count = 1,
1015           .codes[0] = 0x5200c1,
1016           .fstr = "amd64_fam11h_turion::RETIRED_UOPS:k=1:u=0:e=0:i=0:c=0:h=0:g=0",
1017         },
1018         { SRC_LINE,
1019           .name = "amd64_fam11h_turion::CPU_CLK_UNHALTED",
1020           .ret  = PFM_SUCCESS,
1021           .count = 1,
1022           .codes[0] = 0x530076,
1023           .fstr = "amd64_fam11h_turion::CPU_CLK_UNHALTED:k=1:u=1:e=0:i=0:c=0:h=0:g=0",
1024         },
1025         { SRC_LINE,
1026           .name = "amd64_fam11h_turion::RETIRED_UOPS:c=1:i",
1027           .ret  = PFM_SUCCESS,
1028           .count = 1,
1029           .codes[0] = 0x1d300c1,
1030           .fstr = "amd64_fam11h_turion::RETIRED_UOPS:k=1:u=1:e=0:i=1:c=1:h=0:g=0",
1031         },
1032         { SRC_LINE,
1033           .name = "ivb::ARITH:FPU_DIV",
1034           .ret  = PFM_SUCCESS,
1035           .count = 1,
1036           .codes[0] = 0x1570114,
1037           .fstr = "ivb::ARITH:FPU_DIV_ACTIVE:k=1:u=1:e=1:i=0:c=1:t=0",
1038         },
1039         { SRC_LINE,
1040           .name = "ivb::INST_RETIRED:ALL",
1041           .ret  = PFM_SUCCESS,
1042           .count = 1,
1043           .codes[0] = 0x5301c0,
1044           .fstr = "ivb::INST_RETIRED:ALL:k=1:u=1:e=0:i=0:c=0:t=0",
1045         },
1046         { SRC_LINE,
1047           .name = "ivb::INST_RETIRED:ALL:k",
1048           .ret  = PFM_SUCCESS,
1049           .count = 1,
1050           .codes[0] = 0x5201c0,
1051           .fstr = "ivb::INST_RETIRED:ALL:k=1:u=0:e=0:i=0:c=0:t=0",
1052         },
1053         { SRC_LINE,
1054           .name = "ivb::INST_RETIRED:ALL:u",
1055           .ret  = PFM_SUCCESS,
1056           .count = 1,
1057           .codes[0] = 0x5101c0,
1058           .fstr = "ivb::INST_RETIRED:ALL:k=0:u=1:e=0:i=0:c=0:t=0",
1059         },
1060         { SRC_LINE,
1061           .name = "ivb::TLB_ACCESS:LOAD_STLB_HIT",
1062           .ret  = PFM_SUCCESS,
1063           .count = 1,
1064           .codes[0] = 0x53045f,
1065           .fstr = "ivb::DTLB_LOAD_ACCESS:STLB_HIT:k=1:u=1:e=0:i=0:c=0:t=0",
1066         },
1067         { SRC_LINE,
1068           .name = "ivb::TLB_ACCESS:STLB_HIT",
1069           .ret  = PFM_SUCCESS,
1070           .count = 1,
1071           .codes[0] = 0x53045f,
1072           .fstr = "ivb::DTLB_LOAD_ACCESS:STLB_HIT:k=1:u=1:e=0:i=0:c=0:t=0",
1073         },
1074         { SRC_LINE,
1075           .name = "ivb::DTLB_LOAD_ACCESS:STLB_HIT",
1076           .ret  = PFM_SUCCESS,
1077           .count = 1,
1078           .codes[0] = 0x53045f,
1079           .fstr = "ivb::DTLB_LOAD_ACCESS:STLB_HIT:k=1:u=1:e=0:i=0:c=0:t=0",
1080         },
1081         { SRC_LINE,
1082           .name = "ivb::MOVE_ELIMINATION:INT_NOT_ELIMINATED",
1083           .ret  = PFM_SUCCESS,
1084           .count = 1,
1085           .codes[0] = 0x530158,
1086           .fstr = "ivb::MOVE_ELIMINATION:INT_NOT_ELIMINATED:k=1:u=1:e=0:i=0:c=0:t=0",
1087         },
1088         { SRC_LINE,
1089           .name = "ivb::RESOURCE_STALLS:SB:RS",
1090           .ret  = PFM_SUCCESS,
1091           .count = 1,
1092           .codes[0] = 0x530ca2,
1093           .fstr = "ivb::RESOURCE_STALLS:RS:SB:k=1:u=1:e=0:i=0:c=0:t=0",
1094         },
1095         { SRC_LINE,
1096           .name = "ivb::RESOURCE_STALLS:ROB:RS",
1097           .ret  = PFM_SUCCESS,
1098           .count = 1,
1099           .codes[0] = 0x5314a2,
1100           .fstr = "ivb::RESOURCE_STALLS:RS:ROB:k=1:u=1:e=0:i=0:c=0:t=0",
1101         },
1102         { SRC_LINE,
1103           .name = "ivb::UOPS_EXECUTED:THREAD",
1104           .ret  = PFM_SUCCESS,
1105           .count = 1,
1106           .codes[0] = 0x5301b1,
1107           .fstr = "ivb::UOPS_EXECUTED:THREAD:k=1:u=1:e=0:i=0:c=0:t=0",
1108         },
1109         { SRC_LINE,
1110           .name = "ivb::UOPS_EXECUTED:THREAD:e:c=1",
1111           .ret  = PFM_SUCCESS,
1112           .count = 1,
1113           .codes[0] = 0x15701b1,
1114           .fstr = "ivb::UOPS_EXECUTED:THREAD:k=1:u=1:e=1:i=0:c=1:t=0",
1115         },
1116         { SRC_LINE,
1117           .name = "ivb::UOPS_EXECUTED:THREAD:e",
1118           .ret  = PFM_ERR_ATTR,
1119         },
1120         { SRC_LINE,
1121           .name = "ivb::UOPS_EXECUTED:THREAD:c=1:i",
1122           .ret  = PFM_SUCCESS,
1123           .count = 1,
1124           .codes[0] = 0x1d301b1,
1125           .fstr = "ivb::UOPS_EXECUTED:THREAD:k=1:u=1:e=0:i=1:c=1:t=0",
1126         },
1127         { SRC_LINE,
1128           .name = "ivb::CPU_CLK_UNHALTED:REF_P",
1129           .ret  = PFM_SUCCESS,
1130           .count = 1,
1131           .codes[0] = 0x53013c,
1132           .fstr = "ivb::CPU_CLK_UNHALTED:REF_XCLK:k=1:u=1:e=0:i=0:c=0:t=0",
1133         },
1134         { SRC_LINE,
1135           .name = "ivb::DTLB_LOAD_MISSES:DEMAND_LD_MISS_CAUSES_A_WALK",
1136           .ret  = PFM_SUCCESS,
1137           .count = 1,
1138           .codes[0] = 0x538108,
1139           .fstr = "ivb::DTLB_LOAD_MISSES:MISS_CAUSES_A_WALK:k=1:u=1:e=0:i=0:c=0:t=0",
1140         },
1141         { SRC_LINE,
1142           .name = "ivb::offcore_response_0:k",
1143           .ret  = PFM_SUCCESS,
1144           .count = 2,
1145           .codes[0] = 0x5201b7,
1146           .codes[1] = 0x18fff,
1147           .fstr = "ivb::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:k=1:u=0:e=0:i=0:c=0:t=0",
1148         },
1149         { SRC_LINE,
1150           .name = "ivb::offcore_response_0:LLC_MISS_LOCAL",
1151           .ret  = PFM_SUCCESS,
1152           .count = 2,
1153           .codes[0] = 0x5301b7,
1154           .codes[1] = 0x3f80408fffull,
1155           .fstr = "ivb::OFFCORE_RESPONSE_0:ANY_REQUEST:LLC_MISS_LOCAL:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0",
1156         },
1157         { SRC_LINE,
1158           .name = "ivb::DTLB_LOAD_MISSES:STLB_HIT",
1159           .ret  = PFM_SUCCESS,
1160           .count = 1,
1161           .codes[0] = 0x53045f,
1162           .fstr = "ivb::DTLB_LOAD_MISSES:STLB_HIT:k=1:u=1:e=0:i=0:c=0:t=0",
1163         },
1164         { SRC_LINE,
1165           .name = "ivb::DTLB_LOAD_MISSES:LARGE_WALK_COMPLETED:u",
1166           .ret  = PFM_SUCCESS,
1167           .count = 1,
1168           .codes[0] = 0x518808,
1169           .fstr = "ivb::DTLB_LOAD_MISSES:LARGE_WALK_COMPLETED:k=0:u=1:e=0:i=0:c=0:t=0",
1170         },
1171         { SRC_LINE,
1172           .name = "snb::l2_lines_in:i:i=1",
1173           .ret  = PFM_SUCCESS,
1174           .count = 1,
1175           .codes[0] = 0xd301f1,
1176           .fstr = "snb::L2_LINES_IN:I:k=1:u=1:e=0:i=1:c=0:t=0",
1177         },
1178         { SRC_LINE,
1179           .name = "snb::l2_lines_in:i=1:i",
1180           .ret  = PFM_SUCCESS,
1181           .count = 1,
1182           .codes[0] = 0xd301f1,
1183           .fstr = "snb::L2_LINES_IN:I:k=1:u=1:e=0:i=1:c=0:t=0",
1184         },
1185         { SRC_LINE,
1186           .name = "snb::l2_lines_in:i:i=0",
1187           .ret  = PFM_SUCCESS,
1188           .count = 1,
1189           .codes[0] = 0x5301f1,
1190           .fstr = "snb::L2_LINES_IN:I:k=1:u=1:e=0:i=0:c=0:t=0",
1191         },
1192         { SRC_LINE,
1193           .name = "snb::l2_lines_in:e:e=0",
1194           .ret  = PFM_SUCCESS,
1195           .count = 1,
1196           .codes[0] = 0x5304f1,
1197           .fstr = "snb::L2_LINES_IN:E:k=1:u=1:e=0:i=0:c=0:t=0",
1198         },
1199         { SRC_LINE,
1200           .name = "snb::l2_lines_in:e:e=1",
1201           .ret  = PFM_ERR_ATTR,
1202           .count = 0,
1203         },
1204         { SRC_LINE,
1205           .name = "snb::l2_lines_in:e:e=1:c=10",
1206           .ret  = PFM_SUCCESS,
1207           .count = 1,
1208           .codes[0] = 0xa5704f1,
1209           .fstr = "snb::L2_LINES_IN:E:k=1:u=1:e=1:i=0:c=10:t=0",
1210         },
1211         { SRC_LINE,
1212           .name = "snb_unc_cbo0::unc_clockticks",
1213           .ret  = PFM_SUCCESS,
1214           .count = 1,
1215           .codes[0] = 0x5000ff,
1216           .fstr = "snb_unc_cbo0::UNC_CLOCKTICKS",
1217         },
1218         { SRC_LINE,
1219           .name = "snb_unc_cbo1::unc_clockticks",
1220           .ret  = PFM_ERR_NOTFOUND
1221         },
1222         { SRC_LINE,
1223           .name = "snb_unc_cbo2::unc_clockticks",
1224           .ret  = PFM_ERR_NOTFOUND
1225         },
1226         { SRC_LINE,
1227           .name = "snb_unc_cbo3::unc_clockticks",
1228           .ret  = PFM_ERR_NOTFOUND
1229         },
1230         { SRC_LINE,
1231           .name = "snb_unc_cbo1::UNC_CBO_CACHE_LOOKUP:STATE_MESI:READ_FILTER:c=1:i",
1232           .ret  = PFM_SUCCESS,
1233           .count = 1,
1234           .codes[0] = 0x1d01f34,
1235           .fstr = "snb_unc_cbo1::UNC_CBO_CACHE_LOOKUP:STATE_MESI:READ_FILTER:e=0:i=1:c=1",
1236         },
1237         { SRC_LINE,
1238           .name = "snbep_unc_cbo1::UNC_C_CLOCKTICKS:u",
1239           .ret  = PFM_ERR_ATTR,
1240         },
1241         { SRC_LINE,
1242           .name = "snbep_unc_cbo0::UNC_C_CLOCKTICKS",
1243           .ret  = PFM_SUCCESS,
1244           .count = 1,
1245           .codes[0] = 0x00,
1246           .fstr = "snbep_unc_cbo0::UNC_C_CLOCKTICKS",
1247         },
1248         { SRC_LINE,
1249           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ",
1250           .ret  = PFM_SUCCESS,
1251           .count = 2,
1252           .codes[0] = 0x334,
1253           .codes[1] = 0x7c0000,
1254           .fstr = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:STATE_MESIF:e=0:i=0:t=0:tf=0:cf=0",
1255         },
1256         { SRC_LINE,
1257           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:ANY",
1258           .ret  = PFM_SUCCESS,
1259           .count = 2,
1260           .codes[0] = 0x1f34,
1261           .codes[1] = 0x7c0000,
1262           .fstr = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:ANY:STATE_MESIF:e=0:i=0:t=0:tf=0:cf=0",
1263         },
1264         { SRC_LINE,
1265           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:nf=1",
1266           .ret  = PFM_ERR_ATTR,
1267         },
1268         { SRC_LINE,
1269           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:tid=1",
1270           .ret  = PFM_ERR_ATTR,
1271         },
1272         { SRC_LINE,
1273           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID",
1274           .ret  = PFM_ERR_ATTR,
1275         },
1276         { SRC_LINE,
1277           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID:STATE_M",
1278           .ret  = PFM_ERR_ATTR,
1279         },
1280         { SRC_LINE,
1281           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID:nf=3",
1282           .ret  = PFM_SUCCESS,
1283           .count = 2,
1284           .codes[0] = 0x4334,
1285           .codes[1] = 0x7c0c00,
1286           .fstr = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:NID:STATE_MESIF:e=0:i=0:t=0:tf=0:cf=0:nf=3",
1287         },
1288         { SRC_LINE,
1289           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID:STATE_M:nf=3",
1290           .ret  = PFM_SUCCESS,
1291           .count = 2,
1292           .codes[0] = 0x4334,
1293           .codes[1] = 0x200c00,
1294           .fstr = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:NID:STATE_M:e=0:i=0:t=0:tf=0:cf=0:nf=3",
1295         },
1296         { SRC_LINE,
1297           .name = "snbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID:nf=3:tid=1",
1298           .ret  = PFM_ERR_ATTR,
1299         },
1300         { SRC_LINE,
1301           .name = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE",
1302           .ret  = PFM_ERR_UMASK,
1303         },
1304         { SRC_LINE,
1305           .name = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:WB",
1306           .ret  = PFM_SUCCESS,
1307           .count = 1,
1308           .codes[0] = 0x1035,
1309           .fstr = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:WB:e=0:i=0:t=0:tf=0:cf=0",
1310         },
1311         { SRC_LINE,
1312           .name = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF",
1313           .ret  = PFM_SUCCESS,
1314           .count = 2,
1315           .codes[0] = 0x135,
1316           .codes[1] = 0xca000000,
1317           .fstr = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF:e=0:i=0:t=0:tf=0:cf=0",
1318         },
1319         { SRC_LINE,
1320           .name = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF:nf=1",
1321           .ret  = PFM_ERR_ATTR,
1322         },
1323         { SRC_LINE,
1324           .name = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_OPCODE:OPC_PCIRDCUR:nf=1",
1325           .ret  = PFM_SUCCESS,
1326           .count = 2,
1327           .codes[0] = 0x4135,
1328           .codes[1] = 0xcf000400,
1329           .fstr = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_OPCODE:OPC_PCIRDCUR:e=0:i=0:t=0:tf=0:cf=0:nf=1",
1330         },
1331         { SRC_LINE,
1332           .name = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:OPC_RFO:NID_OPCODE:nf=1",
1333           .ret  = PFM_SUCCESS,
1334           .count = 2,
1335           .codes[0] = 0x4135,
1336           .codes[1] = 0xc0000400,
1337           .fstr = "snbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_OPCODE:OPC_RFO:e=0:i=0:t=0:tf=0:cf=0:nf=1",
1338         },
1339         { SRC_LINE,
1340           .name = "snbep_unc_ha::UNC_H_CLOCKTICKS",
1341           .ret  = PFM_SUCCESS,
1342           .count = 1,
1343           .codes[0] = 0x0,
1344           .fstr = "snbep_unc_ha::UNC_H_CLOCKTICKS:e=0:i=0:t=0",
1345         },
1346         { SRC_LINE,
1347           .name = "snbep_unc_ha::UNC_H_REQUESTS:READS:t=1",
1348           .ret  = PFM_SUCCESS,
1349           .count = 1,
1350           .codes[0] = 0x1000301,
1351           .fstr = "snbep_unc_ha::UNC_H_REQUESTS:READS:e=0:i=0:t=1",
1352         },
1353         { SRC_LINE,
1354           .name = "snbep_unc_imc0::UNC_M_CLOCKTICKS",
1355           .ret  = PFM_SUCCESS,
1356           .count = 1,
1357           .codes[0] = 0xff,
1358           .fstr = "snbep_unc_imc0::UNC_M_CLOCKTICKS",
1359         },
1360         { SRC_LINE,
1361           .name = "snbep_unc_imc0::UNC_M_CLOCKTICKS:t=1",
1362           .ret  = PFM_ERR_ATTR,
1363         },
1364         { SRC_LINE,
1365           .name = "snbep_unc_imc0::UNC_M_CAS_COUNT:RD",
1366           .ret  = PFM_SUCCESS,
1367           .count = 1,
1368           .codes[0] = 0x0304,
1369           .fstr = "snbep_unc_imc0::UNC_M_CAS_COUNT:RD:e=0:i=0:t=0",
1370         },
1371         { SRC_LINE,
1372           .name = "snbep_unc_imc0::UNC_M_POWER_CKE_CYCLES:RANK0",
1373           .ret  = PFM_SUCCESS,
1374           .count = 1,
1375           .codes[0] = 0x183,
1376           .fstr = "snbep_unc_imc0::UNC_M_POWER_CKE_CYCLES:RANK0:e=0:i=0:t=0",
1377         },
1378         { SRC_LINE,
1379           .name = "snbep_unc_imc0::UNC_M_CAS_COUNT:WR",
1380           .ret  = PFM_SUCCESS,
1381           .count = 1,
1382           .codes[0] = 0xc04,
1383           .fstr = "snbep_unc_imc0::UNC_M_CAS_COUNT:WR:e=0:i=0:t=0",
1384         },
1385         { SRC_LINE,
1386           .name = "snbep_unc_pcu::UNC_P_CLOCKTICKS",
1387           .ret  = PFM_SUCCESS,
1388           .count = 1,
1389           .codes[0] = 0x0,
1390           .fstr = "snbep_unc_pcu::UNC_P_CLOCKTICKS:e=0:i=0:t=0",
1391         },
1392         { SRC_LINE,
1393           .name = "snbep_unc_pcu::UNC_P_CLOCKTICKS:t=1",
1394           .ret  = PFM_SUCCESS,
1395           .count = 1,
1396           .codes[0] = 0x1000000,
1397           .fstr = "snbep_unc_pcu::UNC_P_CLOCKTICKS:e=0:i=0:t=1",
1398         },
1399         { SRC_LINE,
1400           .name = "snbep_unc_pcu::UNC_P_CORE0_TRANSITION_CYCLES",
1401           .ret  = PFM_SUCCESS,
1402           .count = 1,
1403           .codes[0] = 0x200003,
1404           .fstr = "snbep_unc_pcu::UNC_P_CORE0_TRANSITION_CYCLES:e=0:i=0:t=0",
1405         },
1406         { SRC_LINE,
1407           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES",
1408           .ret  = PFM_ERR_ATTR,
1409         },
1410         { SRC_LINE,
1411           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND1_CYCLES",
1412           .ret  = PFM_ERR_ATTR,
1413         },
1414         { SRC_LINE,
1415           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND2_CYCLES",
1416           .ret  = PFM_ERR_ATTR,
1417         },
1418         { SRC_LINE,
1419           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND3_CYCLES",
1420           .ret  = PFM_ERR_ATTR,
1421         },
1422         { SRC_LINE,
1423           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32",
1424           .ret  = PFM_SUCCESS,
1425           .count = 2,
1426           .codes[0] = 0xb,
1427           .codes[1] = 0x20,
1428           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=0:i=0:t=0:ff=32",
1429         },
1430         { SRC_LINE,
1431           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND1_CYCLES:ff=16",
1432           .ret  = PFM_SUCCESS,
1433           .count = 2,
1434           .codes[0] = 0xc,
1435           .codes[1] = 0x1000,
1436           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND1_CYCLES:e=0:i=0:t=0:ff=16",
1437         },
1438         { SRC_LINE,
1439           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND2_CYCLES:ff=8",
1440           .ret  = PFM_SUCCESS,
1441           .count = 2,
1442           .codes[0] = 0xd,
1443           .codes[1] = 0x80000,
1444           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND2_CYCLES:e=0:i=0:t=0:ff=8",
1445         },
1446         { SRC_LINE,
1447           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND3_CYCLES:ff=40",
1448           .ret  = PFM_SUCCESS,
1449           .count = 2,
1450           .codes[0] = 0xe,
1451           .codes[1] = 0x28000000,
1452           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND3_CYCLES:e=0:i=0:t=0:ff=40",
1453         },
1454         { SRC_LINE,
1455           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32:e",
1456           .ret  = PFM_SUCCESS,
1457           .count = 2,
1458           .codes[0] = 0x4000b,
1459           .codes[1] = 0x20,
1460           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=1:i=0:t=0:ff=32",
1461         },
1462         { SRC_LINE,
1463           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32:i",
1464           .ret  = PFM_SUCCESS,
1465           .count = 2,
1466           .codes[0] = 0x80000b,
1467           .codes[1] = 0x20,
1468           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=0:i=1:t=0:ff=32",
1469         },
1470         { SRC_LINE,
1471           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32:e:i",
1472           .ret  = PFM_SUCCESS,
1473           .count = 2,
1474           .codes[0] = 0x84000b,
1475           .codes[1] = 0x20,
1476           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=1:i=1:t=0:ff=32",
1477         },
1478         { SRC_LINE,
1479           .name = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32:e:i:t=4",
1480           .ret  = PFM_SUCCESS,
1481           .count = 2,
1482           .codes[0] = 0x484000b,
1483           .codes[1] = 0x20,
1484           .fstr = "snbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=1:i=1:t=4:ff=32",
1485         },
1486         { SRC_LINE,
1487           .name = "SNBEP_UNC_PCU::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0",
1488           .ret  = PFM_SUCCESS,
1489           .count = 1,
1490           .codes[0] = 0x4080,
1491           .fstr = "snbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0:e=0:i=0:t=0"
1492         },
1493         { SRC_LINE,
1494           .name = "SNBEP_UNC_PCU::UNC_P_POWER_STATE_OCCUPANCY:CORES_C3",
1495           .ret  = PFM_SUCCESS,
1496           .count = 1,
1497           .codes[0] = 0x8080,
1498           .fstr = "snbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C3:e=0:i=0:t=0",
1499         },
1500         { SRC_LINE,
1501           .name = "SNBEP_UNC_PCU::UNC_P_POWER_STATE_OCCUPANCY:CORES_C6",
1502           .ret  = PFM_SUCCESS,
1503           .count = 1,
1504           .codes[0] = 0xc080,
1505           .fstr = "snbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C6:e=0:i=0:t=0"
1506         },
1507         { SRC_LINE,
1508           .name = "SNBEP_UNC_PCU::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0:i",
1509           .ret  = PFM_SUCCESS,
1510           .count = 1,
1511           .codes[0] = 0x40004080,
1512           .fstr = "snbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0:e=0:i=1:t=0"
1513         },
1514         { SRC_LINE,
1515           .name = "snbep_unc_qpi0::UNC_Q_CLOCKTICKS",
1516           .ret  = PFM_SUCCESS,
1517           .count = 1,
1518           .codes[0] = 0x14,
1519           .fstr = "snbep_unc_qpi0::UNC_Q_CLOCKTICKS:e=0:i=0:t=0",
1520         },
1521         { SRC_LINE,
1522           .name = "snbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:DATA",
1523           .ret  = PFM_SUCCESS,
1524           .count = 1,
1525           .codes[0] = 0x201,
1526           .fstr = "snbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:DATA:e=0:i=0:t=0",
1527         },
1528         { SRC_LINE,
1529           .name = "snbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:IDLE:t=1:i",
1530           .ret  = PFM_SUCCESS,
1531           .count = 1,
1532           .codes[0] = 0x1800101,
1533           .fstr = "snbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:IDLE:e=0:i=1:t=1",
1534         },
1535         { SRC_LINE,
1536           .name = "snbep_unc_qpi0::UNC_Q_TXL_FLITS_G0:DATA",
1537           .ret  = PFM_SUCCESS,
1538           .count = 1,
1539           .codes[0] = 0x200,
1540           .fstr = "snbep_unc_qpi0::UNC_Q_TXL_FLITS_G0:DATA:e=0:i=0:t=0",
1541         },
1542         { SRC_LINE,
1543           .name = "snbep_unc_qpi0::UNC_Q_RXL_FLITS_G1:HOM",
1544           .ret  = PFM_SUCCESS,
1545           .count = 1,
1546           .codes[0] = 0x200602,
1547           .fstr = "snbep_unc_qpi0::UNC_Q_RXL_FLITS_G1:HOM:e=0:i=0:t=0",
1548         },
1549         { SRC_LINE,
1550           .name = "snbep_unc_qpi0::UNC_Q_TXL_FLITS_G1:HOM",
1551           .ret  = PFM_SUCCESS,
1552           .count = 1,
1553           .codes[0] = 0x200600,
1554           .fstr = "snbep_unc_qpi0::UNC_Q_TXL_FLITS_G1:HOM:e=0:i=0:t=0",
1555         },
1556         { SRC_LINE,
1557           .name = "snbep_unc_ubo::UNC_U_LOCK_CYCLES",
1558           .ret  = PFM_SUCCESS,
1559           .count = 1,
1560           .codes[0] = 0x44,
1561           .fstr = "snbep_unc_ubo::UNC_U_LOCK_CYCLES:e=0:i=0:t=0",
1562         },
1563         { SRC_LINE,
1564           .name = "snbep_unc_r2pcie::UNC_R2_CLOCKTICKS",
1565           .ret  = PFM_SUCCESS,
1566           .count = 1,
1567           .codes[0] = 0x1,
1568           .fstr = "snbep_unc_r2pcie::UNC_R2_CLOCKTICKS:e=0:i=0:t=0",
1569         },
1570         { SRC_LINE,
1571           .name = "snbep_unc_r2pcie::UNC_R2_RING_AD_USED:ANY",
1572           .ret  = PFM_SUCCESS,
1573           .count = 1,
1574           .codes[0] = 0xf07,
1575           .fstr = "snbep_unc_r2pcie::UNC_R2_RING_AD_USED:ANY:e=0:i=0:t=0",
1576         },
1577         { SRC_LINE,
1578           .name = "snbep_unc_r3qpi0::UNC_R3_CLOCKTICKS",
1579           .ret  = PFM_SUCCESS,
1580           .count = 1,
1581           .codes[0] = 0x1,
1582           .fstr = "snbep_unc_r3qpi0::UNC_R3_CLOCKTICKS:e=0:i=0:t=0",
1583         },
1584         { SRC_LINE,
1585           .name = "snbep_unc_r3qpi0::UNC_R3_TXR_CYCLES_FULL:e=0:i=0:t=0",
1586           .ret  = PFM_SUCCESS,
1587           .count = 1,
1588           .codes[0] = 0x25,
1589           .fstr = "snbep_unc_r3qpi0::UNC_R3_TXR_CYCLES_FULL:e=0:i=0:t=0",
1590         },
1591         { SRC_LINE,
1592           .name = "snbep_unc_r3qpi1::UNC_R3_CLOCKTICKS",
1593           .ret  = PFM_SUCCESS,
1594           .count = 1,
1595           .codes[0] = 0x1,
1596           .fstr = "snbep_unc_r3qpi1::UNC_R3_CLOCKTICKS:e=0:i=0:t=0",
1597         },
1598         { SRC_LINE,
1599           .name = "snbep_unc_r3qpi1::UNC_R3_TXR_CYCLES_FULL:e=0:i=0:t=0",
1600           .ret  = PFM_SUCCESS,
1601           .count = 1,
1602           .codes[0] = 0x25,
1603           .fstr = "snbep_unc_r3qpi1::UNC_R3_TXR_CYCLES_FULL:e=0:i=0:t=0",
1604         },
1605         { SRC_LINE,
1606           .name = "knc::cpu_clk_unhalted",
1607           .ret  = PFM_SUCCESS,
1608           .count = 1,
1609           .codes[0] = 0x53002a,
1610           .fstr = "knc::CPU_CLK_UNHALTED:k=1:u=1:e=0:i=0:c=0:t=0",
1611         },
1612         { SRC_LINE,
1613           .name = "knc::instructions_executed",
1614           .ret  = PFM_SUCCESS,
1615           .count = 1,
1616           .codes[0] = 0x530016,
1617           .fstr = "knc::INSTRUCTIONS_EXECUTED:k=1:u=1:e=0:i=0:c=0:t=0",
1618         },
1619         { SRC_LINE,
1620           .name = "knc::vpu_data_read",
1621           .ret  = PFM_SUCCESS,
1622           .count = 1,
1623           .codes[0] = 0x532000,
1624           .fstr = "knc::VPU_DATA_READ:k=1:u=1:e=0:i=0:c=0:t=0",
1625         },
1626         { SRC_LINE,
1627           .name = "knc::vpu_data_read:t:c=1:i",
1628           .ret  = PFM_SUCCESS,
1629           .count = 1,
1630           .codes[0] = 0x1f32000,
1631           .fstr = "knc::VPU_DATA_READ:k=1:u=1:e=0:i=1:c=1:t=1",
1632         },
1633         { SRC_LINE,
1634           .name = "snb_ep::cpl_cycles:ring0_trans:u",
1635           .ret  = PFM_SUCCESS,
1636           .count = 1,
1637           .codes[0] = 0x155015c,
1638           .fstr = "snb_ep::CPL_CYCLES:RING0:k=0:u=1:e=1:i=0:c=1:t=0",
1639         },
1640         { SRC_LINE,
1641           .name = "snb_ep::cpl_cycles:ring0_trans:e=1",
1642           .ret  = PFM_SUCCESS,
1643           .count = 1,
1644           .codes[0] = 0x157015cull,
1645         },
1646         { SRC_LINE,
1647           .name = "snb_ep::OFFCORE_REQUESTS_OUTSTanding:ALL_DATA_RD_CYCLES",
1648           .ret  = PFM_SUCCESS,
1649           .count = 1,
1650           .codes[0] = 0x1530860,
1651           .fstr = "snb_ep::OFFCORE_REQUESTS_OUTSTANDING:ALL_DATA_RD:k=1:u=1:e=0:i=0:c=1:t=0",
1652         },
1653         { SRC_LINE,
1654           .name = "snb_ep::uops_issued:core_stall_cycles:u:k",
1655           .ret  = PFM_SUCCESS,
1656           .count = 1,
1657           .codes[0] = 0x1f3010e,
1658           .fstr = "snb_ep::UOPS_ISSUED:ANY:k=1:u=1:e=0:i=1:c=1:t=1",
1659         },
1660         { SRC_LINE,
1661           .name = "snb_ep::LLC_REFERences:k:t=1",
1662           .ret  = PFM_SUCCESS,
1663           .count = 1,
1664           .codes[0] = 0x724f2e,
1665           .fstr = "snb_ep::LAST_LEVEL_CACHE_REFERENCES:k=1:u=0:e=0:i=0:c=0:t=1",
1666         },
1667         { SRC_LINE,
1668           .name = "snb_ep::ITLB:0x1",
1669           .ret  = PFM_SUCCESS,
1670           .count = 1,
1671           .codes[0] = 0x5301ae,
1672           .fstr = "snb_ep::ITLB:0x1:k=1:u=1:e=0:i=0:c=0:t=0",
1673         },
1674         { SRC_LINE,
1675           .name = "snb_ep::mem_load_uops_llc_miss_retired:local_dram",
1676           .ret  = PFM_SUCCESS,
1677           .count = 1,
1678           .codes[0] = 0x5301d3,
1679           .fstr = "snb_ep::MEM_LOAD_UOPS_LLC_MISS_RETIRED:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
1680         },
1681         { SRC_LINE,
1682           .name = "snb_ep::mem_load_uops_llc_miss_retired:remote_dram",
1683           .ret  = PFM_SUCCESS,
1684           .count = 1,
1685           .codes[0] = 0x5304d3,
1686           .fstr = "snb_ep::MEM_LOAD_UOPS_LLC_MISS_RETIRED:REMOTE_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
1687         },
1688         { SRC_LINE,
1689           .name = "snb_ep::offcore_response_0:DMND_RFO:ANY_RESPONSE",
1690           .ret  = PFM_SUCCESS,
1691           .count = 2,
1692           .codes[0] = 0x5301b7,
1693           .codes[1] = 0x10002,
1694           .fstr = "snb_ep::OFFCORE_RESPONSE_0:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
1695         },
1696         { SRC_LINE,
1697           .name = "snb_ep::offcore_response_0:DMND_RFO:ANY_REQUEST",
1698           .count = 2,
1699           .codes[0] = 0x5301b7,
1700           .codes[1] = 0x18fff,
1701         },
1702         { SRC_LINE,
1703           .name = "snb_ep::offcore_response_0:DMND_RFO",
1704           .count = 2,
1705           .codes[0] = 0x5301b7,
1706           .codes[1] = 0x10002,
1707           .fstr = "snb_ep::OFFCORE_RESPONSE_0:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
1708         },
1709         { SRC_LINE,
1710           .name = "snb_ep::offcore_response_0:any_response",
1711           .count = 2,
1712           .codes[0] = 0x5301b7,
1713           .codes[1] = 0x18fff,
1714           .fstr = "snb_ep::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
1715         },
1716         { SRC_LINE,
1717           .name = "snb_ep::offcore_response_0:NO_SUPP:SNP_NONE:PF_RFO:PF_IFETCH",
1718           .count = 2,
1719           .codes[0] = 0x5301b7,
1720           .codes[1] = 0x80020060,
1721           .fstr = "snb_ep::OFFCORE_RESPONSE_0:PF_RFO:PF_IFETCH:NO_SUPP:SNP_NONE:k=1:u=1:e=0:i=0:c=0:t=0",
1722         },
1723         { SRC_LINE,
1724           .name = "snb_ep::offcore_response_1:DMND_RFO:ANY_RESPONSE",
1725           .ret  = PFM_SUCCESS,
1726           .count = 2,
1727           .codes[0] = 0x5301bb,
1728           .codes[1] = 0x10002,
1729           .fstr = "snb_ep::OFFCORE_RESPONSE_1:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
1730         },
1731         { SRC_LINE,
1732           .name = "snb_ep::offcore_response_1:DMND_RFO:ANY_REQUEST",
1733           .count = 2,
1734           .codes[0] = 0x5301bb,
1735           .codes[1] = 0x18fff,
1736         },
1737         { SRC_LINE,
1738           .name = "snb_ep::offcore_response_1:DMND_RFO",
1739           .count = 2,
1740           .codes[0] = 0x5301bb,
1741           .codes[1] = 0x10002,
1742           .fstr = "snb_ep::OFFCORE_RESPONSE_1:DMND_RFO:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
1743         },
1744         { SRC_LINE,
1745           .name = "snb_ep::offcore_response_1:any_response",
1746           .count = 2,
1747           .codes[0] = 0x5301bb,
1748           .codes[1] = 0x18fff,
1749           .fstr = "snb_ep::OFFCORE_RESPONSE_1:ANY_REQUEST:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0",
1750         },
1751         { SRC_LINE,
1752           .name = "snb_ep::offcore_response_1:NO_SUPP:SNP_NONE:PF_RFO:PF_IFETCH",
1753           .count = 2,
1754           .codes[0] = 0x5301bb,
1755           .codes[1] = 0x80020060,
1756           .fstr = "snb_ep::OFFCORE_RESPONSE_1:PF_RFO:PF_IFETCH:NO_SUPP:SNP_NONE:k=1:u=1:e=0:i=0:c=0:t=0",
1757         },
1758         { SRC_LINE,
1759           .name = "snb_ep::offcore_response_1:ANY_REQUEST:LLC_MISS_LOCAL_DRAM",
1760           .count = 2,
1761           .codes[0] = 0x5301bb,
1762           .codes[1] = 0x3f80408fffull,
1763           .fstr = "snb_ep::OFFCORE_RESPONSE_1:DMND_DATA_RD:DMND_RFO:DMND_IFETCH:WB:PF_DATA_RD:PF_RFO:PF_IFETCH:PF_LLC_DATA_RD:PF_LLC_RFO:PF_LLC_IFETCH:BUS_LOCKS:STRM_ST:OTHER:LLC_MISS_LOCAL_DRAM:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0",
1764         },
1765         { SRC_LINE,
1766           .name = "snb_ep::offcore_response_1:ANY_REQUEST:LLC_MISS_REMOTE_DRAM",
1767           .count = 2,
1768           .codes[0] = 0x5301bb,
1769           .codes[1] = 0x3fff808fffull,
1770           .fstr = "snb_ep::OFFCORE_RESPONSE_1:DMND_DATA_RD:DMND_RFO:DMND_IFETCH:WB:PF_DATA_RD:PF_RFO:PF_IFETCH:PF_LLC_DATA_RD:PF_LLC_RFO:PF_LLC_IFETCH:BUS_LOCKS:STRM_ST:OTHER:LLC_MISS_REMOTE_DRAM:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0",
1771         },
1772         { SRC_LINE,
1773           .name = "snb_ep::mem_trans_retired:latency_above_threshold",
1774           .ret = PFM_SUCCESS,
1775           .count = 2,
1776           .codes[0]=0x5301cd,
1777           .codes[1] = 3,
1778           .fstr = "snb_ep::MEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1779         },
1780         { SRC_LINE,
1781           .name = "snb_ep::mem_trans_retired:latency_above_threshold:ldlat=2",
1782           .ret = PFM_ERR_ATTR_VAL,
1783         },
1784         { SRC_LINE,
1785           .name = "snb_ep::mem_trans_retired:latency_above_threshold:ldlat=3",
1786           .ret = PFM_SUCCESS,
1787           .count = 2,
1788           .codes[0]=0x5301cd,
1789           .codes[1] = 3,
1790           .fstr = "snb_ep::MEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1791         },
1792         { SRC_LINE,
1793           .name = "snb_ep::mem_trans_retired:latency_above_threshold:ldlat=1000000",
1794           .ret = PFM_ERR_ATTR_VAL,
1795         },
1796         { SRC_LINE,
1797           .name = "snb::mem_trans_retired:latency_above_threshold",
1798           .ret = PFM_SUCCESS,
1799           .count = 2,
1800           .codes[0] = 0x5301cd,
1801           .codes[1] = 3,
1802           .fstr = "snb::MEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1803         },
1804         { SRC_LINE,
1805           .name = "snb::mem_trans_retired:latency_above_threshold:ldlat=2",
1806           .ret = PFM_ERR_ATTR_VAL,
1807         },
1808         { SRC_LINE,
1809           .name = "snb::mem_trans_retired:latency_above_threshold:ldlat=3",
1810           .ret = PFM_SUCCESS,
1811           .count = 2,
1812           .codes[0] = 0x5301cd,
1813           .codes[1] = 3,
1814           .fstr = "snb::MEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1815         },
1816         { SRC_LINE,
1817           .name = "snb::mem_trans_retired:latency_above_threshold:ldlat=1000000",
1818           .ret = PFM_ERR_ATTR_VAL,
1819         },
1820         { SRC_LINE,
1821           .name = "ivb::mem_trans_retired:latency_above_threshold",
1822           .ret = PFM_SUCCESS,
1823           .count = 2,
1824           .codes[0] = 0x5301cd,
1825           .codes[1] = 3,
1826           .fstr = "ivb::MEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1827         },
1828         { SRC_LINE,
1829           .name = "ivb::mem_trans_retired:latency_above_threshold:ldlat=2",
1830           .ret = PFM_ERR_ATTR_VAL,
1831         },
1832         { SRC_LINE,
1833           .name = "ivb::mem_trans_retired:latency_above_threshold:ldlat=3:u",
1834           .ret = PFM_SUCCESS,
1835           .count = 2,
1836           .codes[0] = 0x5101cd,
1837           .codes[1] = 3,
1838           .fstr = "ivb::MEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLD:k=0:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1839         },
1840         { SRC_LINE,
1841           .name = "ivb::mem_trans_retired:latency_above_threshold:ldlat=1000000",
1842           .ret = PFM_ERR_ATTR_VAL,
1843         },
1844         { SRC_LINE,
1845           .name = "nhm::mem_inst_retired:latency_above_threshold",
1846           .ret = PFM_SUCCESS,
1847           .count = 2,
1848           .codes[0] = 0x53100b,
1849           .codes[1] = 3,
1850           .fstr = "nhm::MEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1851         },
1852         { SRC_LINE,
1853           .name = "nhm::mem_inst_retired:latency_above_threshold:ldlat=2",
1854           .ret = PFM_ERR_ATTR_VAL,
1855         },
1856         { SRC_LINE,
1857           .name = "nhm::mem_inst_retired:latency_above_threshold:ldlat=3",
1858           .ret = PFM_SUCCESS,
1859           .count = 2,
1860           .codes[0] = 0x53100b,
1861           .codes[1] = 3,
1862           .fstr = "nhm::MEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1863         },
1864         { SRC_LINE,
1865           .name = "nhm::mem_inst_retired:latency_above_threshold:ldlat=1000000",
1866           .ret = PFM_ERR_ATTR_VAL,
1867         },
1868         { SRC_LINE,
1869           .name = "wsm::mem_inst_retired:latency_above_threshold",
1870           .ret = PFM_SUCCESS,
1871           .count = 2,
1872           .codes[0] = 0x53100b,
1873           .codes[1] = 3,
1874           .fstr = "wsm::MEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1875         },
1876         { SRC_LINE,
1877           .name = "wsm::mem_inst_retired:latency_above_threshold:ldlat=2",
1878           .ret = PFM_ERR_ATTR_VAL,
1879         },
1880         { SRC_LINE,
1881           .name = "wsm::mem_inst_retired:latency_above_threshold:ldlat=3",
1882           .ret = PFM_SUCCESS,
1883           .count = 2,
1884           .codes[0] = 0x53100b,
1885           .codes[1] = 3,
1886           .fstr = "wsm::MEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLD:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3",
1887         },
1888         { SRC_LINE,
1889           .name = "wsm::mem_inst_retired:latency_above_threshold:ldlat=1000000",
1890           .ret = PFM_ERR_ATTR_VAL,
1891         },
1892         { SRC_LINE,
1893           .name = "amd64_fam15h_interlagos::LINK_TRANSMIT_BANDWIDTH_LINK_0:NOP_DW_SENT",
1894           .ret = PFM_ERR_NOTFOUND, /* event in Northbridge PMU */
1895         },
1896         { SRC_LINE,
1897           .name = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:NOP_DW_SENT",
1898           .ret = PFM_SUCCESS,
1899           .count = 1,
1900           .codes[0] = 0x5308f6,
1901           .fstr = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:NOP_DW_SENT:SUBLINK_0",
1902         },
1903         { SRC_LINE,
1904           .name = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:ALL",
1905           .ret = PFM_SUCCESS,
1906           .count = 1,
1907           .codes[0] = 0x533ff6,
1908           .fstr = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:ALL:SUBLINK_0",
1909         },
1910         { SRC_LINE,
1911           .name = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:ALL:SUBLINK_1",
1912           .ret = PFM_SUCCESS,
1913           .count = 1,
1914           .codes[0] = 0x53bff6,
1915           .fstr = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:ALL:SUBLINK_1",
1916         },
1917         { SRC_LINE,
1918           .name = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:COMMAND_DW_SENT:DATA_DW_SENT",
1919           .ret = PFM_SUCCESS,
1920           .count = 1,
1921           .codes[0] = 0x5303f6,
1922           .fstr = "amd64_fam15h_nb::LINK_TRANSMIT_BANDWIDTH_LINK_0:COMMAND_DW_SENT:DATA_DW_SENT:SUBLINK_0",
1923         },
1924         { SRC_LINE,
1925           .name = "amd64_fam15h_interlagos::DISPATCHED_FPU_OPS:0x4ff:u",
1926           .ret  = PFM_ERR_ATTR
1927         },
1928         { SRC_LINE,
1929           .name = "amd64_fam15h_interlagos::DISPATCHED_FPU_OPS:0xff:u",
1930           .ret  = PFM_SUCCESS,
1931           .count = 1,
1932           .codes[0] = 0x51ff00ull,
1933           .fstr = "amd64_fam15h_interlagos::DISPATCHED_FPU_OPS:0xff:k=0:u=1:e=0:i=0:c=0:h=0:g=0"
1934         },
1935         { SRC_LINE,
1936           .name = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:read_block_modify:core_3",
1937           .ret  = PFM_SUCCESS,
1938           .count = 1,
1939           .codes[0] = 0x4005334e0ull,
1940           .fstr = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:READ_BLOCK_MODIFY:CORE_3",
1941         },
1942         { SRC_LINE,
1943           .name = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE",
1944           .ret  = PFM_SUCCESS,
1945           .count = 1,
1946           .codes[0] = 0x40053f7e0ull,
1947           .fstr = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:READ_BLOCK_ANY:ANY_CORE",
1948         },
1949         { SRC_LINE,
1950           .name = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:READ_BLOCK_EXCLUSIVE:PREFETCH:READ_BLOCK_MODIFY:core_4",
1951           .ret  = PFM_SUCCESS,
1952           .count = 1,
1953           .codes[0] = 0x400534de0ull,
1954           .fstr = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:READ_BLOCK_EXCLUSIVE:READ_BLOCK_MODIFY:PREFETCH:CORE_4",
1955         },
1956         { SRC_LINE,
1957           .name = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:read_block_any:prefetch:core_1",
1958           .ret  = PFM_ERR_FEATCOMB, /* must use individual umasks to combine with prefetch */
1959         },
1960         { SRC_LINE,
1961           .name = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:read_block_any:prefetch:core_1:core_3",
1962           .ret  = PFM_ERR_FEATCOMB, /* core umasks cannot be combined */
1963         },
1964         { SRC_LINE,
1965           .name = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:prefetch:core_0",
1966           .ret  = PFM_SUCCESS,
1967           .count = 1,
1968           .codes[0] = 0x4005308e0ull,
1969           .fstr = "amd64_fam15h_nb::READ_REQUEST_TO_L3_CACHE:PREFETCH:CORE_0",
1970         },
1971         { SRC_LINE,
1972           .name = "ivb_ep::mem_load_uops_llc_miss_retired:local_dram",
1973           .ret = PFM_SUCCESS,
1974           .count = 1,
1975           .codes[0] = 0x5303d3,
1976           .fstr = "ivb_ep::MEM_LOAD_UOPS_LLC_MISS_RETIRED:LOCAL_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
1977         },
1978         { SRC_LINE,
1979           .name = "ivb_ep::mem_load_uops_llc_miss_retired:remote_dram",
1980           .ret = PFM_SUCCESS,
1981           .count = 1,
1982           .codes[0] = 0x530cd3,
1983           .fstr = "ivb_ep::MEM_LOAD_UOPS_LLC_MISS_RETIRED:REMOTE_DRAM:k=1:u=1:e=0:i=0:c=0:t=0",
1984         },
1985         { SRC_LINE,
1986           .name = "ivb_ep::mem_load_uops_llc_miss_retired:remote_hitm",
1987           .ret = PFM_SUCCESS,
1988           .count = 1,
1989           .codes[0] = 0x5310d3,
1990           .fstr = "ivb_ep::MEM_LOAD_UOPS_LLC_MISS_RETIRED:REMOTE_HITM:k=1:u=1:e=0:i=0:c=0:t=0",
1991         },
1992         { SRC_LINE,
1993           .name = "ivb_ep::mem_load_uops_llc_miss_retired:remote_fwd",
1994           .ret = PFM_SUCCESS,
1995           .count = 1,
1996           .codes[0] = 0x5320d3,
1997           .fstr = "ivb_ep::MEM_LOAD_UOPS_LLC_MISS_RETIRED:REMOTE_FWD:k=1:u=1:e=0:i=0:c=0:t=0",
1998         },
1999         { SRC_LINE,
2000           .name = "ivb::mem_load_uops_llc_miss_retired:remote_dram",
2001           .ret = PFM_ERR_ATTR,
2002         },
2003         { SRC_LINE,
2004           .name = "ivb_ep::offcore_response_0:any_request:LLC_MISS_REMOTE",
2005           .ret = PFM_SUCCESS,
2006           .count = 2,
2007           .codes[0] = 0x5301b7,
2008           .codes[1] = 0x3fff808fffULL,
2009           .fstr = "ivb_ep::OFFCORE_RESPONSE_0:DMND_DATA_RD:DMND_RFO:DMND_IFETCH:WB:PF_DATA_RD:PF_RFO:PF_IFETCH:PF_LLC_DATA_RD:PF_LLC_RFO:PF_LLC_IFETCH:BUS_LOCKS:STRM_ST:OTHER:LLC_MISS_REMOTE_DRAM:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0"
2010         },
2011         { SRC_LINE,
2012           .name = "hsw::mem_trans_retired:latency_above_threshold:ldlat=3:u",
2013           .ret = PFM_SUCCESS,
2014           .count = 2,
2015           .codes[0] = 0x5101cd,
2016           .codes[1] = 3,
2017           .fstr = "hsw::MEM_TRANS_RETIRED:LOAD_LATENCY:k=0:u=1:e=0:i=0:c=0:t=0:ldlat=3:intx=0:intxcp=0",
2018         },
2019         { SRC_LINE,
2020           .name = "hsw::mem_trans_retired:latency_above_threshold:ldlat=1000000",
2021           .ret = PFM_ERR_ATTR_VAL,
2022         },
2023         { SRC_LINE,
2024           .name = "hsw::mem_trans_retired:load_latency",
2025           .ret = PFM_SUCCESS,
2026           .count = 2,
2027           .codes[0] = 0x5301cd,
2028           .codes[1] = 3,
2029           .fstr = "hsw::MEM_TRANS_RETIRED:LOAD_LATENCY:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3:intx=0:intxcp=0",
2030         },
2031         { SRC_LINE,
2032           .name = "hsw::mem_trans_retired:load_latency:ldlat=1000000",
2033           .ret = PFM_ERR_ATTR_VAL,
2034         },
2035         { SRC_LINE,
2036           .name = "hsw::mem_trans_retired:latency_above_threshold:ldlat=2:intx=0:intxcp=0",
2037           .ret = PFM_ERR_ATTR_VAL,
2038         },
2039         { SRC_LINE,
2040           .name = "hsw::inst_Retired:any_p:intx",
2041           .count = 1,
2042           .codes[0] = 0x1005300c0,
2043           .fstr = "hsw::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=1:intxcp=0",
2044         },
2045         { SRC_LINE,
2046           .name = "hsw::inst_Retired:any_p:intx:intxcp",
2047           .count = 1,
2048           .codes[0] = 0x3005300c0,
2049           .fstr = "hsw::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=1:intxcp=1",
2050         },
2051         { SRC_LINE,
2052           .name = "hsw::inst_Retired:any_p:intx=0:intxcp",
2053           .count = 1,
2054           .codes[0] = 0x2005300c0,
2055           .fstr = "hsw::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=1",
2056         },
2057         { SRC_LINE,
2058           .name = "hsw::cycle_activity:cycles_l2_pending",
2059           .ret = PFM_SUCCESS,
2060           .count = 1,
2061           .codes[0] = 0x15301a3,
2062           .fstr = "hsw::CYCLE_ACTIVITY:CYCLES_L2_PENDING:k=1:u=1:e=0:i=0:t=0:intx=0:intxcp=0",
2063         },
2064         { SRC_LINE,
2065           .name = "hsw::cycle_activity:cycles_l2_pending:c=8",
2066           .ret = PFM_ERR_ATTR,
2067         },
2068         { SRC_LINE,
2069           .name = "hsw::hle_retired:aborted",
2070           .ret = PFM_SUCCESS,
2071           .count = 1,
2072           .codes[0] = 0x5304c8,
2073           .fstr = "hsw::HLE_RETIRED:ABORTED:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2074         },
2075         { SRC_LINE,
2076           .name = "hsw::rtm_retired:aborted",
2077           .ret = PFM_SUCCESS,
2078           .count = 1,
2079           .codes[0] = 0x5304c9,
2080           .fstr = "hsw::RTM_RETIRED:ABORTED:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2081         },
2082         { SRC_LINE,
2083           .name = "hsw::offcore_response_0:k:intx=1",
2084           .ret  = PFM_SUCCESS,
2085           .count = 2,
2086           .codes[0] = 0x1005201b7,
2087           .codes[1] = 0x18fff,
2088           .fstr = "hsw::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:k=1:u=0:e=0:i=0:c=0:t=0:intx=1:intxcp=0",
2089         },
2090         { SRC_LINE,
2091           .name = "hsw::offcore_response_0:any_request",
2092           .ret  = PFM_SUCCESS,
2093           .count = 2,
2094           .codes[0] = 0x5301b7,
2095           .codes[1] = 0x18fff,
2096           .fstr = "hsw::OFFCORE_RESPONSE_0:DMND_DATA_RD:DMND_RFO:DMND_CODE_RD:WB:PF_DATA_RD:PF_RFO:PF_CODE_RD:PF_L3_DATA_RD:PF_L3_RFO:PF_L3_CODE_RD:SPLIT_LOCK_UC_LOCK:STRM_ST:OTHER:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2097         },
2098         { SRC_LINE,
2099           .name = "hsw::offcore_response_0:any_request:any_response:L3_MISS_LOCAL",
2100           .ret  = PFM_ERR_FEATCOMB,
2101         },
2102         { SRC_LINE,
2103           .name = "hsw::offcore_response_0:split_lock_uc_lock",
2104           .ret  = PFM_SUCCESS,
2105           .count = 2,
2106           .codes[0] = 0x5301b7,
2107           .codes[1] = 0x10400,
2108           .fstr = "hsw::OFFCORE_RESPONSE_0:SPLIT_LOCK_UC_LOCK:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2109         },
2110         { SRC_LINE,
2111           .name = "hsw::offcore_response_0:any_ifetch",
2112           .ret  = PFM_SUCCESS,
2113           .count = 2,
2114           .codes[0] = 0x5301b7,
2115           .codes[1] = 0x10240,
2116           .fstr = "hsw::OFFCORE_RESPONSE_0:ANY_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2117         },
2118         { SRC_LINE,
2119           .name = "hsw::offcore_response_0:L3_HITF",
2120           .ret  = PFM_ERR_ATTR,
2121         },
2122         { SRC_LINE,
2123           .name = "hsw::offcore_response_0:LLC_MISS_LOCAL",
2124           .ret  = PFM_ERR_ATTR,
2125         },
2126         { SRC_LINE,
2127           .name = "hsw::offcore_response_0:L3_HIT:u",
2128           .ret  = PFM_SUCCESS,
2129           .count = 2,
2130           .codes[0] = 0x5101b7,
2131           .codes[1] = 0x3f801c8fffull,
2132           .fstr = "hsw::OFFCORE_RESPONSE_0:ANY_REQUEST:L3_HITM:L3_HITE:L3_HITS:SNP_ANY:k=0:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2133         },
2134         { SRC_LINE,
2135           .name = "hsw::offcore_response_0:ANY_DATA",
2136           .ret  = PFM_SUCCESS,
2137           .count = 2,
2138           .codes[0] = 0x5301b7,
2139           .codes[1] = 0x10091,
2140           .fstr = "hsw::OFFCORE_RESPONSE_0:DMND_DATA_RD:PF_DATA_RD:PF_L3_DATA_RD:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2141         },
2142         { SRC_LINE,
2143           .name = "hsw::offcore_response_0:DMND_DATA_RD:L3_HITS:SNP_FWD",
2144           .ret  = PFM_SUCCESS,
2145           .count = 2,
2146           .codes[0] = 0x5301b7,
2147           .codes[1] = 0x800100001,
2148           .fstr = "hsw::OFFCORE_RESPONSE_0:DMND_DATA_RD:L3_HITS:SNP_FWD:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2149         },
2150         { SRC_LINE,
2151           .name = "ivb_unc_cbo0::unc_clockticks",
2152           .ret  = PFM_SUCCESS,
2153           .count = 1,
2154           .codes[0] = 0x5000ff,
2155           .fstr = "ivb_unc_cbo0::UNC_CLOCKTICKS",
2156         },
2157         { SRC_LINE,
2158           .name = "ivb_unc_cbo1::unc_clockticks",
2159           .ret  = PFM_ERR_NOTFOUND
2160         },
2161         { SRC_LINE,
2162           .name = "rapl::rapl_energy_cores",
2163           .ret = PFM_SUCCESS,
2164           .count = 1,
2165           .codes[0] = 0x1,
2166           .fstr = "rapl::RAPL_ENERGY_CORES",
2167         },
2168         { SRC_LINE,
2169           .name = "rapl::rapl_energy_pkg",
2170           .ret = PFM_SUCCESS,
2171           .count = 1,
2172           .codes[0] = 0x2,
2173           .fstr = "rapl::RAPL_ENERGY_PKG",
2174         },
2175         { SRC_LINE,
2176           .name = "rapl::rapl_energy_cores:u",
2177           .ret = PFM_ERR_ATTR,
2178         },
2179         { SRC_LINE,
2180           .name = "slm::offcore_response_0:snp_hitm",
2181           .ret = PFM_SUCCESS,
2182           .count = 2,
2183           .codes[0] = 0x5301b7,
2184           .codes[1]=0x100001ffffull,
2185           .fstr = "slm::OFFCORE_RESPONSE_0:ANY_REQUEST:ANY_RESPONSE:SNP_HITM:k=1:u=1:e=0:i=0:c=0",
2186         },
2187         { SRC_LINE,
2188           .name = "slm::offcore_response_0:any_data",
2189           .ret = PFM_SUCCESS,
2190           .count = 2,
2191           .codes[0] = 0x5301b7,
2192           .codes[1]=0x12011,
2193           .fstr = "slm::OFFCORE_RESPONSE_0:DMND_DATA_RD:PF_L2_DATA_RD:PF_L1_DATA_RD:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0",
2194         },
2195         { SRC_LINE,
2196           .name = "slm::offcore_response_0:uc_ifetch",
2197           .ret = PFM_SUCCESS,
2198           .count = 2,
2199           .codes[0] = 0x5301b7,
2200           .codes[1]=0x10200,
2201           .fstr = "slm::OFFCORE_RESPONSE_0:UC_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0",
2202         },
2203         { SRC_LINE,
2204           .name = "slm::offcore_response_0:any_ifetch",
2205           .ret = PFM_SUCCESS,
2206           .count = 2,
2207           .codes[0] = 0x5301b7,
2208           .codes[1]=0x10244,
2209           .fstr = "slm::OFFCORE_RESPONSE_0:DMND_IFETCH:PF_IFETCH:UC_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0",
2210         },
2211         { SRC_LINE,
2212           .name = "slm::offcore_response_1:snp_hitm",
2213           .ret = PFM_SUCCESS,
2214           .count = 2,
2215           .codes[0] = 0x5302b7,
2216           .codes[1]=0x100001ffffull,
2217           .fstr = "slm::OFFCORE_RESPONSE_1:ANY_REQUEST:ANY_RESPONSE:SNP_HITM:k=1:u=1:e=0:i=0:c=0",
2218         },
2219         { SRC_LINE,
2220           .name = "slm::offcore_response_1:any_data",
2221           .ret = PFM_SUCCESS,
2222           .count = 2,
2223           .codes[0] = 0x5302b7,
2224           .codes[1]=0x12011,
2225           .fstr = "slm::OFFCORE_RESPONSE_1:DMND_DATA_RD:PF_L2_DATA_RD:PF_L1_DATA_RD:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0",
2226         },
2227         { SRC_LINE,
2228           .name = "slm::offcore_response_1:uc_ifetch",
2229           .ret = PFM_SUCCESS,
2230           .count = 2,
2231           .codes[0] = 0x5302b7,
2232           .codes[1]=0x10200,
2233           .fstr = "slm::OFFCORE_RESPONSE_1:UC_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0",
2234         },
2235         { SRC_LINE,
2236           .name = "slm::offcore_response_1:any_ifetch",
2237           .ret = PFM_SUCCESS,
2238           .count = 2,
2239           .codes[0] = 0x5302b7,
2240           .codes[1]=0x10244,
2241           .fstr = "slm::OFFCORE_RESPONSE_1:DMND_IFETCH:PF_IFETCH:UC_IFETCH:ANY_RESPONSE:k=1:u=1:e=0:i=0:c=0",
2242         },
2243         { SRC_LINE,
2244           .name = "slm::decode_restriction:predecode_wrong",
2245           .ret = PFM_SUCCESS,
2246           .count = 1,
2247           .codes[0] = 0x5301e9,
2248           .fstr = "slm::DECODE_RESTRICTION:PREDECODE_WRONG:k=1:u=1:e=0:i=0:c=0",
2249         },
2250         { SRC_LINE,
2251           .name = "slm::rs_full_stall:fpc_port0",
2252           .ret = PFM_SUCCESS,
2253           .count = 1,
2254           .codes[0] = 0x5308cb,
2255           .fstr = "slm::RS_FULL_STALL:FPC_PORT0:k=1:u=1:e=0:i=0:c=0",
2256         },
2257         { SRC_LINE,
2258           .name = "slm::no_alloc_cycles:any",
2259           .ret = PFM_SUCCESS,
2260           .count = 1,
2261           .codes[0] = 0x533fca,
2262           .fstr = "slm::NO_ALLOC_CYCLES:ANY:k=1:u=1:e=0:i=0:c=0",
2263         },
2264         { SRC_LINE,
2265           .name = "slm::no_alloc_cycles:any:t=1",
2266           .ret = PFM_ERR_ATTR
2267         },
2268         { SRC_LINE,
2269           .name = "ivbep_unc_irp::unc_i_clockticks",
2270           .ret  = PFM_SUCCESS,
2271           .count = 1,
2272           .codes[0] = 0x0,
2273           .fstr = "ivbep_unc_irp::UNC_I_CLOCKTICKS:e=0:t=0",
2274         },
2275         { SRC_LINE,
2276           .name = "ivbep_unc_irp::unc_i_tickles:lost_ownership",
2277           .ret  = PFM_SUCCESS,
2278           .count = 1,
2279           .codes[0] = 0x116,
2280           .fstr = "ivbep_unc_irp::UNC_I_TICKLES:LOST_OWNERSHIP:e=0:t=0",
2281         },
2282         { SRC_LINE,
2283           .name = "ivbep_unc_irp::unc_i_transactions:reads",
2284           .ret  = PFM_SUCCESS,
2285           .count = 1,
2286           .codes[0] = 0x115,
2287           .fstr = "ivbep_unc_irp::UNC_I_TRANSACTIONS:READS:e=0:t=0",
2288         },
2289         { SRC_LINE,
2290           .name = "ivbep_unc_irp::unc_i_transactions:reads:c=1:i",
2291           .ret  = PFM_ERR_ATTR,
2292         },
2293         { SRC_LINE,
2294           .name = "ivbep_unc_irp::unc_i_transactions:reads:t=6",
2295           .ret  = PFM_SUCCESS,
2296           .count = 1,
2297           .codes[0] = 0x6000115,
2298           .fstr = "ivbep_unc_irp::UNC_I_TRANSACTIONS:READS:e=0:t=6",
2299         },
2300         { SRC_LINE,
2301           .name = "ivbep_unc_cbo1::UNC_C_CLOCKTICKS:u",
2302           .ret  = PFM_ERR_ATTR,
2303         },
2304         { SRC_LINE,
2305           .name = "ivbep_unc_cbo0::UNC_C_CLOCKTICKS",
2306           .ret  = PFM_SUCCESS,
2307           .count = 1,
2308           .codes[0] = 0x00,
2309           .fstr = "ivbep_unc_cbo0::UNC_C_CLOCKTICKS",
2310         },
2311         { SRC_LINE,
2312           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ",
2313           .ret  = PFM_SUCCESS,
2314           .count = 2,
2315           .codes[0] = 0x334,
2316           .codes[1] = 0x7e0000,
2317           .fstr = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:STATE_MESIF:e=0:t=0:tf=0:cf=0",
2318         },
2319         { SRC_LINE,
2320           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:nf=1",
2321           .ret  = PFM_ERR_ATTR,
2322         },
2323         { SRC_LINE,
2324           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP",
2325           .ret  = PFM_SUCCESS,
2326           .count = 2,
2327           .codes[0] = 0x1134,
2328           .codes[1] = 0x7e0000,
2329           .fstr = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:ANY:STATE_MESIF:e=0:t=0:tf=0:cf=0",
2330         },
2331         { SRC_LINE,
2332           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID:STATE_M",
2333           .ret  = PFM_ERR_ATTR,
2334         },
2335         { SRC_LINE,
2336           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID:nf=3",
2337           .ret  = PFM_SUCCESS,
2338           .count = 3,
2339           .codes[0] = 0x5134,
2340           .codes[1] = 0x7e0000,
2341           .codes[2] = 0x3,
2342           .fstr = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:ANY:NID:STATE_MESIF:e=0:t=0:tf=0:cf=0:nf=3",
2343         },
2344         { SRC_LINE,
2345           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:NID:STATE_M:tid=1",
2346           .ret  = PFM_ERR_ATTR,
2347         },
2348         { SRC_LINE,
2349           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:DATA_READ:WRITE",
2350           .ret  = PFM_ERR_FEATCOMB,
2351         },
2352         { SRC_LINE,
2353           .name = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:WRITE:NID:nf=3:tf=1:e:t=1",
2354           .ret  = PFM_SUCCESS,
2355           .count = 3,
2356           .codes[0] = 0x10c4534,
2357           .codes[1] = 0x7e0001,
2358           .codes[2] = 0x3,
2359           .fstr = "ivbep_unc_cbo0::UNC_C_LLC_LOOKUP:WRITE:NID:STATE_MESIF:e=1:t=1:tf=1:cf=0:nf=3",
2360         },
2361         { SRC_LINE,
2362           .name = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS",
2363           .ret  = PFM_ERR_UMASK,
2364         },
2365         { SRC_LINE,
2366           .name = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:NID",
2367           .ret  = PFM_ERR_UMASK,
2368         },
2369         { SRC_LINE,
2370           .name = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:NID:nf=1",
2371           .ret  = PFM_ERR_UMASK,
2372         },
2373         { SRC_LINE,
2374           .name = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:STATE_M",
2375           .ret  = PFM_SUCCESS,
2376           .count = 1,
2377           .codes[0] = 0x137,
2378           .fstr = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:STATE_M:e=0:t=0:tf=0:cf=0",
2379         },
2380         { SRC_LINE,
2381           .name = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:STATE_M:STATE_S",
2382           .ret  = PFM_SUCCESS,
2383           .count = 1,
2384           .codes[0] = 0x537,
2385           .fstr = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:STATE_M:STATE_S:e=0:t=0:tf=0:cf=0",
2386         },
2387         { SRC_LINE,
2388           .name = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:STATE_M:STATE_S:NID:nf=1",
2389           .ret  = PFM_SUCCESS,
2390           .count = 3,
2391           .codes[0] = 0x4537,
2392           .codes[1] = 0x0,
2393           .codes[2] = 0x1,
2394           .fstr = "ivbep_unc_cbo0::UNC_C_LLC_VICTIMS:STATE_M:STATE_S:NID:e=0:t=0:tf=0:cf=0:nf=1",
2395         },
2396         { SRC_LINE,
2397           .name = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE",
2398           .ret  = PFM_ERR_UMASK,
2399         },
2400         { SRC_LINE,
2401           .name = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:WB",
2402           .ret  = PFM_SUCCESS,
2403           .count = 1,
2404           .codes[0] = 0x1035,
2405           .fstr = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:WB:e=0:t=0:tf=0:cf=0:isoc=0:nc=0",
2406         },
2407         { SRC_LINE,
2408           .name = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF",
2409           .ret  = PFM_SUCCESS,
2410           .count = 3,
2411           .codes[0] = 0x135,
2412           .codes[1] = 0x0,
2413           .codes[2] = 0x19400000ull,
2414           .fstr = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF:e=0:t=0:tf=0:cf=0:isoc=0:nc=0",
2415         },
2416         { SRC_LINE,
2417           .name = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF:isoc=1",
2418           .ret  = PFM_SUCCESS,
2419           .count = 3,
2420           .codes[0] = 0x135,
2421           .codes[1] = 0x0,
2422           .codes[2] = 0x99400000ull,
2423           .fstr = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF:e=0:t=0:tf=0:cf=0:isoc=1:nc=0",
2424         },
2425         { SRC_LINE,
2426           .name = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:OPCODE:OPC_PCIWILF:nf=1",
2427           .ret  = PFM_ERR_ATTR,
2428         },
2429         { SRC_LINE,
2430           .name = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_OPCODE:OPC_PCIRDCUR:nf=1",
2431           .ret  = PFM_SUCCESS,
2432           .count = 3,
2433           .codes[0] = 0x4135,
2434           .codes[1] = 0x0,
2435           .codes[2] = 0x19e00001ull,
2436           .fstr = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_OPCODE:OPC_PCIRDCUR:e=0:t=0:tf=0:cf=0:nf=1:isoc=0:nc=0",
2437         },
2438         { SRC_LINE,
2439           .name = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:OPC_RFO:NID_OPCODE:nf=1",
2440           .ret  = PFM_SUCCESS,
2441           .count = 3,
2442           .codes[0] = 0x4135,
2443           .codes[1] = 0x0,
2444           .codes[2] = 0x18000001ull,
2445           .fstr = "ivbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_OPCODE:OPC_RFO:e=0:t=0:tf=0:cf=0:nf=1:isoc=0:nc=0",
2446         },
2447         { SRC_LINE,
2448           .name = "ivbep_unc_cbo0::UNC_C_TOR_OCCUPANCY:MISS_REMOTE",
2449           .ret  = PFM_SUCCESS,
2450           .count = 1,
2451           .codes[0] = 0x8a36,
2452           .fstr = "ivbep_unc_cbo0::UNC_C_TOR_OCCUPANCY:MISS_REMOTE:e=0:t=0:tf=0:cf=0:isoc=0:nc=0",
2453         },
2454         { SRC_LINE,
2455           .name = "ivbep_unc_pcu::UNC_P_CLOCKTICKS",
2456           .ret  = PFM_SUCCESS,
2457           .count = 1,
2458           .codes[0] = 0x0,
2459           .fstr = "ivbep_unc_pcu::UNC_P_CLOCKTICKS:e=0:t=0",
2460         },
2461         { SRC_LINE,
2462           .name = "ivbep_unc_pcu::UNC_P_CLOCKTICKS:t=1",
2463           .ret  = PFM_SUCCESS,
2464           .count = 1,
2465           .codes[0] = 0x1000000,
2466           .fstr = "ivbep_unc_pcu::UNC_P_CLOCKTICKS:e=0:t=1",
2467         },
2468         { SRC_LINE,
2469           .name = "ivbep_unc_pcu::UNC_P_CORE0_TRANSITION_CYCLES",
2470           .ret  = PFM_SUCCESS,
2471           .count = 1,
2472           .codes[0] = 0x70,
2473           .fstr = "ivbep_unc_pcu::UNC_P_CORE0_TRANSITION_CYCLES:e=0:t=0",
2474         },
2475         { SRC_LINE,
2476           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES",
2477           .ret  = PFM_ERR_ATTR,
2478         },
2479         { SRC_LINE,
2480           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND1_CYCLES",
2481           .ret  = PFM_ERR_ATTR,
2482         },
2483         { SRC_LINE,
2484           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND2_CYCLES",
2485           .ret  = PFM_ERR_ATTR,
2486         },
2487         { SRC_LINE,
2488           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND3_CYCLES",
2489           .ret  = PFM_ERR_ATTR,
2490         },
2491         { SRC_LINE,
2492           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32",
2493           .ret  = PFM_SUCCESS,
2494           .count = 2,
2495           .codes[0] = 0xb,
2496           .codes[1] = 0x20,
2497           .fstr = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=0:t=0:ff=32",
2498         },
2499         { SRC_LINE,
2500           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND1_CYCLES:ff=16",
2501           .ret  = PFM_SUCCESS,
2502           .count = 2,
2503           .codes[0] = 0xc,
2504           .codes[1] = 0x1000,
2505           .fstr = "ivbep_unc_pcu::UNC_P_FREQ_BAND1_CYCLES:e=0:t=0:ff=16",
2506         },
2507         { SRC_LINE,
2508           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND2_CYCLES:ff=8",
2509           .ret  = PFM_SUCCESS,
2510           .count = 2,
2511           .codes[0] = 0xd,
2512           .codes[1] = 0x80000,
2513           .fstr = "ivbep_unc_pcu::UNC_P_FREQ_BAND2_CYCLES:e=0:t=0:ff=8",
2514         },
2515         { SRC_LINE,
2516           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND3_CYCLES:ff=40",
2517           .ret  = PFM_SUCCESS,
2518           .count = 2,
2519           .codes[0] = 0xe,
2520           .codes[1] = 0x28000000,
2521           .fstr = "ivbep_unc_pcu::UNC_P_FREQ_BAND3_CYCLES:e=0:t=0:ff=40",
2522         },
2523         { SRC_LINE,
2524           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32:e",
2525           .ret  = PFM_SUCCESS,
2526           .count = 2,
2527           .codes[0] = 0x4000b,
2528           .codes[1] = 0x20,
2529           .fstr = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=1:t=0:ff=32",
2530         },
2531         { SRC_LINE,
2532           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32:t=24",
2533           .ret  = PFM_SUCCESS,
2534           .count = 2,
2535           .codes[0] = 0x1800000b,
2536           .codes[1] = 0x20,
2537           .fstr = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=0:t=24:ff=32",
2538         },
2539         { SRC_LINE,
2540           .name = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:ff=32:e:t=4",
2541           .ret  = PFM_SUCCESS,
2542           .count = 2,
2543           .codes[0] = 0x404000b,
2544           .codes[1] = 0x20,
2545           .fstr = "ivbep_unc_pcu::UNC_P_FREQ_BAND0_CYCLES:e=1:t=4:ff=32",
2546         },
2547         { SRC_LINE,
2548           .name = "ivbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0",
2549           .ret  = PFM_SUCCESS,
2550           .count = 1,
2551           .codes[0] = 0x4080,
2552           .fstr = "ivbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0:e=0:t=0"
2553         },
2554         { SRC_LINE,
2555           .name = "ivbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C3",
2556           .ret  = PFM_SUCCESS,
2557           .count = 1,
2558           .codes[0] = 0x8080,
2559           .fstr = "ivbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C3:e=0:t=0",
2560         },
2561         { SRC_LINE,
2562           .name = "IVBEP_UNC_PCU::UNC_P_POWER_STATE_OCCUPANCY:CORES_C6",
2563           .ret  = PFM_SUCCESS,
2564           .count = 1,
2565           .codes[0] = 0xc080,
2566           .fstr = "ivbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C6:e=0:t=0"
2567         },
2568         { SRC_LINE,
2569           .name = "IVBEP_UNC_PCU::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0:t=6",
2570           .ret  = PFM_SUCCESS,
2571           .count = 1,
2572           .codes[0] = 0x6004080,
2573           .fstr = "ivbep_unc_pcu::UNC_P_POWER_STATE_OCCUPANCY:CORES_C0:e=0:t=6"
2574         },
2575         { SRC_LINE,
2576           .name = "ivbep_unc_pcu::UNC_P_DEMOTIONS_CORE10",
2577           .ret  = PFM_SUCCESS,
2578           .count = 1,
2579           .codes[0] = 0x42,
2580           .fstr = "ivbep_unc_pcu::UNC_P_DEMOTIONS_CORE10:e=0:t=0",
2581         },
2582         { SRC_LINE,
2583           .name = "ivbep_unc_pcu::UNC_P_DEMOTIONS_CORE14",
2584           .ret  = PFM_SUCCESS,
2585           .count = 1,
2586           .codes[0] = 0x46,
2587           .fstr = "ivbep_unc_pcu::UNC_P_DEMOTIONS_CORE14:e=0:t=0",
2588         },
2589         { SRC_LINE,
2590           .name = "ivbep_unc_ha0::UNC_H_CLOCKTICKS",
2591           .ret  = PFM_SUCCESS,
2592           .count = 1,
2593           .codes[0] = 0x0,
2594           .fstr = "ivbep_unc_ha0::UNC_H_CLOCKTICKS:e=0:t=0",
2595         },
2596         { SRC_LINE,
2597           .name = "ivbep_unc_ha1::UNC_H_CLOCKTICKS",
2598           .ret  = PFM_SUCCESS,
2599           .count = 1,
2600           .codes[0] = 0x0,
2601           .fstr = "ivbep_unc_ha1::UNC_H_CLOCKTICKS:e=0:t=0",
2602         },
2603         { SRC_LINE,
2604           .name = "ivbep_unc_ha1::UNC_H_REQUESTS:READS:t=1",
2605           .ret  = PFM_SUCCESS,
2606           .count = 1,
2607           .codes[0] = 0x1000301,
2608           .fstr = "ivbep_unc_ha1::UNC_H_REQUESTS:READS:e=0:t=1",
2609         },
2610         { SRC_LINE,
2611           .name = "ivbep_unc_ha0::UNC_H_IMC_WRITES:t=1",
2612           .ret  = PFM_SUCCESS,
2613           .count = 1,
2614           .codes[0] = 0x1000f1a,
2615           .fstr = "ivbep_unc_ha0::UNC_H_IMC_WRITES:ALL:e=0:t=1",
2616         },
2617         { SRC_LINE,
2618           .name = "ivbep_unc_ha0::UNC_H_IMC_READS:t=1",
2619           .ret  = PFM_SUCCESS,
2620           .count = 1,
2621           .codes[0] = 0x1000117,
2622           .fstr = "ivbep_unc_ha0::UNC_H_IMC_READS:NORMAL:e=0:t=1",
2623         },
2624         { SRC_LINE,
2625           .name = "ivbep_unc_imc0::UNC_M_CLOCKTICKS",
2626           .ret  = PFM_SUCCESS,
2627           .count = 1,
2628           .codes[0] = 0xff,
2629           .fstr = "ivbep_unc_imc0::UNC_M_CLOCKTICKS",
2630         },
2631         { SRC_LINE,
2632           .name = "ivbep_unc_imc0::UNC_M_CLOCKTICKS:t=1",
2633           .ret  = PFM_ERR_ATTR,
2634         },
2635         { SRC_LINE,
2636           .name = "ivbep_unc_imc0::UNC_M_DCLOCKTICKS",
2637           .ret  = PFM_SUCCESS,
2638           .count = 1,
2639           .codes[0] = 0x00,
2640           .fstr = "ivbep_unc_imc0::UNC_M_DCLOCKTICKS:e=0:t=0",
2641         },
2642         { SRC_LINE,
2643           .name = "ivbep_unc_imc4::UNC_M_DCLOCKTICKS",
2644           .ret  = PFM_SUCCESS,
2645           .count = 1,
2646           .codes[0] = 0x00,
2647           .fstr = "ivbep_unc_imc4::UNC_M_DCLOCKTICKS:e=0:t=0",
2648         },
2649         { SRC_LINE,
2650           .name = "ivbep_unc_imc0::UNC_M_CAS_COUNT:RD",
2651           .ret  = PFM_SUCCESS,
2652           .count = 1,
2653           .codes[0] = 0x0304,
2654           .fstr = "ivbep_unc_imc0::UNC_M_CAS_COUNT:RD:e=0:t=0",
2655         },
2656         { SRC_LINE,
2657           .name = "ivbep_unc_imc0::UNC_M_POWER_CKE_CYCLES:RANK0",
2658           .ret  = PFM_SUCCESS,
2659           .count = 1,
2660           .codes[0] = 0x183,
2661           .fstr = "ivbep_unc_imc0::UNC_M_POWER_CKE_CYCLES:RANK0:e=0:t=0",
2662         },
2663         { SRC_LINE,
2664           .name = "ivbep_unc_imc0::UNC_M_CAS_COUNT:WR",
2665           .ret  = PFM_SUCCESS,
2666           .count = 1,
2667           .codes[0] = 0xc04,
2668           .fstr = "ivbep_unc_imc0::UNC_M_CAS_COUNT:WR:e=0:t=0",
2669         },
2670         { SRC_LINE,
2671           .name = "ivbep_unc_imc0::UNC_M_RD_CAS_RANK0:BANK0",
2672           .ret  = PFM_SUCCESS,
2673           .count = 1,
2674           .codes[0] = 0x1b0,
2675           .fstr = "ivbep_unc_imc0::UNC_M_RD_CAS_RANK0:BANK0:e=0:t=0",
2676         },
2677         { SRC_LINE,
2678           .name = "ivbep_unc_imc0::UNC_M_RD_CAS_RANK4:BANK7",
2679           .ret  = PFM_SUCCESS,
2680           .count = 1,
2681           .codes[0] = 0x80b4,
2682           .fstr = "ivbep_unc_imc0::UNC_M_RD_CAS_RANK4:BANK7:e=0:t=0",
2683         },
2684         { SRC_LINE,
2685           .name = "ivbep_unc_imc0::UNC_M_RD_CAS_RANK4:BANK7:t=1",
2686           .ret  = PFM_SUCCESS,
2687           .count = 1,
2688           .codes[0] = 0x10080b4,
2689           .fstr = "ivbep_unc_imc0::UNC_M_RD_CAS_RANK4:BANK7:e=0:t=1",
2690         },
2691         { SRC_LINE,
2692           .name = "ivbep_unc_qpi0::UNC_Q_CLOCKTICKS",
2693           .ret  = PFM_SUCCESS,
2694           .count = 1,
2695           .codes[0] = 0x14,
2696           .fstr = "ivbep_unc_qpi0::UNC_Q_CLOCKTICKS:e=0:t=0",
2697         },
2698         { SRC_LINE,
2699           .name = "ivbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:DATA",
2700           .ret  = PFM_SUCCESS,
2701           .count = 1,
2702           .codes[0] = 0x201,
2703           .fstr = "ivbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:DATA:e=0:t=0",
2704         },
2705         { SRC_LINE,
2706           .name = "ivbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:IDLE:t=1",
2707           .ret  = PFM_SUCCESS,
2708           .count = 1,
2709           .codes[0] = 0x1000101,
2710           .fstr = "ivbep_unc_qpi0::UNC_Q_RXL_FLITS_G0:IDLE:e=0:t=1",
2711         },
2712         { SRC_LINE,
2713           .name = "ivbep_unc_qpi0::UNC_Q_TXL_FLITS_G0:DATA",
2714           .ret  = PFM_SUCCESS,
2715           .count = 1,
2716           .codes[0] = 0x200,
2717           .fstr = "ivbep_unc_qpi0::UNC_Q_TXL_FLITS_G0:DATA:e=0:t=0",
2718         },
2719         { SRC_LINE,
2720           .name = "ivbep_unc_qpi0::UNC_Q_RXL_FLITS_G1:HOM",
2721           .ret  = PFM_SUCCESS,
2722           .count = 1,
2723           .codes[0] = 0x200602,
2724           .fstr = "ivbep_unc_qpi0::UNC_Q_RXL_FLITS_G1:HOM:e=0:t=0",
2725         },
2726         { SRC_LINE,
2727           .name = "ivbep_unc_qpi0::UNC_Q_TXL_FLITS_G1:HOM",
2728           .ret  = PFM_SUCCESS,
2729           .count = 1,
2730           .codes[0] = 0x200600,
2731           .fstr = "ivbep_unc_qpi0::UNC_Q_TXL_FLITS_G1:HOM:e=0:t=0",
2732         },
2733         { SRC_LINE,
2734           .name = "ivbep_unc_ubo::UNC_U_LOCK_CYCLES",
2735           .ret  = PFM_SUCCESS,
2736           .count = 1,
2737           .codes[0] = 0x44,
2738           .fstr = "ivbep_unc_ubo::UNC_U_LOCK_CYCLES:e=0:t=0",
2739         },
2740         { SRC_LINE,
2741           .name = "ivbep_unc_r2pcie::UNC_R2_CLOCKTICKS",
2742           .ret  = PFM_SUCCESS,
2743           .count = 1,
2744           .codes[0] = 0x1,
2745           .fstr = "ivbep_unc_r2pcie::UNC_R2_CLOCKTICKS:e=0:t=0",
2746         },
2747         { SRC_LINE,
2748           .name = "ivbep_unc_r2pcie::UNC_R2_RING_AD_USED:CW",
2749           .ret  = PFM_SUCCESS,
2750           .count = 1,
2751           .codes[0] = 0x3307,
2752           .fstr = "ivbep_unc_r2pcie::UNC_R2_RING_AD_USED:CW:e=0:t=0",
2753         },
2754         { SRC_LINE,
2755           .name = "ivbep_unc_r3qpi0::UNC_R3_CLOCKTICKS",
2756           .ret  = PFM_SUCCESS,
2757           .count = 1,
2758           .codes[0] = 0x1,
2759           .fstr = "ivbep_unc_r3qpi0::UNC_R3_CLOCKTICKS:e=0:t=0",
2760         },
2761         { SRC_LINE,
2762           .name = "ivbep_unc_r3qpi0::UNC_R3_TXR_CYCLES_FULL:e=0:t=0",
2763           .ret  = PFM_SUCCESS,
2764           .count = 1,
2765           .codes[0] = 0x25,
2766           .fstr = "ivbep_unc_r3qpi0::UNC_R3_TXR_CYCLES_FULL:e=0:t=0",
2767         },
2768         { SRC_LINE,
2769           .name = "ivbep_unc_r3qpi1::UNC_R3_CLOCKTICKS",
2770           .ret  = PFM_SUCCESS,
2771           .count = 1,
2772           .codes[0] = 0x1,
2773           .fstr = "ivbep_unc_r3qpi1::UNC_R3_CLOCKTICKS:e=0:t=0",
2774         },
2775         { SRC_LINE,
2776           .name = "ivbep_unc_r3qpi1::UNC_R3_TXR_CYCLES_FULL:e=0:t=0",
2777           .ret  = PFM_SUCCESS,
2778           .count = 1,
2779           .codes[0] = 0x25,
2780           .fstr = "ivbep_unc_r3qpi1::UNC_R3_TXR_CYCLES_FULL:e=0:t=0",
2781         },
2782         { SRC_LINE,
2783           .name = "hsw_ep::mem_trans_retired:latency_above_threshold:ldlat=3:u",
2784           .ret = PFM_SUCCESS,
2785           .count = 2,
2786           .codes[0] = 0x5101cd,
2787           .codes[1] = 3,
2788           .fstr = "hsw_ep::MEM_TRANS_RETIRED:LOAD_LATENCY:k=0:u=1:e=0:i=0:c=0:t=0:ldlat=3:intx=0:intxcp=0",
2789         },
2790         { SRC_LINE,
2791           .name = "hsw_ep::mem_trans_retired:latency_above_threshold:ldlat=1000000",
2792           .ret = PFM_ERR_ATTR_VAL,
2793         },
2794         { SRC_LINE,
2795           .name = "hsw_ep::mem_trans_retired:load_latency",
2796           .ret = PFM_SUCCESS,
2797           .count = 2,
2798           .codes[0] = 0x5301cd,
2799           .codes[1] = 3,
2800           .fstr = "hsw_ep::MEM_TRANS_RETIRED:LOAD_LATENCY:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3:intx=0:intxcp=0",
2801         },
2802         { SRC_LINE,
2803           .name = "hsw_ep::mem_trans_retired:load_latency:ldlat=1000000",
2804           .ret = PFM_ERR_ATTR_VAL,
2805         },
2806         { SRC_LINE,
2807           .name = "hsw_ep::mem_trans_retired:latency_above_threshold:ldlat=2:intx=0:intxcp=0",
2808           .ret = PFM_ERR_ATTR_VAL,
2809         },
2810         { SRC_LINE,
2811           .name = "hsw_ep::inst_Retired:any_p:intx",
2812           .count = 1,
2813           .codes[0] = 0x1005300c0,
2814           .fstr = "hsw_ep::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=1:intxcp=0",
2815         },
2816         { SRC_LINE,
2817           .name = "hsw_ep::inst_Retired:any_p:intx:intxcp",
2818           .count = 1,
2819           .codes[0] = 0x3005300c0,
2820           .fstr = "hsw_ep::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=1:intxcp=1",
2821         },
2822         { SRC_LINE,
2823           .name = "hsw_ep::inst_Retired:any_p:intx=0:intxcp",
2824           .count = 1,
2825           .codes[0] = 0x2005300c0,
2826           .fstr = "hsw_ep::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=1",
2827         },
2828         { SRC_LINE,
2829           .name = "hsw_ep::cycle_activity:cycles_l2_pending",
2830           .ret = PFM_SUCCESS,
2831           .count = 1,
2832           .codes[0] = 0x15301a3,
2833           .fstr = "hsw_ep::CYCLE_ACTIVITY:CYCLES_L2_PENDING:k=1:u=1:e=0:i=0:t=0:intx=0:intxcp=0",
2834         },
2835         { SRC_LINE,
2836           .name = "hsw_ep::cycle_activity:cycles_l2_pending:c=8",
2837           .ret = PFM_ERR_ATTR,
2838         },
2839         { SRC_LINE,
2840           .name = "hsw_ep::hle_retired:aborted",
2841           .ret = PFM_SUCCESS,
2842           .count = 1,
2843           .codes[0] = 0x5304c8,
2844           .fstr = "hsw_ep::HLE_RETIRED:ABORTED:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2845         },
2846         { SRC_LINE,
2847           .name = "hsw_ep::mem_load_uops_l3_miss_retired:remote_dram",
2848           .ret = PFM_SUCCESS,
2849           .count = 1,
2850           .codes[0] = 0x5304d3,
2851           .fstr = "hsw_ep::MEM_LOAD_UOPS_L3_MISS_RETIRED:REMOTE_DRAM:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2852         },
2853         { SRC_LINE,
2854           .name = "hsw_ep::offcore_response_0:any_data:L3_miss_local",
2855           .ret = PFM_SUCCESS,
2856           .count = 2,
2857           .codes[0] = 0x5301b7,
2858           .codes[1] = 0x3f80400091ull,
2859           .fstr = "hsw_ep::OFFCORE_RESPONSE_0:DMND_DATA_RD:PF_DATA_RD:PF_L3_DATA_RD:L3_MISS_LOCAL:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2860         },
2861         { SRC_LINE,
2862           .name = "hsw_ep::offcore_response_0:any_data:LLC_miss_local",
2863           .ret = PFM_ERR_ATTR,
2864         },
2865         { SRC_LINE,
2866           .name = "hsw_ep::offcore_response_0:any_data:LLC_miss_remote",
2867           .ret = PFM_ERR_ATTR,
2868         },
2869         { SRC_LINE,
2870           .name = "hsw_ep::offcore_response_0:any_data:L3_HIT",
2871           .ret = PFM_SUCCESS,
2872           .count = 2,
2873           .codes[0] =0x5301b7,
2874           .codes[1] =0x3f803c0091ull,
2875           .fstr = "hsw_ep::OFFCORE_RESPONSE_0:DMND_DATA_RD:PF_DATA_RD:PF_L3_DATA_RD:L3_HITM:L3_HITE:L3_HITS:L3_HITF:SNP_ANY:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2876         },
2877         { SRC_LINE,
2878           .name = "bdw::mem_trans_retired:latency_above_threshold:ldlat=3:u",
2879           .ret = PFM_SUCCESS,
2880           .count = 2,
2881           .codes[0] = 0x5101cd,
2882           .codes[1] = 3,
2883           .fstr = "bdw::MEM_TRANS_RETIRED:LOAD_LATENCY:k=0:u=1:e=0:i=0:c=0:t=0:ldlat=3:intx=0:intxcp=0",
2884         },
2885         { SRC_LINE,
2886           .name = "bdw::mem_trans_retired:latency_above_threshold:ldlat=1000000",
2887           .ret = PFM_ERR_ATTR_VAL,
2888         },
2889         { SRC_LINE,
2890           .name = "bdw::mem_trans_retired:load_latency",
2891           .ret = PFM_SUCCESS,
2892           .count = 2,
2893           .codes[0] = 0x5301cd,
2894           .codes[1] = 3,
2895           .fstr = "bdw::MEM_TRANS_RETIRED:LOAD_LATENCY:k=1:u=1:e=0:i=0:c=0:t=0:ldlat=3:intx=0:intxcp=0",
2896         },
2897         { SRC_LINE,
2898           .name = "bdw::mem_trans_retired:load_latency:ldlat=1000000",
2899           .ret = PFM_ERR_ATTR_VAL,
2900         },
2901         { SRC_LINE,
2902           .name = "bdw::mem_trans_retired:latency_above_threshold:ldlat=2:intx=0:intxcp=0",
2903           .ret = PFM_ERR_ATTR_VAL,
2904         },
2905         { SRC_LINE,
2906           .name = "bdw::inst_Retired:any_p:intx",
2907           .count = 1,
2908           .codes[0] = 0x1005300c0,
2909           .fstr = "bdw::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=1:intxcp=0",
2910         },
2911         { SRC_LINE,
2912           .name = "bdw::inst_Retired:any_p:intx:intxcp",
2913           .count = 1,
2914           .codes[0] = 0x3005300c0,
2915           .fstr = "bdw::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=1:intxcp=1",
2916         },
2917         { SRC_LINE,
2918           .name = "bdw::inst_Retired:any_p:intx=0:intxcp",
2919           .count = 1,
2920           .codes[0] = 0x2005300c0,
2921           .fstr = "bdw::INST_RETIRED:ANY_P:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=1",
2922         },
2923         { SRC_LINE,
2924           .name = "bdw::cycle_activity:cycles_l2_pending",
2925           .ret = PFM_SUCCESS,
2926           .count = 1,
2927           .codes[0] = 0x15301a3,
2928           .fstr = "bdw::CYCLE_ACTIVITY:CYCLES_L2_PENDING:k=1:u=1:e=0:i=0:t=0:intx=0:intxcp=0",
2929         },
2930         { SRC_LINE,
2931           .name = "bdw::cycle_activity:cycles_l2_pending:c=8",
2932           .ret = PFM_ERR_ATTR,
2933         },
2934         { SRC_LINE,
2935           .name = "bdw::hle_retired:aborted",
2936           .ret = PFM_SUCCESS,
2937           .count = 1,
2938           .codes[0] = 0x5304c8,
2939           .fstr = "bdw::HLE_RETIRED:ABORTED:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2940         },
2941         { SRC_LINE,
2942           .name = "bdw::rtm_retired:aborted",
2943           .ret = PFM_SUCCESS,
2944           .count = 1,
2945           .codes[0] = 0x5304c9,
2946           .fstr = "bdw::RTM_RETIRED:ABORTED:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2947         },
2948         { SRC_LINE,
2949           .name = "bdw::arith:fpu_div_active",
2950           .ret = PFM_SUCCESS,
2951           .count = 1,
2952           .codes[0] = 0x530114,
2953           .fstr = "bdw::ARITH:FPU_DIV_ACTIVE:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2954         },
2955         { SRC_LINE,
2956           .name = "bdw::inst_retired:prec_dist",
2957           .ret = PFM_SUCCESS,
2958           .count = 1,
2959           .codes[0] = 0x5301c0,
2960           .fstr = "bdw::INST_RETIRED:PREC_DIST:k=1:u=1:e=0:i=0:c=0:t=0:intx=0:intxcp=0",
2961         },
2962         { SRC_LINE,
2963           .name = "bdw::rs_events:empty_end",
2964           .ret = PFM_SUCCESS,
2965           .count = 1,
2966           .codes[0] = 0x1d7015e,
2967           .fstr = "bdw::RS_EVENTS:EMPTY_END:k=1:u=1:e=1:i=1:c=1:t=0:intx=0:intxcp=0",
2968         },
2969 };
2970 #define NUM_TEST_EVENTS (int)(sizeof(x86_test_events)/sizeof(test_event_t))
2971
2972 static int
2973 check_pmu_supported(const char *evt)
2974 {
2975         pfm_pmu_info_t info;
2976         char *p;
2977         int i, ret;
2978
2979         memset(&info, 0, sizeof(info));
2980         info.size = sizeof(info);
2981
2982         /* look for pmu_name::.... */
2983         p = strchr(evt, ':');
2984         if (!p)
2985                 return 1;
2986         if (*(p+1) != ':')
2987                 return 1;
2988
2989         pfm_for_all_pmus(i) {
2990                 ret = pfm_get_pmu_info(i, &info);
2991                 if (ret != PFM_SUCCESS)
2992                         continue;
2993                 if (!strncmp(info.name, evt, p - evt))
2994                         return 1;
2995         }
2996         /* PMU not there */
2997         return 0;
2998 }
2999
3000 static int check_test_events(FILE *fp)
3001 {
3002         const test_event_t *e;
3003         char *fstr;
3004         uint64_t *codes;
3005         int count, i, j;
3006         int ret, errors = 0;
3007
3008         for (i=0, e = x86_test_events; i < NUM_TEST_EVENTS; i++, e++) {
3009                 codes = NULL;
3010                 count = 0;
3011                 fstr = NULL;
3012                 ret = pfm_get_event_encoding(e->name, PFM_PLM0 | PFM_PLM3, &fstr, NULL, &codes, &count);
3013                 if (ret != e->ret) {
3014                         if (ret == PFM_ERR_NOTFOUND && !check_pmu_supported(e->name)) {
3015                                 fprintf(fp,"Line %d, Event%d %s, skipped because no PMU support\n", e->line, i, e->name);
3016                                 continue;
3017                         }
3018                         fprintf(fp,"Line %d, Event%d %s, ret=%s(%d) expected %s(%d)\n", e->line, i, e->name, pfm_strerror(ret), ret, pfm_strerror(e->ret), e->ret);
3019                         errors++;
3020                 } else {
3021                         if (ret != PFM_SUCCESS) {
3022                                 if (fstr) {
3023                                         fprintf(fp,"Line %d, Event%d %s, expected fstr NULL but it is not\n", e->line, i, e->name);
3024                                         errors++;
3025                                 }
3026                                 if (count != 0) {
3027                                         fprintf(fp,"Line %d, Event%d %s, expected count=0 instead of %d\n", e->line, i, e->name, count);
3028                                         errors++;
3029                                 }
3030                                 if (codes) {
3031                                         fprintf(fp,"Line %d, Event%d %s, expected codes[] NULL but it is not\n", e->line, i, e->name);
3032                                         errors++;
3033                                 }
3034                         } else {
3035                                 if (count != e->count) {
3036                                         fprintf(fp,"Line %d, Event%d %s, count=%d expected %d\n", e->line, i, e->name, count, e->count);
3037                                         errors++;
3038                                 }
3039                                 for (j=0; j < count; j++) {
3040                                         if (codes[j] != e->codes[j]) {
3041                                                 fprintf(fp,"Line %d, Event%d %s, codes[%d]=%#"PRIx64" expected %#"PRIx64"\n", e->line, i, e->name, j, codes[j], e->codes[j]);
3042                                                 errors++;
3043                                         }
3044                                 }
3045                                 if (e->fstr && strcmp(fstr, e->fstr)) {
3046                                         fprintf(fp,"Line %d, Event%d %s, fstr=%s expected %s\n", e->line, i, e->name, fstr, e->fstr);
3047                                         errors++;
3048                                 }
3049                         }
3050                 }
3051                 if (codes)
3052                         free(codes);
3053                 if (fstr)
3054                         free(fstr);
3055         }
3056         printf("\t %d x86 events: %d errors\n", i, errors);
3057         return errors;
3058 }
3059
3060 int
3061 validate_arch(FILE *fp)
3062 {
3063         return check_test_events(fp);
3064 }