aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-02-10 02:36:12 -0500
committerIngo Molnar <mingo@kernel.org>2017-02-10 02:36:12 -0500
commit21ee2fcbf8c0f1242a947569c9e3a1e37d94b376 (patch)
tree5e2ec74ebcefd09466142c34ce41e3ff70c292aa /tools/perf
parentb6263178b8dbd9fe70d55f136c2a1da39309520e (diff)
parent7ea6856d6f5629d742edc23b8b76e6263371ef45 (diff)
Merge tag 'perf-core-for-mingo-4.11-20170209' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: - Add support for parsing Intel uncore vendor event files and add uncore vendor events for the Intel server processors (Haswell, Broadwell, IvyBridge), Xeon Phi (Knights Landing) and Broadwell DE (Andi Kleen) - Support --symfs in 'perf probe' (Uwe Kleine-König) - Add support for generating bpf prologue on the aarch64 architecture (He Kuang) - Show proper hint when SDT event not yet in place via 'perf probe' (Ravi Bangoria) - Take into account symfs setting when reading file build ID (Victor Kamensky) Infrastructure changes: - Map gcc7's '__attribute__ ((fallthrough))', that warns when code associated to case blocks in switches continue into the next case entry, to '__falltrough' and use it where warned by gcc, tested on Fedora Rawhide (Arnaldo Carvalho de Melo) - Fix buffer sizes used with snprintf that could lead to truncation, another warning introduced in gcc7 (Arnaldo Carvalho de Melo) - Robustify do_generate_dynamic_list_file in libtraceevent (David Carrillo-Cisneros) - Use zfree() in more places (Taeung Song) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/arch/arm64/Makefile1
-rw-r--r--tools/perf/arch/arm64/util/dwarf-regs.c15
-rw-r--r--tools/perf/bench/numa.c6
-rw-r--r--tools/perf/builtin-list.c3
-rw-r--r--tools/perf/builtin-probe.c2
-rw-r--r--tools/perf/builtin-top.c2
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json317
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json83
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json84
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json317
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json28
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json83
-rw-r--r--tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json84
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json317
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json28
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json83
-rw-r--r--tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json84
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json322
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json46
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json75
-rw-r--r--tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json249
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json209
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json46
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json79
-rw-r--r--tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json248
-rw-r--r--tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json42
-rw-r--r--tools/perf/pmu-events/jevents.c84
-rw-r--r--tools/perf/pmu-events/jevents.h4
-rw-r--r--tools/perf/pmu-events/pmu-events.h3
-rw-r--r--tools/perf/tests/parse-events.c8
-rw-r--r--tools/perf/util/bpf-loader.c4
-rw-r--r--tools/perf/util/event.c2
-rw-r--r--tools/perf/util/header.c1
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-decoder.c5
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c2
-rw-r--r--tools/perf/util/parse-events.c69
-rw-r--r--tools/perf/util/parse-events.y35
-rw-r--r--tools/perf/util/pmu.c47
-rw-r--r--tools/perf/util/pmu.h1
-rw-r--r--tools/perf/util/strfilter.c1
-rw-r--r--tools/perf/util/string.c2
-rw-r--r--tools/perf/util/symbol.c6
-rw-r--r--tools/perf/util/thread_map.c2
43 files changed, 3059 insertions, 70 deletions
diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf/arch/arm64/Makefile
index 18b13518d8d8..eebe1ec9d2ee 100644
--- a/tools/perf/arch/arm64/Makefile
+++ b/tools/perf/arch/arm64/Makefile
@@ -2,3 +2,4 @@ ifndef NO_DWARF
2PERF_HAVE_DWARF_REGS := 1 2PERF_HAVE_DWARF_REGS := 1
3endif 3endif
4PERF_HAVE_JITDUMP := 1 4PERF_HAVE_JITDUMP := 1
5PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
diff --git a/tools/perf/arch/arm64/util/dwarf-regs.c b/tools/perf/arch/arm64/util/dwarf-regs.c
index d49efeb8172e..068b6189157b 100644
--- a/tools/perf/arch/arm64/util/dwarf-regs.c
+++ b/tools/perf/arch/arm64/util/dwarf-regs.c
@@ -10,17 +10,20 @@
10 10
11#include <stddef.h> 11#include <stddef.h>
12#include <dwarf-regs.h> 12#include <dwarf-regs.h>
13#include <linux/ptrace.h> /* for struct user_pt_regs */
14#include "util.h"
13 15
14struct pt_regs_dwarfnum { 16struct pt_regs_dwarfnum {
15 const char *name; 17 const char *name;
16 unsigned int dwarfnum; 18 unsigned int dwarfnum;
17}; 19};
18 20
19#define STR(s) #s
20#define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num} 21#define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num}
21#define GPR_DWARFNUM_NAME(num) \ 22#define GPR_DWARFNUM_NAME(num) \
22 {.name = STR(%x##num), .dwarfnum = num} 23 {.name = STR(%x##num), .dwarfnum = num}
23#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0} 24#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0}
25#define DWARFNUM2OFFSET(index) \
26 (index * sizeof((struct user_pt_regs *)0)->regs[0])
24 27
25/* 28/*
26 * Reference: 29 * Reference:
@@ -78,3 +81,13 @@ const char *get_arch_regstr(unsigned int n)
78 return roff->name; 81 return roff->name;
79 return NULL; 82 return NULL;
80} 83}
84
85int regs_query_register_offset(const char *name)
86{
87 const struct pt_regs_dwarfnum *roff;
88
89 for (roff = regdwarfnum_table; roff->name != NULL; roff++)
90 if (!strcmp(roff->name, name))
91 return DWARFNUM2OFFSET(roff->dwarfnum);
92 return -EINVAL;
93}
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 8efe904e486b..9e5a02d6b9a9 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -1573,13 +1573,13 @@ static int __bench_numa(const char *name)
1573 "GB/sec,", "total-speed", "GB/sec total speed"); 1573 "GB/sec,", "total-speed", "GB/sec total speed");
1574 1574
1575 if (g->p.show_details >= 2) { 1575 if (g->p.show_details >= 2) {
1576 char tname[32]; 1576 char tname[14 + 2 * 10 + 1];
1577 struct thread_data *td; 1577 struct thread_data *td;
1578 for (p = 0; p < g->p.nr_proc; p++) { 1578 for (p = 0; p < g->p.nr_proc; p++) {
1579 for (t = 0; t < g->p.nr_threads; t++) { 1579 for (t = 0; t < g->p.nr_threads; t++) {
1580 memset(tname, 0, 32); 1580 memset(tname, 0, sizeof(tname));
1581 td = g->threads + p*g->p.nr_threads + t; 1581 td = g->threads + p*g->p.nr_threads + t;
1582 snprintf(tname, 32, "process%d:thread%d", p, t); 1582 snprintf(tname, sizeof(tname), "process%d:thread%d", p, t);
1583 print_res(tname, td->speed_gbs, 1583 print_res(tname, td->speed_gbs,
1584 "GB/sec", "thread-speed", "GB/sec/thread speed"); 1584 "GB/sec", "thread-speed", "GB/sec/thread speed");
1585 print_res(tname, td->system_time_ns / NSEC_PER_SEC, 1585 print_res(tname, td->system_time_ns / NSEC_PER_SEC,
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index ba9322ff858b..3b9d98b5feef 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -14,6 +14,7 @@
14#include "util/parse-events.h" 14#include "util/parse-events.h"
15#include "util/cache.h" 15#include "util/cache.h"
16#include "util/pmu.h" 16#include "util/pmu.h"
17#include "util/debug.h"
17#include <subcmd/parse-options.h> 18#include <subcmd/parse-options.h>
18 19
19static bool desc_flag = true; 20static bool desc_flag = true;
@@ -29,6 +30,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
29 "Print extra event descriptions. --no-desc to not print."), 30 "Print extra event descriptions. --no-desc to not print."),
30 OPT_BOOLEAN('v', "long-desc", &long_desc_flag, 31 OPT_BOOLEAN('v', "long-desc", &long_desc_flag,
31 "Print longer event descriptions."), 32 "Print longer event descriptions."),
33 OPT_INCR(0, "debug", &verbose,
34 "Enable debugging output"),
32 OPT_END() 35 OPT_END()
33 }; 36 };
34 const char * const list_usage[] = { 37 const char * const list_usage[] = {
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index f87996b0cb29..1fcebc31a508 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -552,6 +552,8 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
552 OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, 552 OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
553 "Enable kernel symbol demangling"), 553 "Enable kernel symbol demangling"),
554 OPT_BOOLEAN(0, "cache", &probe_conf.cache, "Manipulate probe cache"), 554 OPT_BOOLEAN(0, "cache", &probe_conf.cache, "Manipulate probe cache"),
555 OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
556 "Look for files with symbols relative to this directory"),
555 OPT_END() 557 OPT_END()
556 }; 558 };
557 int ret; 559 int ret;
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 20aef9815cd8..d90927f31ff6 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -643,7 +643,7 @@ repeat:
643 case -1: 643 case -1:
644 if (errno == EINTR) 644 if (errno == EINTR)
645 continue; 645 continue;
646 /* Fall trhu */ 646 __fallthrough;
647 default: 647 default:
648 c = getc(stdin); 648 c = getc(stdin);
649 tcsetattr(0, TCSAFLUSH, &save); 649 tcsetattr(0, TCSAFLUSH, &save);
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json
new file mode 100644
index 000000000000..076459c51d4e
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-cache.json
@@ -0,0 +1,317 @@
1[
2 {
3 "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_C_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "CBO"
8 },
9 {
10 "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
11 "Counter": "0,1,2,3",
12 "EventCode": "0x34",
13 "EventName": "UNC_C_LLC_LOOKUP.ANY",
14 "Filter": "filter_state=0x1",
15 "PerPkg": "1",
16 "ScaleUnit": "64Bytes",
17 "UMask": "0x11",
18 "Unit": "CBO"
19 },
20 {
21 "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
22 "Counter": "0,1,2,3",
23 "EventCode": "0x37",
24 "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
25 "PerPkg": "1",
26 "ScaleUnit": "64Bytes",
27 "UMask": "0x1",
28 "Unit": "CBO"
29 },
30 {
31 "BriefDescription": "LLC misses - demand and prefetch data reads - excludes LLC prefetches. Derived from unc_c_tor_inserts.miss_opcode",
32 "Counter": "0,1,2,3",
33 "EventCode": "0x35",
34 "EventName": "LLC_MISSES.DATA_READ",
35 "Filter": "filter_opc=0x182",
36 "PerPkg": "1",
37 "ScaleUnit": "64Bytes",
38 "UMask": "0x3",
39 "Unit": "CBO"
40 },
41 {
42 "BriefDescription": "LLC misses - Uncacheable reads (from cpu) . Derived from unc_c_tor_inserts.miss_opcode",
43 "Counter": "0,1,2,3",
44 "EventCode": "0x35",
45 "EventName": "LLC_MISSES.UNCACHEABLE",
46 "Filter": "filter_opc=0x187",
47 "PerPkg": "1",
48 "ScaleUnit": "64Bytes",
49 "UMask": "0x3",
50 "Unit": "CBO"
51 },
52 {
53 "BriefDescription": "MMIO reads. Derived from unc_c_tor_inserts.miss_opcode",
54 "Counter": "0,1,2,3",
55 "EventCode": "0x35",
56 "EventName": "LLC_MISSES.MMIO_READ",
57 "Filter": "filter_opc=0x187,filter_nc=1",
58 "PerPkg": "1",
59 "ScaleUnit": "64Bytes",
60 "UMask": "0x3",
61 "Unit": "CBO"
62 },
63 {
64 "BriefDescription": "MMIO writes. Derived from unc_c_tor_inserts.miss_opcode",
65 "Counter": "0,1,2,3",
66 "EventCode": "0x35",
67 "EventName": "LLC_MISSES.MMIO_WRITE",
68 "Filter": "filter_opc=0x18f,filter_nc=1",
69 "PerPkg": "1",
70 "ScaleUnit": "64Bytes",
71 "UMask": "0x3",
72 "Unit": "CBO"
73 },
74 {
75 "BriefDescription": "LLC prefetch misses for RFO. Derived from unc_c_tor_inserts.miss_opcode",
76 "Counter": "0,1,2,3",
77 "EventCode": "0x35",
78 "EventName": "LLC_MISSES.RFO_LLC_PREFETCH",
79 "Filter": "filter_opc=0x190",
80 "PerPkg": "1",
81 "ScaleUnit": "64Bytes",
82 "UMask": "0x3",
83 "Unit": "CBO"
84 },
85 {
86 "BriefDescription": "LLC prefetch misses for code reads. Derived from unc_c_tor_inserts.miss_opcode",
87 "Counter": "0,1,2,3",
88 "EventCode": "0x35",
89 "EventName": "LLC_MISSES.CODE_LLC_PREFETCH",
90 "Filter": "filter_opc=0x191",
91 "PerPkg": "1",
92 "ScaleUnit": "64Bytes",
93 "UMask": "0x3",
94 "Unit": "CBO"
95 },
96 {
97 "BriefDescription": "LLC prefetch misses for data reads. Derived from unc_c_tor_inserts.miss_opcode",
98 "Counter": "0,1,2,3",
99 "EventCode": "0x35",
100 "EventName": "LLC_MISSES.DATA_LLC_PREFETCH",
101 "Filter": "filter_opc=0x192",
102 "PerPkg": "1",
103 "ScaleUnit": "64Bytes",
104 "UMask": "0x3",
105 "Unit": "CBO"
106 },
107 {
108 "BriefDescription": "LLC misses for PCIe read current. Derived from unc_c_tor_inserts.miss_opcode",
109 "Counter": "0,1,2,3",
110 "EventCode": "0x35",
111 "EventName": "LLC_MISSES.PCIE_READ",
112 "Filter": "filter_opc=0x19e",
113 "PerPkg": "1",
114 "ScaleUnit": "64Bytes",
115 "UMask": "0x3",
116 "Unit": "CBO"
117 },
118 {
119 "BriefDescription": "ItoM write misses (as part of fast string memcpy stores) + PCIe full line writes. Derived from unc_c_tor_inserts.miss_opcode",
120 "Counter": "0,1,2,3",
121 "EventCode": "0x35",
122 "EventName": "LLC_MISSES.PCIE_WRITE",
123 "Filter": "filter_opc=0x1c8",
124 "PerPkg": "1",
125 "ScaleUnit": "64Bytes",
126 "UMask": "0x3",
127 "Unit": "CBO"
128 },
129 {
130 "BriefDescription": "PCIe write misses (full cache line). Derived from unc_c_tor_inserts.miss_opcode",
131 "Counter": "0,1,2,3",
132 "EventCode": "0x35",
133 "EventName": "LLC_MISSES.PCIE_NON_SNOOP_WRITE",
134 "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
135 "PerPkg": "1",
136 "ScaleUnit": "64Bytes",
137 "UMask": "0x3",
138 "Unit": "CBO"
139 },
140 {
141 "BriefDescription": "PCIe writes (partial cache line). Derived from unc_c_tor_inserts.opcode",
142 "Counter": "0,1,2,3",
143 "EventCode": "0x35",
144 "EventName": "LLC_REFERENCES.PCIE_NS_PARTIAL_WRITE",
145 "Filter": "filter_opc=0x180,filter_tid=0x3e",
146 "PerPkg": "1",
147 "UMask": "0x1",
148 "Unit": "CBO"
149 },
150 {
151 "BriefDescription": "L2 demand and L2 prefetch code references to LLC. Derived from unc_c_tor_inserts.opcode",
152 "Counter": "0,1,2,3",
153 "EventCode": "0x35",
154 "EventName": "LLC_REFERENCES.CODE_LLC_PREFETCH",
155 "Filter": "filter_opc=0x181",
156 "PerPkg": "1",
157 "ScaleUnit": "64Bytes",
158 "UMask": "0x1",
159 "Unit": "CBO"
160 },
161 {
162 "BriefDescription": "Streaming stores (full cache line). Derived from unc_c_tor_inserts.opcode",
163 "Counter": "0,1,2,3",
164 "EventCode": "0x35",
165 "EventName": "LLC_REFERENCES.STREAMING_FULL",
166 "Filter": "filter_opc=0x18c",
167 "PerPkg": "1",
168 "ScaleUnit": "64Bytes",
169 "UMask": "0x1",
170 "Unit": "CBO"
171 },
172 {
173 "BriefDescription": "Streaming stores (partial cache line). Derived from unc_c_tor_inserts.opcode",
174 "Counter": "0,1,2,3",
175 "EventCode": "0x35",
176 "EventName": "LLC_REFERENCES.STREAMING_PARTIAL",
177 "Filter": "filter_opc=0x18d",
178 "PerPkg": "1",
179 "ScaleUnit": "64Bytes",
180 "UMask": "0x1",
181 "Unit": "CBO"
182 },
183 {
184 "BriefDescription": "PCIe read current. Derived from unc_c_tor_inserts.opcode",
185 "Counter": "0,1,2,3",
186 "EventCode": "0x35",
187 "EventName": "LLC_REFERENCES.PCIE_READ",
188 "Filter": "filter_opc=0x19e",
189 "PerPkg": "1",
190 "ScaleUnit": "64Bytes",
191 "UMask": "0x1",
192 "Unit": "CBO"
193 },
194 {
195 "BriefDescription": "PCIe write references (full cache line). Derived from unc_c_tor_inserts.opcode",
196 "Counter": "0,1,2,3",
197 "EventCode": "0x35",
198 "EventName": "LLC_REFERENCES.PCIE_WRITE",
199 "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
200 "PerPkg": "1",
201 "ScaleUnit": "64Bytes",
202 "UMask": "0x1",
203 "Unit": "CBO"
204 },
205 {
206 "BriefDescription": "Occupancy counter for LLC data reads (demand and L2 prefetch). Derived from unc_c_tor_occupancy.miss_opcode",
207 "EventCode": "0x36",
208 "EventName": "UNC_C_TOR_OCCUPANCY.LLC_DATA_READ",
209 "Filter": "filter_opc=0x182",
210 "PerPkg": "1",
211 "UMask": "0x3",
212 "Unit": "CBO"
213 },
214 {
215 "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
216 "Counter": "0,1,2,3",
217 "EventCode": "0x1",
218 "EventName": "UNC_H_REQUESTS.READS",
219 "PerPkg": "1",
220 "UMask": "0x3",
221 "Unit": "HA"
222 },
223 {
224 "BriefDescription": "read requests to local home agent. Derived from unc_h_requests.reads_local",
225 "Counter": "0,1,2,3",
226 "EventCode": "0x1",
227 "EventName": "UNC_H_REQUESTS.READS_LOCAL",
228 "PerPkg": "1",
229 "UMask": "0x1",
230 "Unit": "HA"
231 },
232 {
233 "BriefDescription": "read requests to remote home agent. Derived from unc_h_requests.reads_remote",
234 "Counter": "0,1,2,3",
235 "EventCode": "0x1",
236 "EventName": "UNC_H_REQUESTS.READS_REMOTE",
237 "PerPkg": "1",
238 "UMask": "0x2",
239 "Unit": "HA"
240 },
241 {
242 "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
243 "Counter": "0,1,2,3",
244 "EventCode": "0x1",
245 "EventName": "UNC_H_REQUESTS.WRITES",
246 "PerPkg": "1",
247 "UMask": "0xC",
248 "Unit": "HA"
249 },
250 {
251 "BriefDescription": "write requests to local home agent. Derived from unc_h_requests.writes_local",
252 "Counter": "0,1,2,3",
253 "EventCode": "0x1",
254 "EventName": "UNC_H_REQUESTS.WRITES_LOCAL",
255 "PerPkg": "1",
256 "UMask": "0x4",
257 "Unit": "HA"
258 },
259 {
260 "BriefDescription": "write requests to remote home agent. Derived from unc_h_requests.writes_remote",
261 "Counter": "0,1,2,3",
262 "EventCode": "0x1",
263 "EventName": "UNC_H_REQUESTS.WRITES_REMOTE",
264 "PerPkg": "1",
265 "UMask": "0x8",
266 "Unit": "HA"
267 },
268 {
269 "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously). Derived from unc_h_snoop_resp.rspcnflct",
270 "Counter": "0,1,2,3",
271 "EventCode": "0x21",
272 "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT",
273 "PerPkg": "1",
274 "UMask": "0x40",
275 "Unit": "HA"
276 },
277 {
278 "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
279 "Counter": "0,1,2,3",
280 "EventCode": "0x21",
281 "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
282 "PerPkg": "1",
283 "ScaleUnit": "64Bytes",
284 "UMask": "0x20",
285 "Unit": "HA"
286 },
287 {
288 "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
289 "Counter": "0,1,2,3",
290 "EventCode": "0x21",
291 "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
292 "PerPkg": "1",
293 "ScaleUnit": "64Bytes",
294 "UMask": "0x4",
295 "Unit": "HA"
296 },
297 {
298 "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
299 "Counter": "0,1,2,3",
300 "EventCode": "0x21",
301 "EventName": "UNC_H_SNOOP_RESP.RSPS",
302 "PerPkg": "1",
303 "ScaleUnit": "64Bytes",
304 "UMask": "0x2",
305 "Unit": "HA"
306 },
307 {
308 "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
309 "Counter": "0,1,2,3",
310 "EventCode": "0x21",
311 "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
312 "PerPkg": "1",
313 "ScaleUnit": "64Bytes",
314 "UMask": "0x8",
315 "Unit": "HA"
316 }
317]
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json
new file mode 100644
index 000000000000..d17dc235f734
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-memory.json
@@ -0,0 +1,83 @@
1[
2 {
3 "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x4",
6 "EventName": "UNC_M_CAS_COUNT.RD",
7 "PerPkg": "1",
8 "ScaleUnit": "64Bytes",
9 "UMask": "0x3",
10 "Unit": "iMC"
11 },
12 {
13 "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
14 "Counter": "0,1,2,3",
15 "EventCode": "0x4",
16 "EventName": "UNC_M_CAS_COUNT.WR",
17 "PerPkg": "1",
18 "ScaleUnit": "64Bytes",
19 "UMask": "0xC",
20 "Unit": "iMC"
21 },
22 {
23 "BriefDescription": "Memory controller clock ticks. Derived from unc_m_clockticks",
24 "Counter": "0,1,2,3",
25 "EventName": "UNC_M_CLOCKTICKS",
26 "PerPkg": "1",
27 "Unit": "iMC"
28 },
29 {
30 "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
31 "Counter": "0,1,2,3",
32 "EventCode": "0x85",
33 "EventName": "UNC_M_POWER_CHANNEL_PPD",
34 "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
35 "PerPkg": "1",
36 "Unit": "iMC"
37 },
38 {
39 "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
40 "Counter": "0,1,2,3",
41 "EventCode": "0x86",
42 "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
43 "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
44 "PerPkg": "1",
45 "Unit": "iMC"
46 },
47 {
48 "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
49 "Counter": "0,1,2,3",
50 "EventCode": "0x43",
51 "EventName": "UNC_M_POWER_SELF_REFRESH",
52 "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
53 "PerPkg": "1",
54 "Unit": "iMC"
55 },
56 {
57 "BriefDescription": "Pre-charges due to page misses. Derived from unc_m_pre_count.page_miss",
58 "Counter": "0,1,2,3",
59 "EventCode": "0x2",
60 "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
61 "PerPkg": "1",
62 "UMask": "0x1",
63 "Unit": "iMC"
64 },
65 {
66 "BriefDescription": "Pre-charge for reads. Derived from unc_m_pre_count.rd",
67 "Counter": "0,1,2,3",
68 "EventCode": "0x2",
69 "EventName": "UNC_M_PRE_COUNT.RD",
70 "PerPkg": "1",
71 "UMask": "0x4",
72 "Unit": "iMC"
73 },
74 {
75 "BriefDescription": "Pre-charge for writes. Derived from unc_m_pre_count.wr",
76 "Counter": "0,1,2,3",
77 "EventCode": "0x2",
78 "EventName": "UNC_M_PRE_COUNT.WR",
79 "PerPkg": "1",
80 "UMask": "0x8",
81 "Unit": "iMC"
82 }
83]
diff --git a/tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json
new file mode 100644
index 000000000000..b44d43088bbb
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/broadwellde/uncore-power.json
@@ -0,0 +1,84 @@
1[
2 {
3 "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_P_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "PCU"
8 },
9 {
10 "BriefDescription": "C0 and C1. Derived from unc_p_power_state_occupancy.cores_c0",
11 "Counter": "0,1,2,3",
12 "EventCode": "0x80",
13 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
14 "Filter": "occ_sel=1",
15 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
16 "PerPkg": "1",
17 "Unit": "PCU"
18 },
19 {
20 "BriefDescription": "C3. Derived from unc_p_power_state_occupancy.cores_c3",
21 "Counter": "0,1,2,3",
22 "EventCode": "0x80",
23 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
24 "Filter": "occ_sel=2",
25 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
26 "PerPkg": "1",
27 "Unit": "PCU"
28 },
29 {
30 "BriefDescription": "C6 and C7. Derived from unc_p_power_state_occupancy.cores_c6",
31 "Counter": "0,1,2,3",
32 "EventCode": "0x80",
33 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
34 "Filter": "occ_sel=3",
35 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
36 "PerPkg": "1",
37 "Unit": "PCU"
38 },
39 {
40 "BriefDescription": "External Prochot. Derived from unc_p_prochot_external_cycles",
41 "Counter": "0,1,2,3",
42 "EventCode": "0xA",
43 "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
44 "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
45 "PerPkg": "1",
46 "Unit": "PCU"
47 },
48 {
49 "BriefDescription": "Thermal Strongest Upper Limit Cycles. Derived from unc_p_freq_max_limit_thermal_cycles",
50 "Counter": "0,1,2,3",
51 "EventCode": "0x4",
52 "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
53 "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
54 "PerPkg": "1",
55 "Unit": "PCU"
56 },
57 {
58 "BriefDescription": "OS Strongest Upper Limit Cycles. Derived from unc_p_freq_max_os_cycles",
59 "Counter": "0,1,2,3",
60 "EventCode": "0x6",
61 "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
62 "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
63 "PerPkg": "1",
64 "Unit": "PCU"
65 },
66 {
67 "BriefDescription": "Power Strongest Upper Limit Cycles. Derived from unc_p_freq_max_power_cycles",
68 "Counter": "0,1,2,3",
69 "EventCode": "0x5",
70 "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
71 "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
72 "PerPkg": "1",
73 "Unit": "PCU"
74 },
75 {
76 "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
77 "Counter": "0,1,2,3",
78 "EventCode": "0x74",
79 "EventName": "UNC_P_FREQ_TRANS_CYCLES",
80 "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
81 "PerPkg": "1",
82 "Unit": "PCU"
83 }
84]
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json
new file mode 100644
index 000000000000..076459c51d4e
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-cache.json
@@ -0,0 +1,317 @@
1[
2 {
3 "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_C_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "CBO"
8 },
9 {
10 "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
11 "Counter": "0,1,2,3",
12 "EventCode": "0x34",
13 "EventName": "UNC_C_LLC_LOOKUP.ANY",
14 "Filter": "filter_state=0x1",
15 "PerPkg": "1",
16 "ScaleUnit": "64Bytes",
17 "UMask": "0x11",
18 "Unit": "CBO"
19 },
20 {
21 "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
22 "Counter": "0,1,2,3",
23 "EventCode": "0x37",
24 "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
25 "PerPkg": "1",
26 "ScaleUnit": "64Bytes",
27 "UMask": "0x1",
28 "Unit": "CBO"
29 },
30 {
31 "BriefDescription": "LLC misses - demand and prefetch data reads - excludes LLC prefetches. Derived from unc_c_tor_inserts.miss_opcode",
32 "Counter": "0,1,2,3",
33 "EventCode": "0x35",
34 "EventName": "LLC_MISSES.DATA_READ",
35 "Filter": "filter_opc=0x182",
36 "PerPkg": "1",
37 "ScaleUnit": "64Bytes",
38 "UMask": "0x3",
39 "Unit": "CBO"
40 },
41 {
42 "BriefDescription": "LLC misses - Uncacheable reads (from cpu) . Derived from unc_c_tor_inserts.miss_opcode",
43 "Counter": "0,1,2,3",
44 "EventCode": "0x35",
45 "EventName": "LLC_MISSES.UNCACHEABLE",
46 "Filter": "filter_opc=0x187",
47 "PerPkg": "1",
48 "ScaleUnit": "64Bytes",
49 "UMask": "0x3",
50 "Unit": "CBO"
51 },
52 {
53 "BriefDescription": "MMIO reads. Derived from unc_c_tor_inserts.miss_opcode",
54 "Counter": "0,1,2,3",
55 "EventCode": "0x35",
56 "EventName": "LLC_MISSES.MMIO_READ",
57 "Filter": "filter_opc=0x187,filter_nc=1",
58 "PerPkg": "1",
59 "ScaleUnit": "64Bytes",
60 "UMask": "0x3",
61 "Unit": "CBO"
62 },
63 {
64 "BriefDescription": "MMIO writes. Derived from unc_c_tor_inserts.miss_opcode",
65 "Counter": "0,1,2,3",
66 "EventCode": "0x35",
67 "EventName": "LLC_MISSES.MMIO_WRITE",
68 "Filter": "filter_opc=0x18f,filter_nc=1",
69 "PerPkg": "1",
70 "ScaleUnit": "64Bytes",
71 "UMask": "0x3",
72 "Unit": "CBO"
73 },
74 {
75 "BriefDescription": "LLC prefetch misses for RFO. Derived from unc_c_tor_inserts.miss_opcode",
76 "Counter": "0,1,2,3",
77 "EventCode": "0x35",
78 "EventName": "LLC_MISSES.RFO_LLC_PREFETCH",
79 "Filter": "filter_opc=0x190",
80 "PerPkg": "1",
81 "ScaleUnit": "64Bytes",
82 "UMask": "0x3",
83 "Unit": "CBO"
84 },
85 {
86 "BriefDescription": "LLC prefetch misses for code reads. Derived from unc_c_tor_inserts.miss_opcode",
87 "Counter": "0,1,2,3",
88 "EventCode": "0x35",
89 "EventName": "LLC_MISSES.CODE_LLC_PREFETCH",
90 "Filter": "filter_opc=0x191",
91 "PerPkg": "1",
92 "ScaleUnit": "64Bytes",
93 "UMask": "0x3",
94 "Unit": "CBO"
95 },
96 {
97 "BriefDescription": "LLC prefetch misses for data reads. Derived from unc_c_tor_inserts.miss_opcode",
98 "Counter": "0,1,2,3",
99 "EventCode": "0x35",
100 "EventName": "LLC_MISSES.DATA_LLC_PREFETCH",
101 "Filter": "filter_opc=0x192",
102 "PerPkg": "1",
103 "ScaleUnit": "64Bytes",
104 "UMask": "0x3",
105 "Unit": "CBO"
106 },
107 {
108 "BriefDescription": "LLC misses for PCIe read current. Derived from unc_c_tor_inserts.miss_opcode",
109 "Counter": "0,1,2,3",
110 "EventCode": "0x35",
111 "EventName": "LLC_MISSES.PCIE_READ",
112 "Filter": "filter_opc=0x19e",
113 "PerPkg": "1",
114 "ScaleUnit": "64Bytes",
115 "UMask": "0x3",
116 "Unit": "CBO"
117 },
118 {
119 "BriefDescription": "ItoM write misses (as part of fast string memcpy stores) + PCIe full line writes. Derived from unc_c_tor_inserts.miss_opcode",
120 "Counter": "0,1,2,3",
121 "EventCode": "0x35",
122 "EventName": "LLC_MISSES.PCIE_WRITE",
123 "Filter": "filter_opc=0x1c8",
124 "PerPkg": "1",
125 "ScaleUnit": "64Bytes",
126 "UMask": "0x3",
127 "Unit": "CBO"
128 },
129 {
130 "BriefDescription": "PCIe write misses (full cache line). Derived from unc_c_tor_inserts.miss_opcode",
131 "Counter": "0,1,2,3",
132 "EventCode": "0x35",
133 "EventName": "LLC_MISSES.PCIE_NON_SNOOP_WRITE",
134 "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
135 "PerPkg": "1",
136 "ScaleUnit": "64Bytes",
137 "UMask": "0x3",
138 "Unit": "CBO"
139 },
140 {
141 "BriefDescription": "PCIe writes (partial cache line). Derived from unc_c_tor_inserts.opcode",
142 "Counter": "0,1,2,3",
143 "EventCode": "0x35",
144 "EventName": "LLC_REFERENCES.PCIE_NS_PARTIAL_WRITE",
145 "Filter": "filter_opc=0x180,filter_tid=0x3e",
146 "PerPkg": "1",
147 "UMask": "0x1",
148 "Unit": "CBO"
149 },
150 {
151 "BriefDescription": "L2 demand and L2 prefetch code references to LLC. Derived from unc_c_tor_inserts.opcode",
152 "Counter": "0,1,2,3",
153 "EventCode": "0x35",
154 "EventName": "LLC_REFERENCES.CODE_LLC_PREFETCH",
155 "Filter": "filter_opc=0x181",
156 "PerPkg": "1",
157 "ScaleUnit": "64Bytes",
158 "UMask": "0x1",
159 "Unit": "CBO"
160 },
161 {
162 "BriefDescription": "Streaming stores (full cache line). Derived from unc_c_tor_inserts.opcode",
163 "Counter": "0,1,2,3",
164 "EventCode": "0x35",
165 "EventName": "LLC_REFERENCES.STREAMING_FULL",
166 "Filter": "filter_opc=0x18c",
167 "PerPkg": "1",
168 "ScaleUnit": "64Bytes",
169 "UMask": "0x1",
170 "Unit": "CBO"
171 },
172 {
173 "BriefDescription": "Streaming stores (partial cache line). Derived from unc_c_tor_inserts.opcode",
174 "Counter": "0,1,2,3",
175 "EventCode": "0x35",
176 "EventName": "LLC_REFERENCES.STREAMING_PARTIAL",
177 "Filter": "filter_opc=0x18d",
178 "PerPkg": "1",
179 "ScaleUnit": "64Bytes",
180 "UMask": "0x1",
181 "Unit": "CBO"
182 },
183 {
184 "BriefDescription": "PCIe read current. Derived from unc_c_tor_inserts.opcode",
185 "Counter": "0,1,2,3",
186 "EventCode": "0x35",
187 "EventName": "LLC_REFERENCES.PCIE_READ",
188 "Filter": "filter_opc=0x19e",
189 "PerPkg": "1",
190 "ScaleUnit": "64Bytes",
191 "UMask": "0x1",
192 "Unit": "CBO"
193 },
194 {
195 "BriefDescription": "PCIe write references (full cache line). Derived from unc_c_tor_inserts.opcode",
196 "Counter": "0,1,2,3",
197 "EventCode": "0x35",
198 "EventName": "LLC_REFERENCES.PCIE_WRITE",
199 "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
200 "PerPkg": "1",
201 "ScaleUnit": "64Bytes",
202 "UMask": "0x1",
203 "Unit": "CBO"
204 },
205 {
206 "BriefDescription": "Occupancy counter for LLC data reads (demand and L2 prefetch). Derived from unc_c_tor_occupancy.miss_opcode",
207 "EventCode": "0x36",
208 "EventName": "UNC_C_TOR_OCCUPANCY.LLC_DATA_READ",
209 "Filter": "filter_opc=0x182",
210 "PerPkg": "1",
211 "UMask": "0x3",
212 "Unit": "CBO"
213 },
214 {
215 "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
216 "Counter": "0,1,2,3",
217 "EventCode": "0x1",
218 "EventName": "UNC_H_REQUESTS.READS",
219 "PerPkg": "1",
220 "UMask": "0x3",
221 "Unit": "HA"
222 },
223 {
224 "BriefDescription": "read requests to local home agent. Derived from unc_h_requests.reads_local",
225 "Counter": "0,1,2,3",
226 "EventCode": "0x1",
227 "EventName": "UNC_H_REQUESTS.READS_LOCAL",
228 "PerPkg": "1",
229 "UMask": "0x1",
230 "Unit": "HA"
231 },
232 {
233 "BriefDescription": "read requests to remote home agent. Derived from unc_h_requests.reads_remote",
234 "Counter": "0,1,2,3",
235 "EventCode": "0x1",
236 "EventName": "UNC_H_REQUESTS.READS_REMOTE",
237 "PerPkg": "1",
238 "UMask": "0x2",
239 "Unit": "HA"
240 },
241 {
242 "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
243 "Counter": "0,1,2,3",
244 "EventCode": "0x1",
245 "EventName": "UNC_H_REQUESTS.WRITES",
246 "PerPkg": "1",
247 "UMask": "0xC",
248 "Unit": "HA"
249 },
250 {
251 "BriefDescription": "write requests to local home agent. Derived from unc_h_requests.writes_local",
252 "Counter": "0,1,2,3",
253 "EventCode": "0x1",
254 "EventName": "UNC_H_REQUESTS.WRITES_LOCAL",
255 "PerPkg": "1",
256 "UMask": "0x4",
257 "Unit": "HA"
258 },
259 {
260 "BriefDescription": "write requests to remote home agent. Derived from unc_h_requests.writes_remote",
261 "Counter": "0,1,2,3",
262 "EventCode": "0x1",
263 "EventName": "UNC_H_REQUESTS.WRITES_REMOTE",
264 "PerPkg": "1",
265 "UMask": "0x8",
266 "Unit": "HA"
267 },
268 {
269 "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously). Derived from unc_h_snoop_resp.rspcnflct",
270 "Counter": "0,1,2,3",
271 "EventCode": "0x21",
272 "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT",
273 "PerPkg": "1",
274 "UMask": "0x40",
275 "Unit": "HA"
276 },
277 {
278 "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
279 "Counter": "0,1,2,3",
280 "EventCode": "0x21",
281 "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
282 "PerPkg": "1",
283 "ScaleUnit": "64Bytes",
284 "UMask": "0x20",
285 "Unit": "HA"
286 },
287 {
288 "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
289 "Counter": "0,1,2,3",
290 "EventCode": "0x21",
291 "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
292 "PerPkg": "1",
293 "ScaleUnit": "64Bytes",
294 "UMask": "0x4",
295 "Unit": "HA"
296 },
297 {
298 "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
299 "Counter": "0,1,2,3",
300 "EventCode": "0x21",
301 "EventName": "UNC_H_SNOOP_RESP.RSPS",
302 "PerPkg": "1",
303 "ScaleUnit": "64Bytes",
304 "UMask": "0x2",
305 "Unit": "HA"
306 },
307 {
308 "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
309 "Counter": "0,1,2,3",
310 "EventCode": "0x21",
311 "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
312 "PerPkg": "1",
313 "ScaleUnit": "64Bytes",
314 "UMask": "0x8",
315 "Unit": "HA"
316 }
317]
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json
new file mode 100644
index 000000000000..39387f7909b2
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-interconnect.json
@@ -0,0 +1,28 @@
1[
2 {
3 "BriefDescription": "QPI clock ticks. Derived from unc_q_clockticks",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x14",
6 "EventName": "UNC_Q_CLOCKTICKS",
7 "PerPkg": "1",
8 "Unit": "QPI LL"
9 },
10 {
11 "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
12 "Counter": "0,1,2,3",
13 "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
14 "PerPkg": "1",
15 "ScaleUnit": "8Bytes",
16 "UMask": "0x2",
17 "Unit": "QPI LL"
18 },
19 {
20 "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
21 "Counter": "0,1,2,3",
22 "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
23 "PerPkg": "1",
24 "ScaleUnit": "8Bytes",
25 "UMask": "0x4",
26 "Unit": "QPI LL"
27 }
28]
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json
new file mode 100644
index 000000000000..d17dc235f734
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-memory.json
@@ -0,0 +1,83 @@
1[
2 {
3 "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x4",
6 "EventName": "UNC_M_CAS_COUNT.RD",
7 "PerPkg": "1",
8 "ScaleUnit": "64Bytes",
9 "UMask": "0x3",
10 "Unit": "iMC"
11 },
12 {
13 "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
14 "Counter": "0,1,2,3",
15 "EventCode": "0x4",
16 "EventName": "UNC_M_CAS_COUNT.WR",
17 "PerPkg": "1",
18 "ScaleUnit": "64Bytes",
19 "UMask": "0xC",
20 "Unit": "iMC"
21 },
22 {
23 "BriefDescription": "Memory controller clock ticks. Derived from unc_m_clockticks",
24 "Counter": "0,1,2,3",
25 "EventName": "UNC_M_CLOCKTICKS",
26 "PerPkg": "1",
27 "Unit": "iMC"
28 },
29 {
30 "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
31 "Counter": "0,1,2,3",
32 "EventCode": "0x85",
33 "EventName": "UNC_M_POWER_CHANNEL_PPD",
34 "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
35 "PerPkg": "1",
36 "Unit": "iMC"
37 },
38 {
39 "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
40 "Counter": "0,1,2,3",
41 "EventCode": "0x86",
42 "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
43 "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
44 "PerPkg": "1",
45 "Unit": "iMC"
46 },
47 {
48 "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
49 "Counter": "0,1,2,3",
50 "EventCode": "0x43",
51 "EventName": "UNC_M_POWER_SELF_REFRESH",
52 "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
53 "PerPkg": "1",
54 "Unit": "iMC"
55 },
56 {
57 "BriefDescription": "Pre-charges due to page misses. Derived from unc_m_pre_count.page_miss",
58 "Counter": "0,1,2,3",
59 "EventCode": "0x2",
60 "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
61 "PerPkg": "1",
62 "UMask": "0x1",
63 "Unit": "iMC"
64 },
65 {
66 "BriefDescription": "Pre-charge for reads. Derived from unc_m_pre_count.rd",
67 "Counter": "0,1,2,3",
68 "EventCode": "0x2",
69 "EventName": "UNC_M_PRE_COUNT.RD",
70 "PerPkg": "1",
71 "UMask": "0x4",
72 "Unit": "iMC"
73 },
74 {
75 "BriefDescription": "Pre-charge for writes. Derived from unc_m_pre_count.wr",
76 "Counter": "0,1,2,3",
77 "EventCode": "0x2",
78 "EventName": "UNC_M_PRE_COUNT.WR",
79 "PerPkg": "1",
80 "UMask": "0x8",
81 "Unit": "iMC"
82 }
83]
diff --git a/tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json
new file mode 100644
index 000000000000..b44d43088bbb
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/broadwellx/uncore-power.json
@@ -0,0 +1,84 @@
1[
2 {
3 "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_P_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "PCU"
8 },
9 {
10 "BriefDescription": "C0 and C1. Derived from unc_p_power_state_occupancy.cores_c0",
11 "Counter": "0,1,2,3",
12 "EventCode": "0x80",
13 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
14 "Filter": "occ_sel=1",
15 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
16 "PerPkg": "1",
17 "Unit": "PCU"
18 },
19 {
20 "BriefDescription": "C3. Derived from unc_p_power_state_occupancy.cores_c3",
21 "Counter": "0,1,2,3",
22 "EventCode": "0x80",
23 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
24 "Filter": "occ_sel=2",
25 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
26 "PerPkg": "1",
27 "Unit": "PCU"
28 },
29 {
30 "BriefDescription": "C6 and C7. Derived from unc_p_power_state_occupancy.cores_c6",
31 "Counter": "0,1,2,3",
32 "EventCode": "0x80",
33 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
34 "Filter": "occ_sel=3",
35 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
36 "PerPkg": "1",
37 "Unit": "PCU"
38 },
39 {
40 "BriefDescription": "External Prochot. Derived from unc_p_prochot_external_cycles",
41 "Counter": "0,1,2,3",
42 "EventCode": "0xA",
43 "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
44 "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
45 "PerPkg": "1",
46 "Unit": "PCU"
47 },
48 {
49 "BriefDescription": "Thermal Strongest Upper Limit Cycles. Derived from unc_p_freq_max_limit_thermal_cycles",
50 "Counter": "0,1,2,3",
51 "EventCode": "0x4",
52 "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
53 "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
54 "PerPkg": "1",
55 "Unit": "PCU"
56 },
57 {
58 "BriefDescription": "OS Strongest Upper Limit Cycles. Derived from unc_p_freq_max_os_cycles",
59 "Counter": "0,1,2,3",
60 "EventCode": "0x6",
61 "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
62 "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
63 "PerPkg": "1",
64 "Unit": "PCU"
65 },
66 {
67 "BriefDescription": "Power Strongest Upper Limit Cycles. Derived from unc_p_freq_max_power_cycles",
68 "Counter": "0,1,2,3",
69 "EventCode": "0x5",
70 "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
71 "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
72 "PerPkg": "1",
73 "Unit": "PCU"
74 },
75 {
76 "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
77 "Counter": "0,1,2,3",
78 "EventCode": "0x74",
79 "EventName": "UNC_P_FREQ_TRANS_CYCLES",
80 "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
81 "PerPkg": "1",
82 "Unit": "PCU"
83 }
84]
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
new file mode 100644
index 000000000000..076459c51d4e
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-cache.json
@@ -0,0 +1,317 @@
1[
2 {
3 "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_C_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "CBO"
8 },
9 {
10 "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
11 "Counter": "0,1,2,3",
12 "EventCode": "0x34",
13 "EventName": "UNC_C_LLC_LOOKUP.ANY",
14 "Filter": "filter_state=0x1",
15 "PerPkg": "1",
16 "ScaleUnit": "64Bytes",
17 "UMask": "0x11",
18 "Unit": "CBO"
19 },
20 {
21 "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
22 "Counter": "0,1,2,3",
23 "EventCode": "0x37",
24 "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
25 "PerPkg": "1",
26 "ScaleUnit": "64Bytes",
27 "UMask": "0x1",
28 "Unit": "CBO"
29 },
30 {
31 "BriefDescription": "LLC misses - demand and prefetch data reads - excludes LLC prefetches. Derived from unc_c_tor_inserts.miss_opcode",
32 "Counter": "0,1,2,3",
33 "EventCode": "0x35",
34 "EventName": "LLC_MISSES.DATA_READ",
35 "Filter": "filter_opc=0x182",
36 "PerPkg": "1",
37 "ScaleUnit": "64Bytes",
38 "UMask": "0x3",
39 "Unit": "CBO"
40 },
41 {
42 "BriefDescription": "LLC misses - Uncacheable reads (from cpu) . Derived from unc_c_tor_inserts.miss_opcode",
43 "Counter": "0,1,2,3",
44 "EventCode": "0x35",
45 "EventName": "LLC_MISSES.UNCACHEABLE",
46 "Filter": "filter_opc=0x187",
47 "PerPkg": "1",
48 "ScaleUnit": "64Bytes",
49 "UMask": "0x3",
50 "Unit": "CBO"
51 },
52 {
53 "BriefDescription": "MMIO reads. Derived from unc_c_tor_inserts.miss_opcode",
54 "Counter": "0,1,2,3",
55 "EventCode": "0x35",
56 "EventName": "LLC_MISSES.MMIO_READ",
57 "Filter": "filter_opc=0x187,filter_nc=1",
58 "PerPkg": "1",
59 "ScaleUnit": "64Bytes",
60 "UMask": "0x3",
61 "Unit": "CBO"
62 },
63 {
64 "BriefDescription": "MMIO writes. Derived from unc_c_tor_inserts.miss_opcode",
65 "Counter": "0,1,2,3",
66 "EventCode": "0x35",
67 "EventName": "LLC_MISSES.MMIO_WRITE",
68 "Filter": "filter_opc=0x18f,filter_nc=1",
69 "PerPkg": "1",
70 "ScaleUnit": "64Bytes",
71 "UMask": "0x3",
72 "Unit": "CBO"
73 },
74 {
75 "BriefDescription": "LLC prefetch misses for RFO. Derived from unc_c_tor_inserts.miss_opcode",
76 "Counter": "0,1,2,3",
77 "EventCode": "0x35",
78 "EventName": "LLC_MISSES.RFO_LLC_PREFETCH",
79 "Filter": "filter_opc=0x190",
80 "PerPkg": "1",
81 "ScaleUnit": "64Bytes",
82 "UMask": "0x3",
83 "Unit": "CBO"
84 },
85 {
86 "BriefDescription": "LLC prefetch misses for code reads. Derived from unc_c_tor_inserts.miss_opcode",
87 "Counter": "0,1,2,3",
88 "EventCode": "0x35",
89 "EventName": "LLC_MISSES.CODE_LLC_PREFETCH",
90 "Filter": "filter_opc=0x191",
91 "PerPkg": "1",
92 "ScaleUnit": "64Bytes",
93 "UMask": "0x3",
94 "Unit": "CBO"
95 },
96 {
97 "BriefDescription": "LLC prefetch misses for data reads. Derived from unc_c_tor_inserts.miss_opcode",
98 "Counter": "0,1,2,3",
99 "EventCode": "0x35",
100 "EventName": "LLC_MISSES.DATA_LLC_PREFETCH",
101 "Filter": "filter_opc=0x192",
102 "PerPkg": "1",
103 "ScaleUnit": "64Bytes",
104 "UMask": "0x3",
105 "Unit": "CBO"
106 },
107 {
108 "BriefDescription": "LLC misses for PCIe read current. Derived from unc_c_tor_inserts.miss_opcode",
109 "Counter": "0,1,2,3",
110 "EventCode": "0x35",
111 "EventName": "LLC_MISSES.PCIE_READ",
112 "Filter": "filter_opc=0x19e",
113 "PerPkg": "1",
114 "ScaleUnit": "64Bytes",
115 "UMask": "0x3",
116 "Unit": "CBO"
117 },
118 {
119 "BriefDescription": "ItoM write misses (as part of fast string memcpy stores) + PCIe full line writes. Derived from unc_c_tor_inserts.miss_opcode",
120 "Counter": "0,1,2,3",
121 "EventCode": "0x35",
122 "EventName": "LLC_MISSES.PCIE_WRITE",
123 "Filter": "filter_opc=0x1c8",
124 "PerPkg": "1",
125 "ScaleUnit": "64Bytes",
126 "UMask": "0x3",
127 "Unit": "CBO"
128 },
129 {
130 "BriefDescription": "PCIe write misses (full cache line). Derived from unc_c_tor_inserts.miss_opcode",
131 "Counter": "0,1,2,3",
132 "EventCode": "0x35",
133 "EventName": "LLC_MISSES.PCIE_NON_SNOOP_WRITE",
134 "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
135 "PerPkg": "1",
136 "ScaleUnit": "64Bytes",
137 "UMask": "0x3",
138 "Unit": "CBO"
139 },
140 {
141 "BriefDescription": "PCIe writes (partial cache line). Derived from unc_c_tor_inserts.opcode",
142 "Counter": "0,1,2,3",
143 "EventCode": "0x35",
144 "EventName": "LLC_REFERENCES.PCIE_NS_PARTIAL_WRITE",
145 "Filter": "filter_opc=0x180,filter_tid=0x3e",
146 "PerPkg": "1",
147 "UMask": "0x1",
148 "Unit": "CBO"
149 },
150 {
151 "BriefDescription": "L2 demand and L2 prefetch code references to LLC. Derived from unc_c_tor_inserts.opcode",
152 "Counter": "0,1,2,3",
153 "EventCode": "0x35",
154 "EventName": "LLC_REFERENCES.CODE_LLC_PREFETCH",
155 "Filter": "filter_opc=0x181",
156 "PerPkg": "1",
157 "ScaleUnit": "64Bytes",
158 "UMask": "0x1",
159 "Unit": "CBO"
160 },
161 {
162 "BriefDescription": "Streaming stores (full cache line). Derived from unc_c_tor_inserts.opcode",
163 "Counter": "0,1,2,3",
164 "EventCode": "0x35",
165 "EventName": "LLC_REFERENCES.STREAMING_FULL",
166 "Filter": "filter_opc=0x18c",
167 "PerPkg": "1",
168 "ScaleUnit": "64Bytes",
169 "UMask": "0x1",
170 "Unit": "CBO"
171 },
172 {
173 "BriefDescription": "Streaming stores (partial cache line). Derived from unc_c_tor_inserts.opcode",
174 "Counter": "0,1,2,3",
175 "EventCode": "0x35",
176 "EventName": "LLC_REFERENCES.STREAMING_PARTIAL",
177 "Filter": "filter_opc=0x18d",
178 "PerPkg": "1",
179 "ScaleUnit": "64Bytes",
180 "UMask": "0x1",
181 "Unit": "CBO"
182 },
183 {
184 "BriefDescription": "PCIe read current. Derived from unc_c_tor_inserts.opcode",
185 "Counter": "0,1,2,3",
186 "EventCode": "0x35",
187 "EventName": "LLC_REFERENCES.PCIE_READ",
188 "Filter": "filter_opc=0x19e",
189 "PerPkg": "1",
190 "ScaleUnit": "64Bytes",
191 "UMask": "0x1",
192 "Unit": "CBO"
193 },
194 {
195 "BriefDescription": "PCIe write references (full cache line). Derived from unc_c_tor_inserts.opcode",
196 "Counter": "0,1,2,3",
197 "EventCode": "0x35",
198 "EventName": "LLC_REFERENCES.PCIE_WRITE",
199 "Filter": "filter_opc=0x1c8,filter_tid=0x3e",
200 "PerPkg": "1",
201 "ScaleUnit": "64Bytes",
202 "UMask": "0x1",
203 "Unit": "CBO"
204 },
205 {
206 "BriefDescription": "Occupancy counter for LLC data reads (demand and L2 prefetch). Derived from unc_c_tor_occupancy.miss_opcode",
207 "EventCode": "0x36",
208 "EventName": "UNC_C_TOR_OCCUPANCY.LLC_DATA_READ",
209 "Filter": "filter_opc=0x182",
210 "PerPkg": "1",
211 "UMask": "0x3",
212 "Unit": "CBO"
213 },
214 {
215 "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
216 "Counter": "0,1,2,3",
217 "EventCode": "0x1",
218 "EventName": "UNC_H_REQUESTS.READS",
219 "PerPkg": "1",
220 "UMask": "0x3",
221 "Unit": "HA"
222 },
223 {
224 "BriefDescription": "read requests to local home agent. Derived from unc_h_requests.reads_local",
225 "Counter": "0,1,2,3",
226 "EventCode": "0x1",
227 "EventName": "UNC_H_REQUESTS.READS_LOCAL",
228 "PerPkg": "1",
229 "UMask": "0x1",
230 "Unit": "HA"
231 },
232 {
233 "BriefDescription": "read requests to remote home agent. Derived from unc_h_requests.reads_remote",
234 "Counter": "0,1,2,3",
235 "EventCode": "0x1",
236 "EventName": "UNC_H_REQUESTS.READS_REMOTE",
237 "PerPkg": "1",
238 "UMask": "0x2",
239 "Unit": "HA"
240 },
241 {
242 "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
243 "Counter": "0,1,2,3",
244 "EventCode": "0x1",
245 "EventName": "UNC_H_REQUESTS.WRITES",
246 "PerPkg": "1",
247 "UMask": "0xC",
248 "Unit": "HA"
249 },
250 {
251 "BriefDescription": "write requests to local home agent. Derived from unc_h_requests.writes_local",
252 "Counter": "0,1,2,3",
253 "EventCode": "0x1",
254 "EventName": "UNC_H_REQUESTS.WRITES_LOCAL",
255 "PerPkg": "1",
256 "UMask": "0x4",
257 "Unit": "HA"
258 },
259 {
260 "BriefDescription": "write requests to remote home agent. Derived from unc_h_requests.writes_remote",
261 "Counter": "0,1,2,3",
262 "EventCode": "0x1",
263 "EventName": "UNC_H_REQUESTS.WRITES_REMOTE",
264 "PerPkg": "1",
265 "UMask": "0x8",
266 "Unit": "HA"
267 },
268 {
269 "BriefDescription": "Conflict requests (requests for same address from multiple agents simultaneously). Derived from unc_h_snoop_resp.rspcnflct",
270 "Counter": "0,1,2,3",
271 "EventCode": "0x21",
272 "EventName": "UNC_H_SNOOP_RESP.RSPCNFLCT",
273 "PerPkg": "1",
274 "UMask": "0x40",
275 "Unit": "HA"
276 },
277 {
278 "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
279 "Counter": "0,1,2,3",
280 "EventCode": "0x21",
281 "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
282 "PerPkg": "1",
283 "ScaleUnit": "64Bytes",
284 "UMask": "0x20",
285 "Unit": "HA"
286 },
287 {
288 "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
289 "Counter": "0,1,2,3",
290 "EventCode": "0x21",
291 "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
292 "PerPkg": "1",
293 "ScaleUnit": "64Bytes",
294 "UMask": "0x4",
295 "Unit": "HA"
296 },
297 {
298 "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
299 "Counter": "0,1,2,3",
300 "EventCode": "0x21",
301 "EventName": "UNC_H_SNOOP_RESP.RSPS",
302 "PerPkg": "1",
303 "ScaleUnit": "64Bytes",
304 "UMask": "0x2",
305 "Unit": "HA"
306 },
307 {
308 "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
309 "Counter": "0,1,2,3",
310 "EventCode": "0x21",
311 "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
312 "PerPkg": "1",
313 "ScaleUnit": "64Bytes",
314 "UMask": "0x8",
315 "Unit": "HA"
316 }
317]
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
new file mode 100644
index 000000000000..39387f7909b2
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-interconnect.json
@@ -0,0 +1,28 @@
1[
2 {
3 "BriefDescription": "QPI clock ticks. Derived from unc_q_clockticks",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x14",
6 "EventName": "UNC_Q_CLOCKTICKS",
7 "PerPkg": "1",
8 "Unit": "QPI LL"
9 },
10 {
11 "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
12 "Counter": "0,1,2,3",
13 "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
14 "PerPkg": "1",
15 "ScaleUnit": "8Bytes",
16 "UMask": "0x2",
17 "Unit": "QPI LL"
18 },
19 {
20 "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
21 "Counter": "0,1,2,3",
22 "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
23 "PerPkg": "1",
24 "ScaleUnit": "8Bytes",
25 "UMask": "0x4",
26 "Unit": "QPI LL"
27 }
28]
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
new file mode 100644
index 000000000000..d17dc235f734
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-memory.json
@@ -0,0 +1,83 @@
1[
2 {
3 "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x4",
6 "EventName": "UNC_M_CAS_COUNT.RD",
7 "PerPkg": "1",
8 "ScaleUnit": "64Bytes",
9 "UMask": "0x3",
10 "Unit": "iMC"
11 },
12 {
13 "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
14 "Counter": "0,1,2,3",
15 "EventCode": "0x4",
16 "EventName": "UNC_M_CAS_COUNT.WR",
17 "PerPkg": "1",
18 "ScaleUnit": "64Bytes",
19 "UMask": "0xC",
20 "Unit": "iMC"
21 },
22 {
23 "BriefDescription": "Memory controller clock ticks. Derived from unc_m_clockticks",
24 "Counter": "0,1,2,3",
25 "EventName": "UNC_M_CLOCKTICKS",
26 "PerPkg": "1",
27 "Unit": "iMC"
28 },
29 {
30 "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
31 "Counter": "0,1,2,3",
32 "EventCode": "0x85",
33 "EventName": "UNC_M_POWER_CHANNEL_PPD",
34 "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
35 "PerPkg": "1",
36 "Unit": "iMC"
37 },
38 {
39 "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
40 "Counter": "0,1,2,3",
41 "EventCode": "0x86",
42 "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
43 "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
44 "PerPkg": "1",
45 "Unit": "iMC"
46 },
47 {
48 "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
49 "Counter": "0,1,2,3",
50 "EventCode": "0x43",
51 "EventName": "UNC_M_POWER_SELF_REFRESH",
52 "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
53 "PerPkg": "1",
54 "Unit": "iMC"
55 },
56 {
57 "BriefDescription": "Pre-charges due to page misses. Derived from unc_m_pre_count.page_miss",
58 "Counter": "0,1,2,3",
59 "EventCode": "0x2",
60 "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
61 "PerPkg": "1",
62 "UMask": "0x1",
63 "Unit": "iMC"
64 },
65 {
66 "BriefDescription": "Pre-charge for reads. Derived from unc_m_pre_count.rd",
67 "Counter": "0,1,2,3",
68 "EventCode": "0x2",
69 "EventName": "UNC_M_PRE_COUNT.RD",
70 "PerPkg": "1",
71 "UMask": "0x4",
72 "Unit": "iMC"
73 },
74 {
75 "BriefDescription": "Pre-charge for writes. Derived from unc_m_pre_count.wr",
76 "Counter": "0,1,2,3",
77 "EventCode": "0x2",
78 "EventName": "UNC_M_PRE_COUNT.WR",
79 "PerPkg": "1",
80 "UMask": "0x8",
81 "Unit": "iMC"
82 }
83]
diff --git a/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json b/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
new file mode 100644
index 000000000000..b44d43088bbb
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/haswellx/uncore-power.json
@@ -0,0 +1,84 @@
1[
2 {
3 "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_P_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "PCU"
8 },
9 {
10 "BriefDescription": "C0 and C1. Derived from unc_p_power_state_occupancy.cores_c0",
11 "Counter": "0,1,2,3",
12 "EventCode": "0x80",
13 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
14 "Filter": "occ_sel=1",
15 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
16 "PerPkg": "1",
17 "Unit": "PCU"
18 },
19 {
20 "BriefDescription": "C3. Derived from unc_p_power_state_occupancy.cores_c3",
21 "Counter": "0,1,2,3",
22 "EventCode": "0x80",
23 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
24 "Filter": "occ_sel=2",
25 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
26 "PerPkg": "1",
27 "Unit": "PCU"
28 },
29 {
30 "BriefDescription": "C6 and C7. Derived from unc_p_power_state_occupancy.cores_c6",
31 "Counter": "0,1,2,3",
32 "EventCode": "0x80",
33 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
34 "Filter": "occ_sel=3",
35 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
36 "PerPkg": "1",
37 "Unit": "PCU"
38 },
39 {
40 "BriefDescription": "External Prochot. Derived from unc_p_prochot_external_cycles",
41 "Counter": "0,1,2,3",
42 "EventCode": "0xA",
43 "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
44 "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
45 "PerPkg": "1",
46 "Unit": "PCU"
47 },
48 {
49 "BriefDescription": "Thermal Strongest Upper Limit Cycles. Derived from unc_p_freq_max_limit_thermal_cycles",
50 "Counter": "0,1,2,3",
51 "EventCode": "0x4",
52 "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
53 "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
54 "PerPkg": "1",
55 "Unit": "PCU"
56 },
57 {
58 "BriefDescription": "OS Strongest Upper Limit Cycles. Derived from unc_p_freq_max_os_cycles",
59 "Counter": "0,1,2,3",
60 "EventCode": "0x6",
61 "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
62 "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
63 "PerPkg": "1",
64 "Unit": "PCU"
65 },
66 {
67 "BriefDescription": "Power Strongest Upper Limit Cycles. Derived from unc_p_freq_max_power_cycles",
68 "Counter": "0,1,2,3",
69 "EventCode": "0x5",
70 "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
71 "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
72 "PerPkg": "1",
73 "Unit": "PCU"
74 },
75 {
76 "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
77 "Counter": "0,1,2,3",
78 "EventCode": "0x74",
79 "EventName": "UNC_P_FREQ_TRANS_CYCLES",
80 "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
81 "PerPkg": "1",
82 "Unit": "PCU"
83 }
84]
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json
new file mode 100644
index 000000000000..2efdc6772e0b
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-cache.json
@@ -0,0 +1,322 @@
1[
2 {
3 "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_C_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "CBO"
8 },
9 {
10 "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
11 "Counter": "0,1",
12 "EventCode": "0x34",
13 "EventName": "UNC_C_LLC_LOOKUP.ANY",
14 "Filter": "filter_state=0x1",
15 "PerPkg": "1",
16 "ScaleUnit": "64Bytes",
17 "UMask": "0x11",
18 "Unit": "CBO"
19 },
20 {
21 "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
22 "Counter": "0,1",
23 "EventCode": "0x37",
24 "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
25 "PerPkg": "1",
26 "ScaleUnit": "64Bytes",
27 "UMask": "0x1",
28 "Unit": "CBO"
29 },
30 {
31 "BriefDescription": "LLC misses - demand and prefetch data reads - excludes LLC prefetches. Derived from unc_c_tor_inserts.miss_opcode.demand",
32 "Counter": "0,1",
33 "EventCode": "0x35",
34 "EventName": "LLC_MISSES.DATA_READ",
35 "Filter": "filter_opc=0x182",
36 "PerPkg": "1",
37 "ScaleUnit": "64Bytes",
38 "UMask": "0x3",
39 "Unit": "CBO"
40 },
41 {
42 "BriefDescription": "LLC misses - Uncacheable reads. Derived from unc_c_tor_inserts.miss_opcode.uncacheable",
43 "Counter": "0,1",
44 "EventCode": "0x35",
45 "EventName": "LLC_MISSES.UNCACHEABLE",
46 "Filter": "filter_opc=0x187",
47 "PerPkg": "1",
48 "ScaleUnit": "64Bytes",
49 "UMask": "0x3",
50 "Unit": "CBO"
51 },
52 {
53 "BriefDescription": "LLC prefetch misses for RFO. Derived from unc_c_tor_inserts.miss_opcode.rfo_prefetch",
54 "Counter": "0,1",
55 "EventCode": "0x35",
56 "EventName": "LLC_MISSES.RFO_LLC_PREFETCH",
57 "Filter": "filter_opc=0x190",
58 "PerPkg": "1",
59 "ScaleUnit": "64Bytes",
60 "UMask": "0x3",
61 "Unit": "CBO"
62 },
63 {
64 "BriefDescription": "LLC prefetch misses for code reads. Derived from unc_c_tor_inserts.miss_opcode.code",
65 "Counter": "0,1",
66 "EventCode": "0x35",
67 "EventName": "LLC_MISSES.CODE_LLC_PREFETCH",
68 "Filter": "filter_opc=0x191",
69 "PerPkg": "1",
70 "ScaleUnit": "64Bytes",
71 "UMask": "0x3",
72 "Unit": "CBO"
73 },
74 {
75 "BriefDescription": "LLC prefetch misses for data reads. Derived from unc_c_tor_inserts.miss_opcode.data_read",
76 "Counter": "0,1",
77 "EventCode": "0x35",
78 "EventName": "LLC_MISSES.DATA_LLC_PREFETCH",
79 "Filter": "filter_opc=0x192",
80 "PerPkg": "1",
81 "ScaleUnit": "64Bytes",
82 "UMask": "0x3",
83 "Unit": "CBO"
84 },
85 {
86 "BriefDescription": "PCIe allocating writes that miss LLC - DDIO misses. Derived from unc_c_tor_inserts.miss_opcode.ddio_miss",
87 "Counter": "0,1",
88 "EventCode": "0x35",
89 "EventName": "LLC_MISSES.PCIE_WRITE",
90 "Filter": "filter_opc=0x19c",
91 "PerPkg": "1",
92 "ScaleUnit": "64Bytes",
93 "UMask": "0x3",
94 "Unit": "CBO"
95 },
96 {
97 "BriefDescription": "LLC misses for PCIe read current. Derived from unc_c_tor_inserts.miss_opcode.pcie_read",
98 "Counter": "0,1",
99 "EventCode": "0x35",
100 "EventName": "LLC_MISSES.PCIE_READ",
101 "Filter": "filter_opc=0x19e",
102 "PerPkg": "1",
103 "ScaleUnit": "64Bytes",
104 "UMask": "0x3",
105 "Unit": "CBO"
106 },
107 {
108 "BriefDescription": "LLC misses for ItoM writes (as part of fast string memcpy stores). Derived from unc_c_tor_inserts.miss_opcode.itom_write",
109 "Counter": "0,1",
110 "EventCode": "0x35",
111 "EventName": "LLC_MISSES.ITOM_WRITE",
112 "Filter": "filter_opc=0x1c8",
113 "PerPkg": "1",
114 "ScaleUnit": "64Bytes",
115 "UMask": "0x3",
116 "Unit": "CBO"
117 },
118 {
119 "BriefDescription": "LLC misses for PCIe non-snoop reads. Derived from unc_c_tor_inserts.miss_opcode.pcie_read",
120 "Counter": "0,1",
121 "EventCode": "0x35",
122 "EventName": "LLC_MISSES.PCIE_NON_SNOOP_READ",
123 "Filter": "filter_opc=0x1e4",
124 "PerPkg": "1",
125 "ScaleUnit": "64Bytes",
126 "UMask": "0x3",
127 "Unit": "CBO"
128 },
129 {
130 "BriefDescription": "LLC misses for PCIe non-snoop writes (full line). Derived from unc_c_tor_inserts.miss_opcode.pcie_write",
131 "Counter": "0,1",
132 "EventCode": "0x35",
133 "EventName": "LLC_MISSES.PCIE_NON_SNOOP_WRITE",
134 "Filter": "filter_opc=0x1e6",
135 "PerPkg": "1",
136 "ScaleUnit": "64Bytes",
137 "UMask": "0x3",
138 "Unit": "CBO"
139 },
140 {
141 "BriefDescription": "Streaming stores (full cache line). Derived from unc_c_tor_inserts.opcode.streaming_full",
142 "Counter": "0,1",
143 "EventCode": "0x35",
144 "EventName": "LLC_REFERENCES.STREAMING_FULL",
145 "Filter": "filter_opc=0x18c",
146 "PerPkg": "1",
147 "ScaleUnit": "64Bytes",
148 "UMask": "0x1",
149 "Unit": "CBO"
150 },
151 {
152 "BriefDescription": "Streaming stores (partial cache line). Derived from unc_c_tor_inserts.opcode.streaming_partial",
153 "Counter": "0,1",
154 "EventCode": "0x35",
155 "EventName": "LLC_REFERENCES.STREAMING_PARTIAL",
156 "Filter": "filter_opc=0x18d",
157 "PerPkg": "1",
158 "ScaleUnit": "64Bytes",
159 "UMask": "0x1",
160 "Unit": "CBO"
161 },
162 {
163 "BriefDescription": "Partial PCIe reads. Derived from unc_c_tor_inserts.opcode.pcie_partial",
164 "Counter": "0,1",
165 "EventCode": "0x35",
166 "EventName": "LLC_REFERENCES.PCIE_PARTIAL_READ",
167 "Filter": "filter_opc=0x195",
168 "PerPkg": "1",
169 "ScaleUnit": "64Bytes",
170 "UMask": "0x1",
171 "Unit": "CBO"
172 },
173 {
174 "BriefDescription": "PCIe allocating writes that hit in LLC (DDIO hits). Derived from unc_c_tor_inserts.opcode.ddio_hit",
175 "Counter": "0,1",
176 "EventCode": "0x35",
177 "EventName": "LLC_REFERENCES.PCIE_WRITE",
178 "Filter": "filter_opc=0x19c",
179 "PerPkg": "1",
180 "ScaleUnit": "64Bytes",
181 "UMask": "0x1",
182 "Unit": "CBO"
183 },
184 {
185 "BriefDescription": "PCIe read current. Derived from unc_c_tor_inserts.opcode.pcie_read_current",
186 "Counter": "0,1",
187 "EventCode": "0x35",
188 "EventName": "LLC_REFERENCES.PCIE_READ",
189 "Filter": "filter_opc=0x19e",
190 "PerPkg": "1",
191 "ScaleUnit": "64Bytes",
192 "UMask": "0x1",
193 "Unit": "CBO"
194 },
195 {
196 "BriefDescription": "ItoM write hits (as part of fast string memcpy stores). Derived from unc_c_tor_inserts.opcode.itom_write_hit",
197 "Counter": "0,1",
198 "EventCode": "0x35",
199 "EventName": "LLC_REFERENCES.ITOM_WRITE",
200 "Filter": "filter_opc=0x1c8",
201 "PerPkg": "1",
202 "ScaleUnit": "64Bytes",
203 "UMask": "0x1",
204 "Unit": "CBO"
205 },
206 {
207 "BriefDescription": "PCIe non-snoop reads. Derived from unc_c_tor_inserts.opcode.pcie_read",
208 "Counter": "0,1",
209 "EventCode": "0x35",
210 "EventName": "LLC_REFERENCES.PCIE_NS_READ",
211 "Filter": "filter_opc=0x1e4",
212 "PerPkg": "1",
213 "ScaleUnit": "64Bytes",
214 "UMask": "0x1",
215 "Unit": "CBO"
216 },
217 {
218 "BriefDescription": "PCIe non-snoop writes (partial). Derived from unc_c_tor_inserts.opcode.pcie_partial_write",
219 "Counter": "0,1",
220 "EventCode": "0x35",
221 "EventName": "LLC_REFERENCES.PCIE_NS_PARTIAL_WRITE",
222 "Filter": "filter_opc=0x1e5",
223 "PerPkg": "1",
224 "ScaleUnit": "64Bytes",
225 "UMask": "0x1",
226 "Unit": "CBO"
227 },
228 {
229 "BriefDescription": "PCIe non-snoop writes (full line). Derived from unc_c_tor_inserts.opcode.pcie_full_write",
230 "Counter": "0,1",
231 "EventCode": "0x35",
232 "EventName": "LLC_REFERENCES.PCIE_NS_WRITE",
233 "Filter": "filter_opc=0x1e6",
234 "PerPkg": "1",
235 "ScaleUnit": "64Bytes",
236 "UMask": "0x1",
237 "Unit": "CBO"
238 },
239 {
240 "BriefDescription": "Occupancy for all LLC misses that are addressed to local memory. Derived from unc_c_tor_occupancy.miss_local",
241 "EventCode": "0x36",
242 "EventName": "UNC_C_TOR_OCCUPANCY.MISS_LOCAL",
243 "PerPkg": "1",
244 "UMask": "0x2A",
245 "Unit": "CBO"
246 },
247 {
248 "BriefDescription": "Occupancy counter for LLC data reads (demand and L2 prefetch). Derived from unc_c_tor_occupancy.miss_opcode.llc_data_read",
249 "EventCode": "0x36",
250 "EventName": "UNC_C_TOR_OCCUPANCY.LLC_DATA_READ",
251 "Filter": "filter_opc=0x182",
252 "PerPkg": "1",
253 "UMask": "0x3",
254 "Unit": "CBO"
255 },
256 {
257 "BriefDescription": "Occupancy for all LLC misses that are addressed to remote memory. Derived from unc_c_tor_occupancy.miss_remote",
258 "EventCode": "0x36",
259 "EventName": "UNC_C_TOR_OCCUPANCY.MISS_REMOTE",
260 "PerPkg": "1",
261 "UMask": "0x8A",
262 "Unit": "CBO"
263 },
264 {
265 "BriefDescription": "Read requests to home agent. Derived from unc_h_requests.reads",
266 "Counter": "0,1,2,3",
267 "EventCode": "0x1",
268 "EventName": "UNC_H_REQUESTS.READS",
269 "PerPkg": "1",
270 "UMask": "0x3",
271 "Unit": "HA"
272 },
273 {
274 "BriefDescription": "Write requests to home agent. Derived from unc_h_requests.writes",
275 "Counter": "0,1,2,3",
276 "EventCode": "0x1",
277 "EventName": "UNC_H_REQUESTS.WRITES",
278 "PerPkg": "1",
279 "UMask": "0xC",
280 "Unit": "HA"
281 },
282 {
283 "BriefDescription": "M line forwarded from remote cache along with writeback to memory. Derived from unc_h_snoop_resp.rsp_fwd_wb",
284 "Counter": "0,1,2,3",
285 "EventCode": "0x21",
286 "EventName": "UNC_H_SNOOP_RESP.RSP_FWD_WB",
287 "PerPkg": "1",
288 "ScaleUnit": "64Bytes",
289 "UMask": "0x20",
290 "Unit": "HA"
291 },
292 {
293 "BriefDescription": "M line forwarded from remote cache with no writeback to memory. Derived from unc_h_snoop_resp.rspifwd",
294 "Counter": "0,1,2,3",
295 "EventCode": "0x21",
296 "EventName": "UNC_H_SNOOP_RESP.RSPIFWD",
297 "PerPkg": "1",
298 "ScaleUnit": "64Bytes",
299 "UMask": "0x4",
300 "Unit": "HA"
301 },
302 {
303 "BriefDescription": "Shared line response from remote cache. Derived from unc_h_snoop_resp.rsps",
304 "Counter": "0,1,2,3",
305 "EventCode": "0x21",
306 "EventName": "UNC_H_SNOOP_RESP.RSPS",
307 "PerPkg": "1",
308 "ScaleUnit": "64Bytes",
309 "UMask": "0x2",
310 "Unit": "HA"
311 },
312 {
313 "BriefDescription": "Shared line forwarded from remote cache. Derived from unc_h_snoop_resp.rspsfwd",
314 "Counter": "0,1,2,3",
315 "EventCode": "0x21",
316 "EventName": "UNC_H_SNOOP_RESP.RSPSFWD",
317 "PerPkg": "1",
318 "ScaleUnit": "64Bytes",
319 "UMask": "0x8",
320 "Unit": "HA"
321 }
322]
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json
new file mode 100644
index 000000000000..d7e2fda1d695
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-interconnect.json
@@ -0,0 +1,46 @@
1[
2 {
3 "BriefDescription": "QPI clock ticks. Use to get percentages for QPI cycles events. Derived from unc_q_clockticks",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x14",
6 "EventName": "UNC_Q_CLOCKTICKS",
7 "PerPkg": "1",
8 "Unit": "QPI LL"
9 },
10 {
11 "BriefDescription": "Cycles where receiving QPI link is in half-width mode. Derived from unc_q_rxl0p_power_cycles",
12 "Counter": "0,1,2,3",
13 "EventCode": "0x10",
14 "EventName": "UNC_Q_RxL0P_POWER_CYCLES",
15 "MetricExpr": "(UNC_Q_RxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
16 "PerPkg": "1",
17 "Unit": "QPI LL"
18 },
19 {
20 "BriefDescription": "Cycles where transmitting QPI link is in half-width mode. Derived from unc_q_txl0p_power_cycles",
21 "Counter": "0,1,2,3",
22 "EventCode": "0xd",
23 "EventName": "UNC_Q_TxL0P_POWER_CYCLES",
24 "MetricExpr": "(UNC_Q_TxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
25 "PerPkg": "1",
26 "Unit": "QPI LL"
27 },
28 {
29 "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
30 "Counter": "0,1,2,3",
31 "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
32 "PerPkg": "1",
33 "ScaleUnit": "8Bytes",
34 "UMask": "0x2",
35 "Unit": "QPI LL"
36 },
37 {
38 "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
39 "Counter": "0,1,2,3",
40 "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
41 "PerPkg": "1",
42 "ScaleUnit": "8Bytes",
43 "UMask": "0x4",
44 "Unit": "QPI LL"
45 }
46]
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json
new file mode 100644
index 000000000000..ac4ad4d6357b
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-memory.json
@@ -0,0 +1,75 @@
1[
2 {
3 "BriefDescription": "Memory page activates for reads and writes. Derived from unc_m_act_count.rd",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x1",
6 "EventName": "UNC_M_ACT_COUNT.RD",
7 "PerPkg": "1",
8 "UMask": "0x1",
9 "Umask": "0x3",
10 "Unit": "iMC"
11 },
12 {
13 "BriefDescription": "Read requests to memory controller. Derived from unc_m_cas_count.rd",
14 "Counter": "0,1,2,3",
15 "EventCode": "0x4",
16 "EventName": "UNC_M_CAS_COUNT.RD",
17 "PerPkg": "1",
18 "ScaleUnit": "64Bytes",
19 "UMask": "0x3",
20 "Unit": "iMC"
21 },
22 {
23 "BriefDescription": "Write requests to memory controller. Derived from unc_m_cas_count.wr",
24 "Counter": "0,1,2,3",
25 "EventCode": "0x4",
26 "EventName": "UNC_M_CAS_COUNT.WR",
27 "PerPkg": "1",
28 "ScaleUnit": "64Bytes",
29 "UMask": "0xC",
30 "Unit": "iMC"
31 },
32 {
33 "BriefDescription": "Memory controller clock ticks. Use to generate percentages for memory controller CYCLES events. Derived from unc_m_clockticks",
34 "Counter": "0,1,2,3",
35 "EventName": "UNC_M_CLOCKTICKS",
36 "PerPkg": "1",
37 "Unit": "iMC"
38 },
39 {
40 "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
41 "Counter": "0,1,2,3",
42 "EventCode": "0x85",
43 "EventName": "UNC_M_POWER_CHANNEL_PPD",
44 "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
45 "PerPkg": "1",
46 "Unit": "iMC"
47 },
48 {
49 "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
50 "Counter": "0,1,2,3",
51 "EventCode": "0x86",
52 "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
53 "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
54 "PerPkg": "1",
55 "Unit": "iMC"
56 },
57 {
58 "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
59 "Counter": "0,1,2,3",
60 "EventCode": "0x43",
61 "EventName": "UNC_M_POWER_SELF_REFRESH",
62 "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
63 "PerPkg": "1",
64 "Unit": "iMC"
65 },
66 {
67 "BriefDescription": "Memory page conflicts. Derived from unc_m_pre_count.page_miss",
68 "Counter": "0,1,2,3",
69 "EventCode": "0x2",
70 "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
71 "PerPkg": "1",
72 "UMask": "0x1",
73 "Unit": "iMC"
74 }
75]
diff --git a/tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json b/tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json
new file mode 100644
index 000000000000..dc2586db0dfc
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json
@@ -0,0 +1,249 @@
1[
2 {
3 "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_P_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "PCU"
8 },
9 {
10 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band0=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band0_cycles",
11 "Counter": "0,1,2,3",
12 "EventCode": "0xb",
13 "EventName": "UNC_P_FREQ_BAND0_CYCLES",
14 "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
15 "PerPkg": "1",
16 "Unit": "PCU"
17 },
18 {
19 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band1=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band1_cycles",
20 "Counter": "0,1,2,3",
21 "EventCode": "0xc",
22 "EventName": "UNC_P_FREQ_BAND1_CYCLES",
23 "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
24 "PerPkg": "1",
25 "Unit": "PCU"
26 },
27 {
28 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band2=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band2_cycles",
29 "Counter": "0,1,2,3",
30 "EventCode": "0xd",
31 "EventName": "UNC_P_FREQ_BAND2_CYCLES",
32 "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
33 "PerPkg": "1",
34 "Unit": "PCU"
35 },
36 {
37 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band3_cycles",
38 "Counter": "0,1,2,3",
39 "EventCode": "0xe",
40 "EventName": "UNC_P_FREQ_BAND3_CYCLES",
41 "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
42 "PerPkg": "1",
43 "Unit": "PCU"
44 },
45 {
46 "BriefDescription": "Counts the number of times that the uncore transitioned a frequency greater than or equal to the frequency that is configured in the filter. (filter_band0=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band0_cycles",
47 "Counter": "0,1,2,3",
48 "EventCode": "0xb",
49 "EventName": "UNC_P_FREQ_BAND0_TRANSITIONS",
50 "Filter": "edge=1",
51 "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
52 "PerPkg": "1",
53 "Unit": "PCU"
54 },
55 {
56 "BriefDescription": "Counts the number of times that the uncore transitioned to a frequency greater than or equal to the frequency that is configured in the filter. (filter_band1=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band1_cycles",
57 "Counter": "0,1,2,3",
58 "EventCode": "0xc",
59 "EventName": "UNC_P_FREQ_BAND1_TRANSITIONS",
60 "Filter": "edge=1",
61 "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
62 "PerPkg": "1",
63 "Unit": "PCU"
64 },
65 {
66 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to the frequency that is configured in the filter. (filter_band2=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band2_cycles",
67 "Counter": "0,1,2,3",
68 "EventCode": "0xd",
69 "EventName": "UNC_P_FREQ_BAND2_TRANSITIONS",
70 "Filter": "edge=1",
71 "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
72 "PerPkg": "1",
73 "Unit": "PCU"
74 },
75 {
76 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to the frequency that is configured in the filter. (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band3_cycles",
77 "Counter": "0,1,2,3",
78 "EventCode": "0xe",
79 "EventName": "UNC_P_FREQ_BAND3_TRANSITIONS",
80 "Filter": "edge=1",
81 "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
82 "PerPkg": "1",
83 "Unit": "PCU"
84 },
85 {
86 "BriefDescription": "This is an occupancy event that tracks the number of cores that are in the chosen C-State. It can be used by itself to get the average number of cores in that C-state with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c0",
87 "Counter": "0,1,2,3",
88 "EventCode": "0x80",
89 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
90 "Filter": "occ_sel=1",
91 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
92 "PerPkg": "1",
93 "Unit": "PCU"
94 },
95 {
96 "BriefDescription": "This is an occupancy event that tracks the number of cores that are in the chosen C-State. It can be used by itself to get the average number of cores in that C-state with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c3",
97 "Counter": "0,1,2,3",
98 "EventCode": "0x80",
99 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
100 "Filter": "occ_sel=2",
101 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
102 "PerPkg": "1",
103 "Unit": "PCU"
104 },
105 {
106 "BriefDescription": "This is an occupancy event that tracks the number of cores that are in the chosen C-State. It can be used by itself to get the average number of cores in that C-state with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c6",
107 "Counter": "0,1,2,3",
108 "EventCode": "0x80",
109 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
110 "Filter": "occ_sel=3",
111 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
112 "PerPkg": "1",
113 "Unit": "PCU"
114 },
115 {
116 "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode. This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip. Derived from unc_p_prochot_external_cycles",
117 "Counter": "0,1,2,3",
118 "EventCode": "0xa",
119 "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
120 "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
121 "PerPkg": "1",
122 "Unit": "PCU"
123 },
124 {
125 "BriefDescription": "Counts the number of cycles when thermal conditions are the upper limit on frequency. This is related to the THERMAL_THROTTLE CYCLES_ABOVE_TEMP event, which always counts cycles when we are above the thermal temperature. This event (STRONGEST_UPPER_LIMIT) is sampled at the output of the algorithm that determines the actual frequency, while THERMAL_THROTTLE looks at the input. Derived from unc_p_freq_max_limit_thermal_cycles",
126 "Counter": "0,1,2,3",
127 "EventCode": "0x4",
128 "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
129 "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
130 "PerPkg": "1",
131 "Unit": "PCU"
132 },
133 {
134 "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency. Derived from unc_p_freq_max_os_cycles",
135 "Counter": "0,1,2,3",
136 "EventCode": "0x6",
137 "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
138 "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
139 "PerPkg": "1",
140 "Unit": "PCU"
141 },
142 {
143 "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency. Derived from unc_p_freq_max_power_cycles",
144 "Counter": "0,1,2,3",
145 "EventCode": "0x5",
146 "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
147 "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
148 "PerPkg": "1",
149 "Unit": "PCU"
150 },
151 {
152 "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency. Derived from unc_p_freq_max_current_cycles",
153 "Counter": "0,1,2,3",
154 "EventCode": "0x7",
155 "EventName": "UNC_P_FREQ_MAX_CURRENT_CYCLES",
156 "MetricExpr": "(UNC_P_FREQ_MAX_CURRENT_CYCLES / UNC_P_CLOCKTICKS) * 100.",
157 "PerPkg": "1",
158 "Unit": "PCU"
159 },
160 {
161 "BriefDescription": "Counts the number of cycles when the system is changing frequency. This can not be filtered by thread ID. One can also use it with the occupancy counter that monitors number of threads in C0 to estimate the performance impact that frequency transitions had on the system. Derived from unc_p_freq_trans_cycles",
162 "Counter": "0,1,2,3",
163 "EventCode": "0x60",
164 "EventName": "UNC_P_FREQ_TRANS_CYCLES",
165 "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
166 "PerPkg": "1",
167 "Unit": "PCU"
168 },
169 {
170 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 1.2Ghz. Derived from unc_p_freq_band0_cycles",
171 "Counter": "0,1,2,3",
172 "EventCode": "0xb",
173 "EventName": "UNC_P_FREQ_GE_1200MHZ_CYCLES",
174 "Filter": "filter_band0=1200",
175 "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
176 "PerPkg": "1",
177 "Unit": "PCU"
178 },
179 {
180 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 2Ghz. Derived from unc_p_freq_band1_cycles",
181 "Counter": "0,1,2,3",
182 "EventCode": "0xc",
183 "EventName": "UNC_P_FREQ_GE_2000MHZ_CYCLES",
184 "Filter": "filter_band1=2000",
185 "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
186 "PerPkg": "1",
187 "Unit": "PCU"
188 },
189 {
190 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 3Ghz. Derived from unc_p_freq_band2_cycles",
191 "Counter": "0,1,2,3",
192 "EventCode": "0xd",
193 "EventName": "UNC_P_FREQ_GE_3000MHZ_CYCLES",
194 "Filter": "filter_band2=3000",
195 "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
196 "PerPkg": "1",
197 "Unit": "PCU"
198 },
199 {
200 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 4Ghz. Derived from unc_p_freq_band3_cycles",
201 "Counter": "0,1,2,3",
202 "EventCode": "0xe",
203 "EventName": "UNC_P_FREQ_GE_4000MHZ_CYCLES",
204 "Filter": "filter_band3=4000",
205 "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
206 "PerPkg": "1",
207 "Unit": "PCU"
208 },
209 {
210 "BriefDescription": "Counts the number of times that the uncore transitioned to a frequency greater than or equal to 1.2Ghz. Derived from unc_p_freq_band0_cycles",
211 "Counter": "0,1,2,3",
212 "EventCode": "0xb",
213 "EventName": "UNC_P_FREQ_GE_1200MHZ_TRANSITIONS",
214 "Filter": "edge=1,filter_band0=1200",
215 "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
216 "PerPkg": "1",
217 "Unit": "PCU"
218 },
219 {
220 "BriefDescription": "Counts the number of times that the uncore transitioned to a frequency greater than or equal to 2Ghz. Derived from unc_p_freq_band1_cycles",
221 "Counter": "0,1,2,3",
222 "EventCode": "0xc",
223 "EventName": "UNC_P_FREQ_GE_2000MHZ_TRANSITIONS",
224 "Filter": "edge=1,filter_band1=2000",
225 "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
226 "PerPkg": "1",
227 "Unit": "PCU"
228 },
229 {
230 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to 3Ghz. Derived from unc_p_freq_band2_cycles",
231 "Counter": "0,1,2,3",
232 "EventCode": "0xd",
233 "EventName": "UNC_P_FREQ_GE_3000MHZ_TRANSITIONS",
234 "Filter": "edge=1,filter_band2=4000",
235 "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
236 "PerPkg": "1",
237 "Unit": "PCU"
238 },
239 {
240 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to 4Ghz. Derived from unc_p_freq_band3_cycles",
241 "Counter": "0,1,2,3",
242 "EventCode": "0xe",
243 "EventName": "UNC_P_FREQ_GE_4000MHZ_TRANSITIONS",
244 "Filter": "edge=1,filter_band3=4000",
245 "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
246 "PerPkg": "1",
247 "Unit": "PCU"
248 }
249]
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json
new file mode 100644
index 000000000000..2f23cf0129e7
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-cache.json
@@ -0,0 +1,209 @@
1[
2 {
3 "BriefDescription": "Uncore cache clock ticks. Derived from unc_c_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_C_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "CBO"
8 },
9 {
10 "BriefDescription": "All LLC Misses (code+ data rd + data wr - including demand and prefetch). Derived from unc_c_llc_lookup.any",
11 "Counter": "0,1",
12 "EventCode": "0x34",
13 "EventName": "UNC_C_LLC_LOOKUP.ANY",
14 "Filter": "filter_state=0x1",
15 "PerPkg": "1",
16 "ScaleUnit": "64Bytes",
17 "UMask": "0x11",
18 "Unit": "CBO"
19 },
20 {
21 "BriefDescription": "M line evictions from LLC (writebacks to memory). Derived from unc_c_llc_victims.m_state",
22 "Counter": "0,1",
23 "EventCode": "0x37",
24 "EventName": "UNC_C_LLC_VICTIMS.M_STATE",
25 "PerPkg": "1",
26 "ScaleUnit": "64Bytes",
27 "UMask": "0x1",
28 "Unit": "CBO"
29 },
30 {
31 "BriefDescription": "LLC misses - demand and prefetch data reads - excludes LLC prefetches. Derived from unc_c_tor_inserts.miss_opcode.demand",
32 "Counter": "0,1",
33 "EventCode": "0x35",
34 "EventName": "LLC_MISSES.DATA_READ",
35 "Filter": "filter_opc=0x182",
36 "PerPkg": "1",
37 "ScaleUnit": "64Bytes",
38 "UMask": "0x3",
39 "Unit": "CBO"
40 },
41 {
42 "BriefDescription": "LLC misses - Uncacheable reads. Derived from unc_c_tor_inserts.miss_opcode.uncacheable",
43 "Counter": "0,1",
44 "EventCode": "0x35",
45 "EventName": "LLC_MISSES.UNCACHEABLE",
46 "Filter": "filter_opc=0x187",
47 "PerPkg": "1",
48 "ScaleUnit": "64Bytes",
49 "UMask": "0x3",
50 "Unit": "CBO"
51 },
52 {
53 "BriefDescription": "PCIe allocating writes that miss LLC - DDIO misses. Derived from unc_c_tor_inserts.miss_opcode.ddio_miss",
54 "Counter": "0,1",
55 "EventCode": "0x35",
56 "EventName": "LLC_MISSES.PCIE_WRITE",
57 "Filter": "filter_opc=0x19c",
58 "PerPkg": "1",
59 "ScaleUnit": "64Bytes",
60 "UMask": "0x3",
61 "Unit": "CBO"
62 },
63 {
64 "BriefDescription": "LLC misses for ItoM writes (as part of fast string memcpy stores). Derived from unc_c_tor_inserts.miss_opcode.itom_write",
65 "Counter": "0,1",
66 "EventCode": "0x35",
67 "EventName": "LLC_MISSES.ITOM_WRITE",
68 "Filter": "filter_opc=0x1c8",
69 "PerPkg": "1",
70 "ScaleUnit": "64Bytes",
71 "UMask": "0x3",
72 "Unit": "CBO"
73 },
74 {
75 "BriefDescription": "Streaming stores (full cache line). Derived from unc_c_tor_inserts.opcode.streaming_full",
76 "Counter": "0,1",
77 "EventCode": "0x35",
78 "EventName": "LLC_REFERENCES.STREAMING_FULL",
79 "Filter": "filter_opc=0x18c",
80 "PerPkg": "1",
81 "ScaleUnit": "64Bytes",
82 "UMask": "0x1",
83 "Unit": "CBO"
84 },
85 {
86 "BriefDescription": "Streaming stores (partial cache line). Derived from unc_c_tor_inserts.opcode.streaming_partial",
87 "Counter": "0,1",
88 "EventCode": "0x35",
89 "EventName": "LLC_REFERENCES.STREAMING_PARTIAL",
90 "Filter": "filter_opc=0x18d",
91 "PerPkg": "1",
92 "ScaleUnit": "64Bytes",
93 "UMask": "0x1",
94 "Unit": "CBO"
95 },
96 {
97 "BriefDescription": "Partial PCIe reads. Derived from unc_c_tor_inserts.opcode.pcie_partial",
98 "Counter": "0,1",
99 "EventCode": "0x35",
100 "EventName": "LLC_REFERENCES.PCIE_PARTIAL_READ",
101 "Filter": "filter_opc=0x195",
102 "PerPkg": "1",
103 "ScaleUnit": "64Bytes",
104 "UMask": "0x1",
105 "Unit": "CBO"
106 },
107 {
108 "BriefDescription": "PCIe allocating writes that hit in LLC (DDIO hits). Derived from unc_c_tor_inserts.opcode.ddio_hit",
109 "Counter": "0,1",
110 "EventCode": "0x35",
111 "EventName": "LLC_REFERENCES.PCIE_WRITE",
112 "Filter": "filter_opc=0x19c",
113 "PerPkg": "1",
114 "ScaleUnit": "64Bytes",
115 "UMask": "0x1",
116 "Unit": "CBO"
117 },
118 {
119 "BriefDescription": "PCIe read current. Derived from unc_c_tor_inserts.opcode.pcie_read_current",
120 "Counter": "0,1",
121 "EventCode": "0x35",
122 "EventName": "LLC_REFERENCES.PCIE_READ",
123 "Filter": "filter_opc=0x19e",
124 "PerPkg": "1",
125 "ScaleUnit": "64Bytes",
126 "UMask": "0x1",
127 "Unit": "CBO"
128 },
129 {
130 "BriefDescription": "ItoM write hits (as part of fast string memcpy stores). Derived from unc_c_tor_inserts.opcode.itom_write_hit",
131 "Counter": "0,1",
132 "EventCode": "0x35",
133 "EventName": "LLC_REFERENCES.ITOM_WRITE",
134 "Filter": "filter_opc=0x1c8",
135 "PerPkg": "1",
136 "ScaleUnit": "64Bytes",
137 "UMask": "0x1",
138 "Unit": "CBO"
139 },
140 {
141 "BriefDescription": "PCIe non-snoop reads. Derived from unc_c_tor_inserts.opcode.pcie_read",
142 "Counter": "0,1",
143 "EventCode": "0x35",
144 "EventName": "LLC_REFERENCES.PCIE_NS_READ",
145 "Filter": "filter_opc=0x1e4",
146 "PerPkg": "1",
147 "ScaleUnit": "64Bytes",
148 "UMask": "0x1",
149 "Unit": "CBO"
150 },
151 {
152 "BriefDescription": "PCIe non-snoop writes (partial). Derived from unc_c_tor_inserts.opcode.pcie_partial_write",
153 "Counter": "0,1",
154 "EventCode": "0x35",
155 "EventName": "LLC_REFERENCES.PCIE_NS_PARTIAL_WRITE",
156 "Filter": "filter_opc=0x1e5",
157 "PerPkg": "1",
158 "ScaleUnit": "64Bytes",
159 "UMask": "0x1",
160 "Unit": "CBO"
161 },
162 {
163 "BriefDescription": "PCIe non-snoop writes (full line). Derived from unc_c_tor_inserts.opcode.pcie_full_write",
164 "Counter": "0,1",
165 "EventCode": "0x35",
166 "EventName": "LLC_REFERENCES.PCIE_NS_WRITE",
167 "Filter": "filter_opc=0x1e6",
168 "PerPkg": "1",
169 "ScaleUnit": "64Bytes",
170 "UMask": "0x1",
171 "Unit": "CBO"
172 },
173 {
174 "BriefDescription": "Occupancy counter for all LLC misses; we divide this by UNC_C_CLOCKTICKS to get average Q depth. Derived from unc_c_tor_occupancy.miss_all",
175 "EventCode": "0x36",
176 "EventName": "UNC_C_TOR_OCCUPANCY.MISS_ALL",
177 "Filter": "filter_opc=0x182",
178 "MetricExpr": "(UNC_C_TOR_OCCUPANCY.MISS_ALL / UNC_C_CLOCKTICKS) * 100.",
179 "PerPkg": "1",
180 "UMask": "0xa",
181 "Unit": "CBO"
182 },
183 {
184 "BriefDescription": "Occupancy counter for LLC data reads (demand and L2 prefetch). Derived from unc_c_tor_occupancy.miss_opcode.llc_data_read",
185 "EventCode": "0x36",
186 "EventName": "UNC_C_TOR_OCCUPANCY.LLC_DATA_READ",
187 "PerPkg": "1",
188 "UMask": "0x3",
189 "Unit": "CBO"
190 },
191 {
192 "BriefDescription": "read requests to home agent. Derived from unc_h_requests.reads",
193 "Counter": "0,1,2,3",
194 "EventCode": "0x1",
195 "EventName": "UNC_H_REQUESTS.READS",
196 "PerPkg": "1",
197 "UMask": "0x3",
198 "Unit": "HA"
199 },
200 {
201 "BriefDescription": "write requests to home agent. Derived from unc_h_requests.writes",
202 "Counter": "0,1,2,3",
203 "EventCode": "0x1",
204 "EventName": "UNC_H_REQUESTS.WRITES",
205 "PerPkg": "1",
206 "UMask": "0xc",
207 "Unit": "HA"
208 }
209]
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json
new file mode 100644
index 000000000000..63351876eb57
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-interconnect.json
@@ -0,0 +1,46 @@
1[
2 {
3 "BriefDescription": "QPI clock ticks. Used to get percentages of QPI cycles events. Derived from unc_q_clockticks",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x14",
6 "EventName": "UNC_Q_CLOCKTICKS",
7 "PerPkg": "1",
8 "Unit": "QPI LL"
9 },
10 {
11 "BriefDescription": "Cycles where receiving QPI link is in half-width mode. Derived from unc_q_rxl0p_power_cycles",
12 "Counter": "0,1,2,3",
13 "EventCode": "0x10",
14 "EventName": "UNC_Q_RxL0P_POWER_CYCLES",
15 "MetricExpr": "(UNC_Q_RxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
16 "PerPkg": "1",
17 "Unit": "QPI LL"
18 },
19 {
20 "BriefDescription": "Cycles where transmitting QPI link is in half-width mode. Derived from unc_q_txl0p_power_cycles",
21 "Counter": "0,1,2,3",
22 "EventCode": "0xd",
23 "EventName": "UNC_Q_TxL0P_POWER_CYCLES",
24 "MetricExpr": "(UNC_Q_TxL0P_POWER_CYCLES / UNC_Q_CLOCKTICKS) * 100.",
25 "PerPkg": "1",
26 "Unit": "QPI LL"
27 },
28 {
29 "BriefDescription": "Number of data flits transmitted . Derived from unc_q_txl_flits_g0.data",
30 "Counter": "0,1,2,3",
31 "EventName": "UNC_Q_TxL_FLITS_G0.DATA",
32 "PerPkg": "1",
33 "ScaleUnit": "8Bytes",
34 "UMask": "0x2",
35 "Unit": "QPI LL"
36 },
37 {
38 "BriefDescription": "Number of non data (control) flits transmitted . Derived from unc_q_txl_flits_g0.non_data",
39 "Counter": "0,1,2,3",
40 "EventName": "UNC_Q_TxL_FLITS_G0.NON_DATA",
41 "PerPkg": "1",
42 "ScaleUnit": "8Bytes",
43 "UMask": "0x4",
44 "Unit": "QPI LL"
45 }
46]
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json
new file mode 100644
index 000000000000..e2cf6daa7b37
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-memory.json
@@ -0,0 +1,79 @@
1[
2 {
3 "BriefDescription": "Memory page activates. Derived from unc_m_act_count",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x1",
6 "EventName": "UNC_M_ACT_COUNT",
7 "PerPkg": "1",
8 "Unit": "iMC"
9 },
10 {
11 "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd",
12 "Counter": "0,1,2,3",
13 "EventCode": "0x4",
14 "EventName": "UNC_M_CAS_COUNT.RD",
15 "PerPkg": "1",
16 "UMask": "0x3",
17 "Unit": "iMC"
18 },
19 {
20 "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr",
21 "Counter": "0,1,2,3",
22 "EventCode": "0x4",
23 "EventName": "UNC_M_CAS_COUNT.WR",
24 "PerPkg": "1",
25 "UMask": "0xc",
26 "Unit": "iMC"
27 },
28 {
29 "BriefDescription": "Memory controller clock ticks. Used to get percentages of memory controller cycles events. Derived from unc_m_clockticks",
30 "Counter": "0,1,2,3",
31 "EventName": "UNC_M_CLOCKTICKS",
32 "PerPkg": "1",
33 "Unit": "iMC"
34 },
35 {
36 "BriefDescription": "Cycles where DRAM ranks are in power down (CKE) mode. Derived from unc_m_power_channel_ppd",
37 "Counter": "0,1,2,3",
38 "EventCode": "0x85",
39 "EventName": "UNC_M_POWER_CHANNEL_PPD",
40 "MetricExpr": "(UNC_M_POWER_CHANNEL_PPD / UNC_M_CLOCKTICKS) * 100.",
41 "PerPkg": "1",
42 "Unit": "iMC"
43 },
44 {
45 "BriefDescription": "Cycles all ranks are in critical thermal throttle. Derived from unc_m_power_critical_throttle_cycles",
46 "Counter": "0,1,2,3",
47 "EventCode": "0x86",
48 "EventName": "UNC_M_POWER_CRITICAL_THROTTLE_CYCLES",
49 "MetricExpr": "(UNC_M_POWER_CRITICAL_THROTTLE_CYCLES / UNC_M_CLOCKTICKS) * 100.",
50 "PerPkg": "1",
51 "Unit": "iMC"
52 },
53 {
54 "BriefDescription": "Cycles Memory is in self refresh power mode. Derived from unc_m_power_self_refresh",
55 "Counter": "0,1,2,3",
56 "EventCode": "0x43",
57 "EventName": "UNC_M_POWER_SELF_REFRESH",
58 "MetricExpr": "(UNC_M_POWER_SELF_REFRESH / UNC_M_CLOCKTICKS) * 100.",
59 "PerPkg": "1",
60 "Unit": "iMC"
61 },
62 {
63 "BriefDescription": "Memory page conflicts. Derived from unc_m_pre_count.page_miss",
64 "Counter": "0,1,2,3",
65 "EventCode": "0x2",
66 "EventName": "UNC_M_PRE_COUNT.PAGE_MISS",
67 "PerPkg": "1",
68 "UMask": "0x1",
69 "Unit": "iMC"
70 },
71 {
72 "BriefDescription": "Occupancy counter for memory read queue. Derived from unc_m_rpq_occupancy",
73 "Counter": "0,1,2,3",
74 "EventCode": "0x80",
75 "EventName": "UNC_M_RPQ_OCCUPANCY",
76 "PerPkg": "1",
77 "Unit": "iMC"
78 }
79]
diff --git a/tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json b/tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json
new file mode 100644
index 000000000000..bbe36d547386
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json
@@ -0,0 +1,248 @@
1[
2 {
3 "BriefDescription": "PCU clock ticks. Use to get percentages of PCU cycles events. Derived from unc_p_clockticks",
4 "Counter": "0,1,2,3",
5 "EventName": "UNC_P_CLOCKTICKS",
6 "PerPkg": "1",
7 "Unit": "PCU"
8 },
9 {
10 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band0=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band0_cycles",
11 "Counter": "0,1,2,3",
12 "EventCode": "0xb",
13 "EventName": "UNC_P_FREQ_BAND0_CYCLES",
14 "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
15 "PerPkg": "1",
16 "Unit": "PCU"
17 },
18 {
19 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band1=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band1_cycles",
20 "Counter": "0,1,2,3",
21 "EventCode": "0xc",
22 "EventName": "UNC_P_FREQ_BAND1_CYCLES",
23 "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
24 "PerPkg": "1",
25 "Unit": "PCU"
26 },
27 {
28 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band2=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band2_cycles",
29 "Counter": "0,1,2,3",
30 "EventCode": "0xd",
31 "EventName": "UNC_P_FREQ_BAND2_CYCLES",
32 "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
33 "PerPkg": "1",
34 "Unit": "PCU"
35 },
36 {
37 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to the frequency that is configured in the filter. (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band3_cycles",
38 "Counter": "0,1,2,3",
39 "EventCode": "0xe",
40 "EventName": "UNC_P_FREQ_BAND3_CYCLES",
41 "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
42 "PerPkg": "1",
43 "Unit": "PCU"
44 },
45 {
46 "BriefDescription": "Counts the number of times that the uncore transitioned a frequency greater than or equal to the frequency that is configured in the filter. (filter_band0=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band0_cycles",
47 "Counter": "0,1,2,3",
48 "EventCode": "0xb",
49 "EventName": "UNC_P_FREQ_BAND0_TRANSITIONS",
50 "Filter": "edge=1",
51 "MetricExpr": "(UNC_P_FREQ_BAND0_CYCLES / UNC_P_CLOCKTICKS) * 100.",
52 "PerPkg": "1",
53 "Unit": "PCU"
54 },
55 {
56 "BriefDescription": "Counts the number of times that the uncore transistioned to a frequency greater than or equal to the frequency that is configured in the filter. (filter_band1=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band1_cycles",
57 "Counter": "0,1,2,3",
58 "EventCode": "0xc",
59 "EventName": "UNC_P_FREQ_BAND1_TRANSITIONS",
60 "Filter": "edge=1",
61 "MetricExpr": "(UNC_P_FREQ_BAND1_CYCLES / UNC_P_CLOCKTICKS) * 100.",
62 "PerPkg": "1",
63 "Unit": "PCU"
64 },
65 {
66 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to the frequency that is configured in the filter. (filter_band2=XXX with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band2_cycles",
67 "Counter": "0,1,2,3",
68 "EventCode": "0xd",
69 "EventName": "UNC_P_FREQ_BAND2_TRANSITIONS",
70 "Filter": "edge=1",
71 "MetricExpr": "(UNC_P_FREQ_BAND2_CYCLES / UNC_P_CLOCKTICKS) * 100.",
72 "PerPkg": "1",
73 "Unit": "PCU"
74 },
75 {
76 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to the frequency that is configured in the filter. (filter_band3=XXX, with XXX in 100Mhz units). One can also use inversion (filter_inv=1) to track cycles when we were less than the configured frequency. Derived from unc_p_freq_band3_cycles",
77 "Counter": "0,1,2,3",
78 "EventCode": "0xe",
79 "EventName": "UNC_P_FREQ_BAND3_TRANSITIONS",
80 "Filter": "edge=1",
81 "MetricExpr": "(UNC_P_FREQ_BAND3_CYCLES / UNC_P_CLOCKTICKS) * 100.",
82 "PerPkg": "1",
83 "Unit": "PCU"
84 },
85 {
86 "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C0. It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c0",
87 "Counter": "0,1,2,3",
88 "EventCode": "0x80",
89 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C0",
90 "Filter": "occ_sel=1",
91 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C0 / UNC_P_CLOCKTICKS) * 100.",
92 "PerPkg": "1",
93 "Unit": "PCU"
94 },
95 {
96 "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C3. It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events and occupancy triggering to capture other details. Derived from unc_p_power_state_occupancy.cores_c3",
97 "Counter": "0,1,2,3",
98 "EventCode": "0x80",
99 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C3",
100 "Filter": "occ_sel=2",
101 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C3 / UNC_P_CLOCKTICKS) * 100.",
102 "PerPkg": "1",
103 "Unit": "PCU"
104 },
105 {
106 "BriefDescription": "This is an occupancy event that tracks the number of cores that are in C6. It can be used by itself to get the average number of cores in C0, with threshholding to generate histograms, or with other PCU events . Derived from unc_p_power_state_occupancy.cores_c6",
107 "Counter": "0,1,2,3",
108 "EventCode": "0x80",
109 "EventName": "UNC_P_POWER_STATE_OCCUPANCY.CORES_C6",
110 "Filter": "occ_sel=3",
111 "MetricExpr": "(UNC_P_POWER_STATE_OCCUPANCY.CORES_C6 / UNC_P_CLOCKTICKS) * 100.",
112 "PerPkg": "1",
113 "Unit": "PCU"
114 },
115 {
116 "BriefDescription": "Counts the number of cycles that we are in external PROCHOT mode. This mode is triggered when a sensor off the die determines that something off-die (like DRAM) is too hot and must throttle to avoid damaging the chip. Derived from unc_p_prochot_external_cycles",
117 "Counter": "0,1,2,3",
118 "EventCode": "0xa",
119 "EventName": "UNC_P_PROCHOT_EXTERNAL_CYCLES",
120 "MetricExpr": "(UNC_P_PROCHOT_EXTERNAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
121 "PerPkg": "1",
122 "Unit": "PCU"
123 },
124 {
125 "BriefDescription": "Counts the number of cycles when temperature is the upper limit on frequency. Derived from unc_p_freq_max_limit_thermal_cycles",
126 "Counter": "0,1,2,3",
127 "EventCode": "0x4",
128 "EventName": "UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES",
129 "MetricExpr": "(UNC_P_FREQ_MAX_LIMIT_THERMAL_CYCLES / UNC_P_CLOCKTICKS) * 100.",
130 "PerPkg": "1",
131 "Unit": "PCU"
132 },
133 {
134 "BriefDescription": "Counts the number of cycles when the OS is the upper limit on frequency. Derived from unc_p_freq_max_os_cycles",
135 "Counter": "0,1,2,3",
136 "EventCode": "0x6",
137 "EventName": "UNC_P_FREQ_MAX_OS_CYCLES",
138 "MetricExpr": "(UNC_P_FREQ_MAX_OS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
139 "PerPkg": "1",
140 "Unit": "PCU"
141 },
142 {
143 "BriefDescription": "Counts the number of cycles when power is the upper limit on frequency. Derived from unc_p_freq_max_power_cycles",
144 "Counter": "0,1,2,3",
145 "EventCode": "0x5",
146 "EventName": "UNC_P_FREQ_MAX_POWER_CYCLES",
147 "MetricExpr": "(UNC_P_FREQ_MAX_POWER_CYCLES / UNC_P_CLOCKTICKS) * 100.",
148 "PerPkg": "1",
149 "Unit": "PCU"
150 },
151 {
152 "BriefDescription": "Counts the number of cycles when current is the upper limit on frequency. Derived from unc_p_freq_max_current_cycles",
153 "Counter": "0,1,2,3",
154 "EventCode": "0x7",
155 "EventName": "UNC_P_FREQ_MAX_CURRENT_CYCLES",
156 "MetricExpr": "(UNC_P_FREQ_MAX_CURRENT_CYCLES / UNC_P_CLOCKTICKS) * 100.",
157 "PerPkg": "1",
158 "Unit": "PCU"
159 },
160 {
161 "BriefDescription": "Cycles spent changing Frequency. Derived from unc_p_freq_trans_cycles",
162 "Counter": "0,1,2,3",
163 "EventName": "UNC_P_FREQ_TRANS_CYCLES",
164 "MetricExpr": "(UNC_P_FREQ_TRANS_CYCLES / UNC_P_CLOCKTICKS) * 100.",
165 "PerPkg": "1",
166 "Unit": "PCU"
167 },
168 {
169 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 1.2Ghz. Derived from unc_p_freq_band0_cycles",
170 "Counter": "0,1,2,3",
171 "EventCode": "0xb",
172 "EventName": "UNC_P_FREQ_GE_1200MHZ_CYCLES",
173 "Filter": "filter_band0=1200",
174 "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
175 "PerPkg": "1",
176 "Unit": "PCU"
177 },
178 {
179 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 2Ghz. Derived from unc_p_freq_band1_cycles",
180 "Counter": "0,1,2,3",
181 "EventCode": "0xc",
182 "EventName": "UNC_P_FREQ_GE_2000MHZ_CYCLES",
183 "Filter": "filter_band1=2000",
184 "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
185 "PerPkg": "1",
186 "Unit": "PCU"
187 },
188 {
189 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 3Ghz. Derived from unc_p_freq_band2_cycles",
190 "Counter": "0,1,2,3",
191 "EventCode": "0xd",
192 "EventName": "UNC_P_FREQ_GE_3000MHZ_CYCLES",
193 "Filter": "filter_band2=3000",
194 "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
195 "PerPkg": "1",
196 "Unit": "PCU"
197 },
198 {
199 "BriefDescription": "Counts the number of cycles that the uncore was running at a frequency greater than or equal to 4Ghz. Derived from unc_p_freq_band3_cycles",
200 "Counter": "0,1,2,3",
201 "EventCode": "0xe",
202 "EventName": "UNC_P_FREQ_GE_4000MHZ_CYCLES",
203 "Filter": "filter_band3=4000",
204 "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
205 "PerPkg": "1",
206 "Unit": "PCU"
207 },
208 {
209 "BriefDescription": "Counts the number of times that the uncore transitioned to a frequency greater than or equal to 1.2Ghz. Derived from unc_p_freq_band0_cycles",
210 "Counter": "0,1,2,3",
211 "EventCode": "0xb",
212 "EventName": "UNC_P_FREQ_GE_1200MHZ_TRANSITIONS",
213 "Filter": "edge=1,filter_band0=1200",
214 "MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
215 "PerPkg": "1",
216 "Unit": "PCU"
217 },
218 {
219 "BriefDescription": "Counts the number of times that the uncore transitioned to a frequency greater than or equal to 2Ghz. Derived from unc_p_freq_band1_cycles",
220 "Counter": "0,1,2,3",
221 "EventCode": "0xc",
222 "EventName": "UNC_P_FREQ_GE_2000MHZ_TRANSITIONS",
223 "Filter": "edge=1,filter_band1=2000",
224 "MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
225 "PerPkg": "1",
226 "Unit": "PCU"
227 },
228 {
229 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to 3Ghz. Derived from unc_p_freq_band2_cycles",
230 "Counter": "0,1,2,3",
231 "EventCode": "0xd",
232 "EventName": "UNC_P_FREQ_GE_3000MHZ_TRANSITIONS",
233 "Filter": "edge=1,filter_band2=4000",
234 "MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
235 "PerPkg": "1",
236 "Unit": "PCU"
237 },
238 {
239 "BriefDescription": "Counts the number of cycles that the uncore transitioned to a frequency greater than or equal to 4Ghz. Derived from unc_p_freq_band3_cycles",
240 "Counter": "0,1,2,3",
241 "EventCode": "0xe",
242 "EventName": "UNC_P_FREQ_GE_4000MHZ_TRANSITIONS",
243 "Filter": "edge=1,filter_band3=4000",
244 "MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
245 "PerPkg": "1",
246 "Unit": "PCU"
247 }
248]
diff --git a/tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json b/tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json
new file mode 100644
index 000000000000..e3bcd86c4f56
--- /dev/null
+++ b/tools/perf/pmu-events/arch/x86/knightslanding/uncore-memory.json
@@ -0,0 +1,42 @@
1[
2 {
3 "BriefDescription": "ddr bandwidth read (CPU traffic only) (MB/sec). ",
4 "Counter": "0,1,2,3",
5 "EventCode": "0x03",
6 "EventName": "UNC_M_CAS_COUNT.RD",
7 "PerPkg": "1",
8 "ScaleUnit": "6.4e-05MiB",
9 "UMask": "0x01",
10 "Unit": "imc"
11 },
12 {
13 "BriefDescription": "ddr bandwidth write (CPU traffic only) (MB/sec). ",
14 "Counter": "0,1,2,3",
15 "EventCode": "0x03",
16 "EventName": "UNC_M_CAS_COUNT.WR",
17 "PerPkg": "1",
18 "ScaleUnit": "6.4e-05MiB",
19 "UMask": "0x02",
20 "Unit": "imc"
21 },
22 {
23 "BriefDescription": "mcdram bandwidth read (CPU traffic only) (MB/sec). ",
24 "Counter": "0,1,2,3",
25 "EventCode": "0x01",
26 "EventName": "UNC_E_RPQ_INSERTS",
27 "PerPkg": "1",
28 "ScaleUnit": "6.4e-05MiB",
29 "UMask": "0x01",
30 "Unit": "edc_eclk"
31 },
32 {
33 "BriefDescription": "mcdram bandwidth write (CPU traffic only) (MB/sec). ",
34 "Counter": "0,1,2,3",
35 "EventCode": "0x02",
36 "EventName": "UNC_E_WPQ_INSERTS",
37 "PerPkg": "1",
38 "ScaleUnit": "6.4e-05MiB",
39 "UMask": "0x01",
40 "Unit": "edc_eclk"
41 }
42]
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 41611d7f9873..eed09346a72a 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -135,7 +135,6 @@ static struct field {
135 const char *field; 135 const char *field;
136 const char *kernel; 136 const char *kernel;
137} fields[] = { 137} fields[] = {
138 { "EventCode", "event=" },
139 { "UMask", "umask=" }, 138 { "UMask", "umask=" },
140 { "CounterMask", "cmask=" }, 139 { "CounterMask", "cmask=" },
141 { "Invert", "inv=" }, 140 { "Invert", "inv=" },
@@ -189,6 +188,27 @@ static struct msrmap *lookup_msr(char *map, jsmntok_t *val)
189 return NULL; 188 return NULL;
190} 189}
191 190
191static struct map {
192 const char *json;
193 const char *perf;
194} unit_to_pmu[] = {
195 { "CBO", "uncore_cbox" },
196 { "QPI LL", "uncore_qpi" },
197 { "SBO", "uncore_sbox" },
198 {}
199};
200
201static const char *field_to_perf(struct map *table, char *map, jsmntok_t *val)
202{
203 int i;
204
205 for (i = 0; table[i].json; i++) {
206 if (json_streq(map, val, table[i].json))
207 return table[i].perf;
208 }
209 return NULL;
210}
211
192#define EXPECT(e, t, m) do { if (!(e)) { \ 212#define EXPECT(e, t, m) do { if (!(e)) { \
193 jsmntok_t *loc = (t); \ 213 jsmntok_t *loc = (t); \
194 if (!(t)->start && (t) > tokens) \ 214 if (!(t)->start && (t) > tokens) \
@@ -270,7 +290,8 @@ static void print_events_table_prefix(FILE *fp, const char *tblname)
270} 290}
271 291
272static int print_events_table_entry(void *data, char *name, char *event, 292static int print_events_table_entry(void *data, char *name, char *event,
273 char *desc, char *long_desc) 293 char *desc, char *long_desc,
294 char *pmu, char *unit, char *perpkg)
274{ 295{
275 struct perf_entry_data *pd = data; 296 struct perf_entry_data *pd = data;
276 FILE *outfp = pd->outfp; 297 FILE *outfp = pd->outfp;
@@ -288,7 +309,12 @@ static int print_events_table_entry(void *data, char *name, char *event,
288 fprintf(outfp, "\t.topic = \"%s\",\n", topic); 309 fprintf(outfp, "\t.topic = \"%s\",\n", topic);
289 if (long_desc && long_desc[0]) 310 if (long_desc && long_desc[0])
290 fprintf(outfp, "\t.long_desc = \"%s\",\n", long_desc); 311 fprintf(outfp, "\t.long_desc = \"%s\",\n", long_desc);
291 312 if (pmu)
313 fprintf(outfp, "\t.pmu = \"%s\",\n", pmu);
314 if (unit)
315 fprintf(outfp, "\t.unit = \"%s\",\n", unit);
316 if (perpkg)
317 fprintf(outfp, "\t.perpkg = \"%s\",\n", perpkg);
292 fprintf(outfp, "},\n"); 318 fprintf(outfp, "},\n");
293 319
294 return 0; 320 return 0;
@@ -335,7 +361,8 @@ static char *real_event(const char *name, char *event)
335/* Call func with each event in the json file */ 361/* Call func with each event in the json file */
336int json_events(const char *fn, 362int json_events(const char *fn,
337 int (*func)(void *data, char *name, char *event, char *desc, 363 int (*func)(void *data, char *name, char *event, char *desc,
338 char *long_desc), 364 char *long_desc,
365 char *pmu, char *unit, char *perpkg),
339 void *data) 366 void *data)
340{ 367{
341 int err = -EIO; 368 int err = -EIO;
@@ -343,6 +370,7 @@ int json_events(const char *fn,
343 jsmntok_t *tokens, *tok; 370 jsmntok_t *tokens, *tok;
344 int i, j, len; 371 int i, j, len;
345 char *map; 372 char *map;
373 char buf[128];
346 374
347 if (!fn) 375 if (!fn)
348 return -ENOENT; 376 return -ENOENT;
@@ -356,6 +384,11 @@ int json_events(const char *fn,
356 char *event = NULL, *desc = NULL, *name = NULL; 384 char *event = NULL, *desc = NULL, *name = NULL;
357 char *long_desc = NULL; 385 char *long_desc = NULL;
358 char *extra_desc = NULL; 386 char *extra_desc = NULL;
387 char *pmu = NULL;
388 char *filter = NULL;
389 char *perpkg = NULL;
390 char *unit = NULL;
391 unsigned long long eventcode = 0;
359 struct msrmap *msr = NULL; 392 struct msrmap *msr = NULL;
360 jsmntok_t *msrval = NULL; 393 jsmntok_t *msrval = NULL;
361 jsmntok_t *precise = NULL; 394 jsmntok_t *precise = NULL;
@@ -376,6 +409,16 @@ int json_events(const char *fn,
376 nz = !json_streq(map, val, "0"); 409 nz = !json_streq(map, val, "0");
377 if (match_field(map, field, nz, &event, val)) { 410 if (match_field(map, field, nz, &event, val)) {
378 /* ok */ 411 /* ok */
412 } else if (json_streq(map, field, "EventCode")) {
413 char *code = NULL;
414 addfield(map, &code, "", "", val);
415 eventcode |= strtoul(code, NULL, 0);
416 free(code);
417 } else if (json_streq(map, field, "ExtSel")) {
418 char *code = NULL;
419 addfield(map, &code, "", "", val);
420 eventcode |= strtoul(code, NULL, 0) << 21;
421 free(code);
379 } else if (json_streq(map, field, "EventName")) { 422 } else if (json_streq(map, field, "EventName")) {
380 addfield(map, &name, "", "", val); 423 addfield(map, &name, "", "", val);
381 } else if (json_streq(map, field, "BriefDescription")) { 424 } else if (json_streq(map, field, "BriefDescription")) {
@@ -399,6 +442,28 @@ int json_events(const char *fn,
399 addfield(map, &extra_desc, ". ", 442 addfield(map, &extra_desc, ". ",
400 " Supports address when precise", 443 " Supports address when precise",
401 NULL); 444 NULL);
445 } else if (json_streq(map, field, "Unit")) {
446 const char *ppmu;
447 char *s;
448
449 ppmu = field_to_perf(unit_to_pmu, map, val);
450 if (ppmu) {
451 pmu = strdup(ppmu);
452 } else {
453 if (!pmu)
454 pmu = strdup("uncore_");
455 addfield(map, &pmu, "", "", val);
456 for (s = pmu; *s; s++)
457 *s = tolower(*s);
458 }
459 addfield(map, &desc, ". ", "Unit: ", NULL);
460 addfield(map, &desc, "", pmu, NULL);
461 } else if (json_streq(map, field, "Filter")) {
462 addfield(map, &filter, "", "", val);
463 } else if (json_streq(map, field, "ScaleUnit")) {
464 addfield(map, &unit, "", "", val);
465 } else if (json_streq(map, field, "PerPkg")) {
466 addfield(map, &perpkg, "", "", val);
402 } 467 }
403 /* ignore unknown fields */ 468 /* ignore unknown fields */
404 } 469 }
@@ -410,20 +475,29 @@ int json_events(const char *fn,
410 addfield(map, &extra_desc, " ", 475 addfield(map, &extra_desc, " ",
411 "(Precise event)", NULL); 476 "(Precise event)", NULL);
412 } 477 }
478 snprintf(buf, sizeof buf, "event=%#llx", eventcode);
479 addfield(map, &event, ",", buf, NULL);
413 if (desc && extra_desc) 480 if (desc && extra_desc)
414 addfield(map, &desc, " ", extra_desc, NULL); 481 addfield(map, &desc, " ", extra_desc, NULL);
415 if (long_desc && extra_desc) 482 if (long_desc && extra_desc)
416 addfield(map, &long_desc, " ", extra_desc, NULL); 483 addfield(map, &long_desc, " ", extra_desc, NULL);
484 if (filter)
485 addfield(map, &event, ",", filter, NULL);
417 if (msr != NULL) 486 if (msr != NULL)
418 addfield(map, &event, ",", msr->pname, msrval); 487 addfield(map, &event, ",", msr->pname, msrval);
419 fixname(name); 488 fixname(name);
420 489
421 err = func(data, name, real_event(name, event), desc, long_desc); 490 err = func(data, name, real_event(name, event), desc, long_desc,
491 pmu, unit, perpkg);
422 free(event); 492 free(event);
423 free(desc); 493 free(desc);
424 free(name); 494 free(name);
425 free(long_desc); 495 free(long_desc);
426 free(extra_desc); 496 free(extra_desc);
497 free(pmu);
498 free(filter);
499 free(perpkg);
500 free(unit);
427 if (err) 501 if (err)
428 break; 502 break;
429 tok += j; 503 tok += j;
diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h
index b0eb2744b498..71e13de31092 100644
--- a/tools/perf/pmu-events/jevents.h
+++ b/tools/perf/pmu-events/jevents.h
@@ -3,7 +3,9 @@
3 3
4int json_events(const char *fn, 4int json_events(const char *fn,
5 int (*func)(void *data, char *name, char *event, char *desc, 5 int (*func)(void *data, char *name, char *event, char *desc,
6 char *long_desc), 6 char *long_desc,
7 char *pmu,
8 char *unit, char *perpkg),
7 void *data); 9 void *data);
8char *get_cpu_str(void); 10char *get_cpu_str(void);
9 11
diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h
index 2eaef595d8a0..c669a3cdb9f0 100644
--- a/tools/perf/pmu-events/pmu-events.h
+++ b/tools/perf/pmu-events/pmu-events.h
@@ -10,6 +10,9 @@ struct pmu_event {
10 const char *desc; 10 const char *desc;
11 const char *topic; 11 const char *topic;
12 const char *long_desc; 12 const char *long_desc;
13 const char *pmu;
14 const char *unit;
15 const char *perpkg;
13}; 16};
14 17
15/* 18/*
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 20c2e641c422..aa9276bfe3e9 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1779,15 +1779,14 @@ static int test_pmu_events(void)
1779 } 1779 }
1780 1780
1781 while (!ret && (ent = readdir(dir))) { 1781 while (!ret && (ent = readdir(dir))) {
1782#define MAX_NAME 100
1783 struct evlist_test e; 1782 struct evlist_test e;
1784 char name[MAX_NAME]; 1783 char name[2 * NAME_MAX + 1 + 12 + 3];
1785 1784
1786 /* Names containing . are special and cannot be used directly */ 1785 /* Names containing . are special and cannot be used directly */
1787 if (strchr(ent->d_name, '.')) 1786 if (strchr(ent->d_name, '.'))
1788 continue; 1787 continue;
1789 1788
1790 snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name); 1789 snprintf(name, sizeof(name), "cpu/event=%s/u", ent->d_name);
1791 1790
1792 e.name = name; 1791 e.name = name;
1793 e.check = test__checkevent_pmu_events; 1792 e.check = test__checkevent_pmu_events;
@@ -1795,11 +1794,10 @@ static int test_pmu_events(void)
1795 ret = test_event(&e); 1794 ret = test_event(&e);
1796 if (ret) 1795 if (ret)
1797 break; 1796 break;
1798 snprintf(name, MAX_NAME, "%s:u,cpu/event=%s/u", ent->d_name, ent->d_name); 1797 snprintf(name, sizeof(name), "%s:u,cpu/event=%s/u", ent->d_name, ent->d_name);
1799 e.name = name; 1798 e.name = name;
1800 e.check = test__checkevent_pmu_events_mix; 1799 e.check = test__checkevent_pmu_events_mix;
1801 ret = test_event(&e); 1800 ret = test_event(&e);
1802#undef MAX_NAME
1803 } 1801 }
1804 1802
1805 closedir(dir); 1803 closedir(dir);
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 36c861103291..bc6bc7062eb4 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -670,13 +670,13 @@ int bpf__probe(struct bpf_object *obj)
670 670
671 err = convert_perf_probe_events(pev, 1); 671 err = convert_perf_probe_events(pev, 1);
672 if (err < 0) { 672 if (err < 0) {
673 pr_debug("bpf_probe: failed to convert perf probe events"); 673 pr_debug("bpf_probe: failed to convert perf probe events\n");
674 goto out; 674 goto out;
675 } 675 }
676 676
677 err = apply_perf_probe_events(pev, 1); 677 err = apply_perf_probe_events(pev, 1);
678 if (err < 0) { 678 if (err < 0) {
679 pr_debug("bpf_probe: failed to apply perf probe events"); 679 pr_debug("bpf_probe: failed to apply perf probe events\n");
680 goto out; 680 goto out;
681 } 681 }
682 682
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 8ab0d7da956b..4ea7ce72ed9c 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1,5 +1,5 @@
1#include <linux/types.h> 1#include <linux/types.h>
2#include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ 2#include <linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
3#include <api/fs/fs.h> 3#include <api/fs/fs.h>
4#include "event.h" 4#include "event.h"
5#include "debug.h" 5#include "debug.h"
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index c567d9f0aa92..3d12c16e5103 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3205,6 +3205,7 @@ int perf_event__process_event_update(struct perf_tool *tool __maybe_unused,
3205 case PERF_EVENT_UPDATE__SCALE: 3205 case PERF_EVENT_UPDATE__SCALE:
3206 ev_scale = (struct event_update_event_scale *) ev->data; 3206 ev_scale = (struct event_update_event_scale *) ev->data;
3207 evsel->scale = ev_scale->scale; 3207 evsel->scale = ev_scale->scale;
3208 break;
3208 case PERF_EVENT_UPDATE__CPUS: 3209 case PERF_EVENT_UPDATE__CPUS:
3209 ev_cpus = (struct event_update_event_cpus *) ev->data; 3210 ev_cpus = (struct event_update_event_cpus *) ev->data;
3210 3211
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index e4e7dc781d21..7cf7f7aca4d2 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -22,6 +22,7 @@
22#include <errno.h> 22#include <errno.h>
23#include <stdint.h> 23#include <stdint.h>
24#include <inttypes.h> 24#include <inttypes.h>
25#include <linux/compiler.h>
25 26
26#include "../cache.h" 27#include "../cache.h"
27#include "../util.h" 28#include "../util.h"
@@ -1746,6 +1747,7 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)
1746 switch (decoder->packet.type) { 1747 switch (decoder->packet.type) {
1747 case INTEL_PT_TIP_PGD: 1748 case INTEL_PT_TIP_PGD:
1748 decoder->continuous_period = false; 1749 decoder->continuous_period = false;
1750 __fallthrough;
1749 case INTEL_PT_TIP_PGE: 1751 case INTEL_PT_TIP_PGE:
1750 case INTEL_PT_TIP: 1752 case INTEL_PT_TIP:
1751 intel_pt_log("ERROR: Unexpected packet\n"); 1753 intel_pt_log("ERROR: Unexpected packet\n");
@@ -1799,6 +1801,8 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)
1799 decoder->pge = false; 1801 decoder->pge = false;
1800 decoder->continuous_period = false; 1802 decoder->continuous_period = false;
1801 intel_pt_clear_tx_flags(decoder); 1803 intel_pt_clear_tx_flags(decoder);
1804 __fallthrough;
1805
1802 case INTEL_PT_TNT: 1806 case INTEL_PT_TNT:
1803 decoder->have_tma = false; 1807 decoder->have_tma = false;
1804 intel_pt_log("ERROR: Unexpected packet\n"); 1808 intel_pt_log("ERROR: Unexpected packet\n");
@@ -1839,6 +1843,7 @@ static int intel_pt_walk_to_ip(struct intel_pt_decoder *decoder)
1839 switch (decoder->packet.type) { 1843 switch (decoder->packet.type) {
1840 case INTEL_PT_TIP_PGD: 1844 case INTEL_PT_TIP_PGD:
1841 decoder->continuous_period = false; 1845 decoder->continuous_period = false;
1846 __fallthrough;
1842 case INTEL_PT_TIP_PGE: 1847 case INTEL_PT_TIP_PGE:
1843 case INTEL_PT_TIP: 1848 case INTEL_PT_TIP:
1844 decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD; 1849 decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD;
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
index 4f7b32020487..7528ae4f7e28 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
@@ -17,6 +17,7 @@
17#include <string.h> 17#include <string.h>
18#include <endian.h> 18#include <endian.h>
19#include <byteswap.h> 19#include <byteswap.h>
20#include <linux/compiler.h>
20 21
21#include "intel-pt-pkt-decoder.h" 22#include "intel-pt-pkt-decoder.h"
22 23
@@ -498,6 +499,7 @@ int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf,
498 case INTEL_PT_FUP: 499 case INTEL_PT_FUP:
499 if (!(packet->count)) 500 if (!(packet->count))
500 return snprintf(buf, buf_len, "%s no ip", name); 501 return snprintf(buf, buf_len, "%s no ip", name);
502 __fallthrough;
501 case INTEL_PT_CYC: 503 case INTEL_PT_CYC:
502 case INTEL_PT_VMCS: 504 case INTEL_PT_VMCS:
503 case INTEL_PT_MTC: 505 case INTEL_PT_MTC:
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 3c876b8ba4de..07be0762e53e 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -211,6 +211,8 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
211 closedir(evt_dir); 211 closedir(evt_dir);
212 closedir(sys_dir); 212 closedir(sys_dir);
213 path = zalloc(sizeof(*path)); 213 path = zalloc(sizeof(*path));
214 if (!path)
215 return NULL;
214 path->system = malloc(MAX_EVENT_LENGTH); 216 path->system = malloc(MAX_EVENT_LENGTH);
215 if (!path->system) { 217 if (!path->system) {
216 free(path); 218 free(path);
@@ -252,8 +254,7 @@ struct tracepoint_path *tracepoint_name_to_path(const char *name)
252 if (path->system == NULL || path->name == NULL) { 254 if (path->system == NULL || path->name == NULL) {
253 zfree(&path->system); 255 zfree(&path->system);
254 zfree(&path->name); 256 zfree(&path->name);
255 free(path); 257 zfree(&path);
256 path = NULL;
257 } 258 }
258 259
259 return path; 260 return path;
@@ -310,10 +311,11 @@ __add_event(struct list_head *list, int *idx,
310 311
311 event_attr_init(attr); 312 event_attr_init(attr);
312 313
313 evsel = perf_evsel__new_idx(attr, (*idx)++); 314 evsel = perf_evsel__new_idx(attr, *idx);
314 if (!evsel) 315 if (!evsel)
315 return NULL; 316 return NULL;
316 317
318 (*idx)++;
317 evsel->cpus = cpu_map__get(cpus); 319 evsel->cpus = cpu_map__get(cpus);
318 evsel->own_cpus = cpu_map__get(cpus); 320 evsel->own_cpus = cpu_map__get(cpus);
319 321
@@ -1477,10 +1479,9 @@ static void perf_pmu__parse_cleanup(void)
1477 1479
1478 for (i = 0; i < perf_pmu_events_list_num; i++) { 1480 for (i = 0; i < perf_pmu_events_list_num; i++) {
1479 p = perf_pmu_events_list + i; 1481 p = perf_pmu_events_list + i;
1480 free(p->symbol); 1482 zfree(&p->symbol);
1481 } 1483 }
1482 free(perf_pmu_events_list); 1484 zfree(&perf_pmu_events_list);
1483 perf_pmu_events_list = NULL;
1484 perf_pmu_events_list_num = 0; 1485 perf_pmu_events_list_num = 0;
1485 } 1486 }
1486} 1487}
@@ -1504,35 +1505,41 @@ static void perf_pmu__parse_init(void)
1504 struct perf_pmu_alias *alias; 1505 struct perf_pmu_alias *alias;
1505 int len = 0; 1506 int len = 0;
1506 1507
1507 pmu = perf_pmu__find("cpu"); 1508 pmu = NULL;
1508 if ((pmu == NULL) || list_empty(&pmu->aliases)) { 1509 while ((pmu = perf_pmu__scan(pmu)) != NULL) {
1510 list_for_each_entry(alias, &pmu->aliases, list) {
1511 if (strchr(alias->name, '-'))
1512 len++;
1513 len++;
1514 }
1515 }
1516
1517 if (len == 0) {
1509 perf_pmu_events_list_num = -1; 1518 perf_pmu_events_list_num = -1;
1510 return; 1519 return;
1511 } 1520 }
1512 list_for_each_entry(alias, &pmu->aliases, list) {
1513 if (strchr(alias->name, '-'))
1514 len++;
1515 len++;
1516 }
1517 perf_pmu_events_list = malloc(sizeof(struct perf_pmu_event_symbol) * len); 1521 perf_pmu_events_list = malloc(sizeof(struct perf_pmu_event_symbol) * len);
1518 if (!perf_pmu_events_list) 1522 if (!perf_pmu_events_list)
1519 return; 1523 return;
1520 perf_pmu_events_list_num = len; 1524 perf_pmu_events_list_num = len;
1521 1525
1522 len = 0; 1526 len = 0;
1523 list_for_each_entry(alias, &pmu->aliases, list) { 1527 pmu = NULL;
1524 struct perf_pmu_event_symbol *p = perf_pmu_events_list + len; 1528 while ((pmu = perf_pmu__scan(pmu)) != NULL) {
1525 char *tmp = strchr(alias->name, '-'); 1529 list_for_each_entry(alias, &pmu->aliases, list) {
1526 1530 struct perf_pmu_event_symbol *p = perf_pmu_events_list + len;
1527 if (tmp != NULL) { 1531 char *tmp = strchr(alias->name, '-');
1528 SET_SYMBOL(strndup(alias->name, tmp - alias->name), 1532
1529 PMU_EVENT_SYMBOL_PREFIX); 1533 if (tmp != NULL) {
1530 p++; 1534 SET_SYMBOL(strndup(alias->name, tmp - alias->name),
1531 SET_SYMBOL(strdup(++tmp), PMU_EVENT_SYMBOL_SUFFIX); 1535 PMU_EVENT_SYMBOL_PREFIX);
1532 len += 2; 1536 p++;
1533 } else { 1537 SET_SYMBOL(strdup(++tmp), PMU_EVENT_SYMBOL_SUFFIX);
1534 SET_SYMBOL(strdup(alias->name), PMU_EVENT_SYMBOL); 1538 len += 2;
1535 len++; 1539 } else {
1540 SET_SYMBOL(strdup(alias->name), PMU_EVENT_SYMBOL);
1541 len++;
1542 }
1536 } 1543 }
1537 } 1544 }
1538 qsort(perf_pmu_events_list, len, 1545 qsort(perf_pmu_events_list, len,
@@ -1563,7 +1570,7 @@ perf_pmu__parse_check(const char *name)
1563 r = bsearch(&p, perf_pmu_events_list, 1570 r = bsearch(&p, perf_pmu_events_list,
1564 (size_t) perf_pmu_events_list_num, 1571 (size_t) perf_pmu_events_list_num,
1565 sizeof(struct perf_pmu_event_symbol), comp_pmu); 1572 sizeof(struct perf_pmu_event_symbol), comp_pmu);
1566 free(p.symbol); 1573 zfree(&p.symbol);
1567 return r ? r->type : PMU_EVENT_SYMBOL_ERR; 1574 return r ? r->type : PMU_EVENT_SYMBOL_ERR;
1568} 1575}
1569 1576
@@ -1710,8 +1717,8 @@ static void parse_events_print_error(struct parse_events_error *err,
1710 fprintf(stderr, "%*s\\___ %s\n", idx + 1, "", err->str); 1717 fprintf(stderr, "%*s\\___ %s\n", idx + 1, "", err->str);
1711 if (err->help) 1718 if (err->help)
1712 fprintf(stderr, "\n%s\n", err->help); 1719 fprintf(stderr, "\n%s\n", err->help);
1713 free(err->str); 1720 zfree(&err->str);
1714 free(err->help); 1721 zfree(&err->help);
1715 } 1722 }
1716 1723
1717 fprintf(stderr, "Run 'perf list' for a list of valid events\n"); 1724 fprintf(stderr, "Run 'perf list' for a list of valid events\n");
@@ -2406,7 +2413,7 @@ void parse_events_terms__purge(struct list_head *terms)
2406 2413
2407 list_for_each_entry_safe(term, h, terms, list) { 2414 list_for_each_entry_safe(term, h, terms, list) {
2408 if (term->array.nr_ranges) 2415 if (term->array.nr_ranges)
2409 free(term->array.ranges); 2416 zfree(&term->array.ranges);
2410 list_del_init(&term->list); 2417 list_del_init(&term->list);
2411 free(term); 2418 free(term);
2412 } 2419 }
@@ -2422,7 +2429,7 @@ void parse_events_terms__delete(struct list_head *terms)
2422 2429
2423void parse_events__clear_array(struct parse_events_array *a) 2430void parse_events__clear_array(struct parse_events_array *a)
2424{ 2431{
2425 free(a->ranges); 2432 zfree(&a->ranges);
2426} 2433}
2427 2434
2428void parse_events_evlist_error(struct parse_events_evlist *data, 2435void parse_events_evlist_error(struct parse_events_evlist *data,
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 879115f93edc..3a5196380609 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -12,6 +12,8 @@
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include "util.h" 14#include "util.h"
15#include "pmu.h"
16#include "debug.h"
15#include "parse-events.h" 17#include "parse-events.h"
16#include "parse-events-bison.h" 18#include "parse-events-bison.h"
17 19
@@ -236,15 +238,34 @@ PE_KERNEL_PMU_EVENT sep_dc
236 struct list_head *head; 238 struct list_head *head;
237 struct parse_events_term *term; 239 struct parse_events_term *term;
238 struct list_head *list; 240 struct list_head *list;
241 struct perf_pmu *pmu = NULL;
242 int ok = 0;
239 243
240 ALLOC_LIST(head); 244 /* Add it for all PMUs that support the alias */
241 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
242 $1, 1, &@1, NULL));
243 list_add_tail(&term->list, head);
244
245 ALLOC_LIST(list); 245 ALLOC_LIST(list);
246 ABORT_ON(parse_events_add_pmu(data, list, "cpu", head)); 246 while ((pmu = perf_pmu__scan(pmu)) != NULL) {
247 parse_events_terms__delete(head); 247 struct perf_pmu_alias *alias;
248
249 list_for_each_entry(alias, &pmu->aliases, list) {
250 if (!strcasecmp(alias->name, $1)) {
251 ALLOC_LIST(head);
252 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
253 $1, 1, &@1, NULL));
254 list_add_tail(&term->list, head);
255
256 if (!parse_events_add_pmu(data, list,
257 pmu->name, head)) {
258 pr_debug("%s -> %s/%s/\n", $1,
259 pmu->name, alias->str);
260 ok++;
261 }
262
263 parse_events_terms__delete(head);
264 }
265 }
266 }
267 if (!ok)
268 YYABORT;
248 $$ = list; 269 $$ = list;
249} 270}
250| 271|
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 78b16100567d..82a654dec666 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -229,11 +229,13 @@ static int perf_pmu__parse_snapshot(struct perf_pmu_alias *alias,
229} 229}
230 230
231static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, 231static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
232 char *desc, char *val, char *long_desc, 232 char *desc, char *val,
233 char *topic) 233 char *long_desc, char *topic,
234 char *unit, char *perpkg)
234{ 235{
235 struct perf_pmu_alias *alias; 236 struct perf_pmu_alias *alias;
236 int ret; 237 int ret;
238 int num;
237 239
238 alias = malloc(sizeof(*alias)); 240 alias = malloc(sizeof(*alias));
239 if (!alias) 241 if (!alias)
@@ -267,6 +269,13 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
267 alias->long_desc = long_desc ? strdup(long_desc) : 269 alias->long_desc = long_desc ? strdup(long_desc) :
268 desc ? strdup(desc) : NULL; 270 desc ? strdup(desc) : NULL;
269 alias->topic = topic ? strdup(topic) : NULL; 271 alias->topic = topic ? strdup(topic) : NULL;
272 if (unit) {
273 if (convert_scale(unit, &unit, &alias->scale) < 0)
274 return -1;
275 snprintf(alias->unit, sizeof(alias->unit), "%s", unit);
276 }
277 alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1;
278 alias->str = strdup(val);
270 279
271 list_add_tail(&alias->list, list); 280 list_add_tail(&alias->list, list);
272 281
@@ -284,7 +293,8 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI
284 293
285 buf[ret] = 0; 294 buf[ret] = 0;
286 295
287 return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL); 296 return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL,
297 NULL);
288} 298}
289 299
290static inline bool pmu_alias_info_file(char *name) 300static inline bool pmu_alias_info_file(char *name)
@@ -504,7 +514,7 @@ char * __weak get_cpuid_str(void)
504 * to the current running CPU. Then, add all PMU events from that table 514 * to the current running CPU. Then, add all PMU events from that table
505 * as aliases. 515 * as aliases.
506 */ 516 */
507static void pmu_add_cpu_aliases(struct list_head *head) 517static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
508{ 518{
509 int i; 519 int i;
510 struct pmu_events_map *map; 520 struct pmu_events_map *map;
@@ -540,14 +550,21 @@ static void pmu_add_cpu_aliases(struct list_head *head)
540 */ 550 */
541 i = 0; 551 i = 0;
542 while (1) { 552 while (1) {
553 const char *pname;
554
543 pe = &map->table[i++]; 555 pe = &map->table[i++];
544 if (!pe->name) 556 if (!pe->name)
545 break; 557 break;
546 558
559 pname = pe->pmu ? pe->pmu : "cpu";
560 if (strncmp(pname, name, strlen(pname)))
561 continue;
562
547 /* need type casts to override 'const' */ 563 /* need type casts to override 'const' */
548 __perf_pmu__new_alias(head, NULL, (char *)pe->name, 564 __perf_pmu__new_alias(head, NULL, (char *)pe->name,
549 (char *)pe->desc, (char *)pe->event, 565 (char *)pe->desc, (char *)pe->event,
550 (char *)pe->long_desc, (char *)pe->topic); 566 (char *)pe->long_desc, (char *)pe->topic,
567 (char *)pe->unit, (char *)pe->perpkg);
551 } 568 }
552 569
553out: 570out:
@@ -575,15 +592,16 @@ static struct perf_pmu *pmu_lookup(const char *name)
575 if (pmu_format(name, &format)) 592 if (pmu_format(name, &format))
576 return NULL; 593 return NULL;
577 594
578 if (pmu_aliases(name, &aliases)) 595 /*
596 * Check the type first to avoid unnecessary work.
597 */
598 if (pmu_type(name, &type))
579 return NULL; 599 return NULL;
580 600
581 if (!strcmp(name, "cpu")) 601 if (pmu_aliases(name, &aliases))
582 pmu_add_cpu_aliases(&aliases);
583
584 if (pmu_type(name, &type))
585 return NULL; 602 return NULL;
586 603
604 pmu_add_cpu_aliases(&aliases, name);
587 pmu = zalloc(sizeof(*pmu)); 605 pmu = zalloc(sizeof(*pmu));
588 if (!pmu) 606 if (!pmu)
589 return NULL; 607 return NULL;
@@ -1071,6 +1089,8 @@ struct sevent {
1071 char *name; 1089 char *name;
1072 char *desc; 1090 char *desc;
1073 char *topic; 1091 char *topic;
1092 char *str;
1093 char *pmu;
1074}; 1094};
1075 1095
1076static int cmp_sevent(const void *a, const void *b) 1096static int cmp_sevent(const void *a, const void *b)
@@ -1167,6 +1187,8 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
1167 aliases[j].desc = long_desc ? alias->long_desc : 1187 aliases[j].desc = long_desc ? alias->long_desc :
1168 alias->desc; 1188 alias->desc;
1169 aliases[j].topic = alias->topic; 1189 aliases[j].topic = alias->topic;
1190 aliases[j].str = alias->str;
1191 aliases[j].pmu = pmu->name;
1170 j++; 1192 j++;
1171 } 1193 }
1172 if (pmu->selectable && 1194 if (pmu->selectable &&
@@ -1181,6 +1203,9 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
1181 len = j; 1203 len = j;
1182 qsort(aliases, len, sizeof(struct sevent), cmp_sevent); 1204 qsort(aliases, len, sizeof(struct sevent), cmp_sevent);
1183 for (j = 0; j < len; j++) { 1205 for (j = 0; j < len; j++) {
1206 /* Skip duplicates */
1207 if (j > 0 && !strcmp(aliases[j].name, aliases[j - 1].name))
1208 continue;
1184 if (name_only) { 1209 if (name_only) {
1185 printf("%s ", aliases[j].name); 1210 printf("%s ", aliases[j].name);
1186 continue; 1211 continue;
@@ -1198,6 +1223,8 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
1198 printf("%*s", 8, "["); 1223 printf("%*s", 8, "[");
1199 wordwrap(aliases[j].desc, 8, columns, 0); 1224 wordwrap(aliases[j].desc, 8, columns, 0);
1200 printf("]\n"); 1225 printf("]\n");
1226 if (verbose)
1227 printf("%*s%s/%s/\n", 8, "", aliases[j].pmu, aliases[j].str);
1201 } else 1228 } else
1202 printf(" %-50s [Kernel PMU event]\n", aliases[j].name); 1229 printf(" %-50s [Kernel PMU event]\n", aliases[j].name);
1203 printed++; 1230 printed++;
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 25712034c815..00852ddc7741 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -43,6 +43,7 @@ struct perf_pmu_alias {
43 char *desc; 43 char *desc;
44 char *long_desc; 44 char *long_desc;
45 char *topic; 45 char *topic;
46 char *str;
46 struct list_head terms; /* HEAD struct parse_events_term -> list */ 47 struct list_head terms; /* HEAD struct parse_events_term -> list */
47 struct list_head list; /* ELEM */ 48 struct list_head list; /* ELEM */
48 char unit[UNIT_MAX_LEN+1]; 49 char unit[UNIT_MAX_LEN+1];
diff --git a/tools/perf/util/strfilter.c b/tools/perf/util/strfilter.c
index bcae659b6546..efb53772e0ec 100644
--- a/tools/perf/util/strfilter.c
+++ b/tools/perf/util/strfilter.c
@@ -269,6 +269,7 @@ static int strfilter_node__sprint(struct strfilter_node *node, char *buf)
269 len = strfilter_node__sprint_pt(node->l, buf); 269 len = strfilter_node__sprint_pt(node->l, buf);
270 if (len < 0) 270 if (len < 0)
271 return len; 271 return len;
272 __fallthrough;
272 case '!': 273 case '!':
273 if (buf) { 274 if (buf) {
274 *(buf + len++) = *node->p; 275 *(buf + len++) = *node->p;
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index d8dfaf64b32e..bddca519dd58 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -21,6 +21,8 @@ s64 perf_atoll(const char *str)
21 case 'b': case 'B': 21 case 'b': case 'B':
22 if (*p) 22 if (*p)
23 goto out_err; 23 goto out_err;
24
25 __fallthrough;
24 case '\0': 26 case '\0':
25 return length; 27 return length;
26 default: 28 default:
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index dc93940de351..70e389bc4af7 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1460,9 +1460,11 @@ int dso__load(struct dso *dso, struct map *map)
1460 * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work 1460 * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
1461 */ 1461 */
1462 if (!dso->has_build_id && 1462 if (!dso->has_build_id &&
1463 is_regular_file(dso->long_name) && 1463 is_regular_file(dso->long_name)) {
1464 filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0) 1464 __symbol__join_symfs(name, PATH_MAX, dso->long_name);
1465 if (filename__read_build_id(name, build_id, BUILD_ID_SIZE) > 0)
1465 dso__set_build_id(dso, build_id); 1466 dso__set_build_id(dso, build_id);
1467 }
1466 1468
1467 /* 1469 /*
1468 * Iterate over candidate debug images. 1470 * Iterate over candidate debug images.
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index f9eab200fd75..7c3fcc538a70 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -93,7 +93,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)
93{ 93{
94 DIR *proc; 94 DIR *proc;
95 int max_threads = 32, items, i; 95 int max_threads = 32, items, i;
96 char path[256]; 96 char path[NAME_MAX + 1 + 6];
97 struct dirent *dirent, **namelist = NULL; 97 struct dirent *dirent, **namelist = NULL;
98 struct thread_map *threads = thread_map__alloc(max_threads); 98 struct thread_map *threads = thread_map__alloc(max_threads);
99 99