Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1695279
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v1 02/15] perf, tools: Tighten detection of BPF events |
| Date | 2017-07-25 01:50 +0200 |
| Message-ID | <u6VgS-3zh-25@gated-at.bofh.it> (permalink) |
| References | <u6VgR-3zh-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Andi Kleen <ak@linux.intel.com>
perf stat -e cpu/uops_executed.core,cmask=1/
would be detected as a BPF source event because the .c matches the .c
source BPF pattern.
Add lookahead to the BPF patterns and reject them if they are followed
by more letters.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/parse-events.l | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 660fca05bc93..7fa3f2e851b0 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -182,9 +182,13 @@ modifier_bp [rwx]{1,3}
REWIND(0);
}
+({bpf_object}|{bpf_source})/[^a-z] {
+ BEGIN(INITIAL);
+ REWIND(1);
+ return PE_EVENT_NAME;
+ }
+
{event_pmu} |
-{bpf_object} |
-{bpf_source} |
{event} {
BEGIN(INITIAL);
REWIND(1);
@@ -307,8 +311,8 @@ r{num_raw_hex} { return raw(yyscanner); }
{num_hex} { return value(yyscanner, 16); }
{modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); }
-{bpf_object} { return str(yyscanner, PE_BPF_OBJECT); }
-{bpf_source} { return str(yyscanner, PE_BPF_SOURCE); }
+{bpf_object}/[^a-z] { return str(yyscanner, PE_BPF_OBJECT); }
+{bpf_source}/[^a-z] { return str(yyscanner, PE_BPF_SOURCE); }
{name} { return pmu_str_check(yyscanner); }
"/" { BEGIN(config); return '/'; }
- { return '-'; }
--
2.9.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH v1 02/15] perf, tools: Tighten detection of BPF events Andi Kleen <andi@firstfloor.org> - 2017-07-25 01:50 +0200
csiph-web