...
...
6
M? processors, but James Clark more recently tested this and believes
6
M? processors, but James Clark more recently tested this and believes
7
the driver issues there may not have existed or have been resolved. In
7
the driver issues there may not have existed or have been resolved. In
8
any case, it is inconsistent that with a PMU event names avoid legacy
8
any case, it is inconsistent that with a PMU event names avoid legacy
9
encodings, but when wildcarding PMUs (ie without a PMU with the event
9
encodings, but when wildcarding PMUs (ie without a PMU with the event
10
name) the legacy encodings have priority.
10
name) the legacy encodings have priority.
11
12
The situation is further inconsistent as legacy events are case
13
sensitive, so on Intel that provides a sysfs instructions event, the
14
instructions event without a PMU and lowercase is legacy while with
15
uppercase letters it matches with sysfs which is case insensitive. Are
16
there legacy events with upper case letters? Yes there are, the cache
17
ones mix case freely:
18
19
L1-dcache|l1-d|l1d|L1-data|L1-icache|l1-i|l1i|L1-instruction|LLC|L2|dTLB|d-tlb|Data-TLB|iTLB|i-tlb|Instruction-TLB|branch|branches|bpu|btb|bpc|node
20
21
meaning LLC that means L2 (which is wrong) both match as part of a
22
legacy cache name but llc and l2 would only match sysfs/json
23
events. The whole thing just points at the ridiculous nature of legacy
24
events and why we'd want them to be preffered I don't know. Why should
25
case of a letter or having a PMU prefix impact the encoding in the
26
perf_event_attr?
11
27
12
The patch doing this work was reverted in a v6.10 release candidate
28
The patch doing this work was reverted in a v6.10 release candidate
13
as, even though the patch was posted for weeks and had been on
29
as, even though the patch was posted for weeks and had been on
14
linux-next for weeks without issue, Linus was in the habit of using
30
linux-next for weeks without issue, Linus was in the habit of using
15
explicit legacy events with unsupported precision options on his
31
explicit legacy events with unsupported precision options on his
...
...
18
being also a legacy event name. ARM haven't renamed the cycles event
34
being also a legacy event name. ARM haven't renamed the cycles event
19
to a more consistent cpu_cycles and avoided the problem. With these
35
to a more consistent cpu_cycles and avoided the problem. With these
20
changes the problematic event will now be skipped, a large warning
36
changes the problematic event will now be skipped, a large warning
21
produced, and perf record will continue for the other PMU events. This
37
produced, and perf record will continue for the other PMU events. This
22
solution was proposed by Arnaldo.
38
solution was proposed by Arnaldo.
39
40
v7: Expand cover letter, fix a missed core_ok check in the v6
41
rebase. Note, as with v6 there is an alternate series that
42
prioritizes legacy events but that is silly and I'd prefer we
43
didn't do it.
23
44
24
v6: Rebase of v5 (dropping already merged patches):
45
v6: Rebase of v5 (dropping already merged patches):
25
https://lore.kernel.org/lkml/20250109222109.567031-1-irogers@google.com/
46
https://lore.kernel.org/lkml/20250109222109.567031-1-irogers@google.com/
26
that unusually had an RFC posted for it:
47
that unusually had an RFC posted for it:
27
https://lore.kernel.org/lkml/Z7Z5kv75BMML2A1q@google.com/
48
https://lore.kernel.org/lkml/Z7Z5kv75BMML2A1q@google.com/
...
...
73
perf record: Skip don't fail for events that don't open
94
perf record: Skip don't fail for events that don't open
74
perf parse-events: Reapply "Prefer sysfs/JSON hardware events over
95
perf parse-events: Reapply "Prefer sysfs/JSON hardware events over
75
legacy"
96
legacy"
76
97
77
tools/perf/builtin-record.c | 47 ++++++++++++++++++---
98
tools/perf/builtin-record.c | 47 ++++++++++++++++++---
78
tools/perf/util/parse-events.c | 26 +++++++++---
99
tools/perf/util/parse-events.c | 27 +++++++++---
79
tools/perf/util/parse-events.l | 76 +++++++++++++++++-----------------
100
tools/perf/util/parse-events.l | 76 +++++++++++++++++-----------------
80
tools/perf/util/parse-events.y | 60 ++++++++++++++++++---------
101
tools/perf/util/parse-events.y | 60 ++++++++++++++++++---------
81
4 files changed, 139 insertions(+), 70 deletions(-)
102
4 files changed, 140 insertions(+), 70 deletions(-)
82
103
83
--
104
--
84
2.49.0.395.g12beb8f557-goog
105
2.49.0.504.g3bcea36a83-goog
diff view generated by jsdifflib
...
...
188
+    }
188
+    }
189
    if (symbol_conf.kptr_restrict && !evlist__exclude_kernel(evlist)) {
189
    if (symbol_conf.kptr_restrict && !evlist__exclude_kernel(evlist)) {
190
        pr_warning(
190
        pr_warning(
191
"WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,\n"
191
"WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,\n"
192
--
192
--
193
2.49.0.395.g12beb8f557-goog
193
2.49.0.504.g3bcea36a83-goog
diff view generated by jsdifflib
...
...
33
Cc: Mark Rutland <mark.rutland@arm.com>
33
Cc: Mark Rutland <mark.rutland@arm.com>
34
Cc: Namhyung Kim <namhyung@kernel.org>
34
Cc: Namhyung Kim <namhyung@kernel.org>
35
Cc: Peter Zijlstra <peterz@infradead.org>
35
Cc: Peter Zijlstra <peterz@infradead.org>
36
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
36
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
37
---
37
---
38
tools/perf/util/parse-events.c | 26 +++++++++---
38
tools/perf/util/parse-events.c | 27 +++++++++---
39
tools/perf/util/parse-events.l | 76 +++++++++++++++++-----------------
39
tools/perf/util/parse-events.l | 76 +++++++++++++++++-----------------
40
tools/perf/util/parse-events.y | 60 ++++++++++++++++++---------
40
tools/perf/util/parse-events.y | 60 ++++++++++++++++++---------
41
3 files changed, 98 insertions(+), 64 deletions(-)
41
3 files changed, 99 insertions(+), 64 deletions(-)
42
42
43
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
43
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
44
index XXXXXXX..XXXXXXX 100644
44
index XXXXXXX..XXXXXXX 100644
45
--- a/tools/perf/util/parse-events.c
45
--- a/tools/perf/util/parse-events.c
46
+++ b/tools/perf/util/parse-events.c
46
+++ b/tools/perf/util/parse-events.c
...
...
83
+                core_ok++;
83
+                core_ok++;
84
        }
84
        }
85
    }
85
    }
86
86
87
@@ -XXX,XX +XXX,XX @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state,
87
@@ -XXX,XX +XXX,XX @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state,
88
            pr_debug("%s -> fake/%s/\n", event_name, sb.buf);
89
            strbuf_release(&sb);
90
            ok++;
91
+            core_ok++;
88
        }
92
        }
89
    }
93
    }
90
94
91
+    if (hw_config != PERF_COUNT_HW_MAX && !core_ok) {
95
+    if (hw_config != PERF_COUNT_HW_MAX && !core_ok) {
92
+        /*
96
+        /*
...
...
359
+                /*head_config=*/NULL, /*wildcard=*/false);
363
+                /*head_config=*/NULL, /*wildcard=*/false);
360
    if (err)
364
    if (err)
361
        PE_ABORT(err);
365
        PE_ABORT(err);
362
    $$ = list;
366
    $$ = list;
363
--
367
--
364
2.49.0.395.g12beb8f557-goog
368
2.49.0.504.g3bcea36a83-goog
diff view generated by jsdifflib