From: tip-bot for Wang Nan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: lizefan@huawei.com, ak@linux.intel.com, hpa@zytor.com,
linux-kernel@vger.kernel.org, wangnan0@huawei.com,
sukadev@linux.vnet.ibm.com, acme@redhat.com, jolsa@kernel.org,
tglx@linutronix.de, mingo@kernel.org
Subject: [tip:perf/urgent] perf jevents: Handle events including .c and .o
Date: Mon, 17 Oct 2016 07:52:57 -0700 [thread overview]
Message-ID: <tip-2d470b62fa24f8d0024e8d392d28814c287ee1f1@git.kernel.org> (raw)
In-Reply-To: <1475900185-37967-1-git-send-email-wangnan0@huawei.com>
Commit-ID: 2d470b62fa24f8d0024e8d392d28814c287ee1f1
Gitweb: http://git.kernel.org/tip/2d470b62fa24f8d0024e8d392d28814c287ee1f1
Author: Wang Nan <wangnan0@huawei.com>
AuthorDate: Sat, 8 Oct 2016 04:16:25 +0000
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 17 Oct 2016 11:24:18 -0300
perf jevents: Handle events including .c and .o
This patch helps with Sukadev's vendor event tree where such events can happen.
>From Andi Kleen:
Any event including a .c/.o/.bpf currently triggers BPF compilation or loading
and then an error. This can happen for some Intel vendor events, which cannot
be used.
This patch fixes this problem by forbidding BPF file patch containing '{', '}'
and ',', make sure flex consumes the leading '{', instead of matching it using
a BPF file path.
Tested result:
$ perf stat -e '{unc_p_clockticks,unc_p_power_state_occupancy.cores_c0}' -a -I 1000
invalid or unsupported event: '{unc_p_clockticks,unc_p_power_state_occupancy.cores_c0}'
Run 'perf list' for a list of valid events
(as expected, interperted as event)
$ perf stat -e 'aaa.c' -a -I 1000
ERROR: problems with path aaa.c: No such file or directory
(as expected, interpreted as BPF source)
$ perf stat -e 'aaa.ccc' -a -I 1000
invalid or unsupported event: 'aaa.ccc'
(as expected, interpreted as event)
$ perf stat -e '{aaa.c}' -a -I 1000
ERROR: problems with path aaa.c: No such file or directory
event syntax error: '{aaa.c}'
<SKIP>
(as expected, interpreted as BPF source)
$ perf stat -e '{cycles,aaa.c}' -a -I 1000
ERROR: problems with path aaa.c: No such file or directory
event syntax error: '{cycles,aaa.c}'
(as expected, interpreted as BPF source)
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Reported-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1475900185-37967-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/parse-events.l | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 9f43fda..660fca0 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -136,8 +136,8 @@ do { \
group [^,{}/]*[{][^}]*[}][^,{}/]*
event_pmu [^,{}/]+[/][^/]*[/][^,{}/]*
event [^,{}/]+
-bpf_object .*\.(o|bpf)
-bpf_source .*\.c
+bpf_object [^,{}]+\.(o|bpf)
+bpf_source [^,{}]+\.c
num_dec [0-9]+
num_hex 0x[a-fA-F0-9]+
next prev parent reply other threads:[~2016-10-17 14:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 19:47 Some minor fixes for the perf tools json event code Andi Kleen
2016-10-05 19:47 ` [PATCH 1/3] perf, tools: Handle events including .c and .o Andi Kleen
2016-10-05 22:47 ` Arnaldo Carvalho de Melo
2016-10-06 16:55 ` Andi Kleen
2016-10-06 20:07 ` Arnaldo Carvalho de Melo
2016-10-06 20:18 ` Arnaldo Carvalho de Melo
2016-10-08 4:02 ` Wangnan (F)
2016-10-08 4:16 ` [PATCH] " Wang Nan
2016-10-17 14:52 ` tip-bot for Wang Nan [this message]
2016-10-05 19:47 ` [PATCH 2/3] perf, tools: Handle completion of upper case events Andi Kleen
2016-10-05 21:50 ` Arnaldo Carvalho de Melo
2016-10-05 22:18 ` Andi Kleen
2016-10-05 22:35 ` Arnaldo Carvalho de Melo
2016-10-05 19:47 ` [PATCH 3/3] perf, tools: Fix Intel fixed counter conversions Andi Kleen
2016-10-06 22:41 ` [tip:perf/urgent] perf jevents: Fix Intel JSON " tip-bot for Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-2d470b62fa24f8d0024e8d392d28814c287ee1f1@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=sukadev@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.