From: tip-bot for Alexander Shishkin <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, will.deacon@arm.com, tglx@linutronix.de,
vincent.weaver@maine.edu, mingo@kernel.org, peterz@infradead.org,
jolsa@redhat.com, alexander.shishkin@linux.intel.com,
eranian@google.com, mark.rutland@arm.com, acme@redhat.com,
mathieu.poirier@linaro.org, torvalds@linux-foundation.org,
linux-kernel@vger.kernel.org, acme@infradead.org
Subject: [tip:perf/core] perf/core: Do error out on a kernel filter on an exclude_filter event
Date: Fri, 10 Feb 2017 00:33:53 -0800 [thread overview]
Message-ID: <tip-9ccbfbb157a38921702402281ca7be530b4c3669@git.kernel.org> (raw)
In-Reply-To: <20170126094057.13805-3-alexander.shishkin@linux.intel.com>
Commit-ID: 9ccbfbb157a38921702402281ca7be530b4c3669
Gitweb: http://git.kernel.org/tip/9ccbfbb157a38921702402281ca7be530b4c3669
Author: Alexander Shishkin <alexander.shishkin@linux.intel.com>
AuthorDate: Thu, 26 Jan 2017 11:40:56 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 10 Feb 2017 09:08:09 +0100
perf/core: Do error out on a kernel filter on an exclude_filter event
It is currently possible to configure a kernel address filter for a
event that excludes kernel from its traces (attr.exclude_kernel==1).
While in reality this doesn't make sense, the SET_FILTER ioctl() should
return a error in such case, currently it does not. Furthermore, it
will still silently discard the filter and any potentially valid filters
that came with it.
This patch makes the SET_FILTER ioctl() error out in such cases.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Will Deacon <will.deacon@arm.com>
Cc: vince@deater.net
Link: http://lkml.kernel.org/r/20170126094057.13805-3-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 88676ff..1730995 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8260,6 +8260,7 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
* attribute.
*/
if (state == IF_STATE_END) {
+ ret = -EINVAL;
if (kernel && event->attr.exclude_kernel)
goto fail;
next prev parent reply other threads:[~2017-02-10 8:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 9:40 [PATCH 0/3] perf: Updates for address filters Alexander Shishkin
2017-01-26 9:40 ` [PATCH 1/3] perf, pt, coresight: Clean up address filter structure Alexander Shishkin
2017-01-26 13:02 ` kbuild test robot
2017-01-26 13:24 ` Alexander Shishkin
2017-01-26 18:26 ` Mathieu Poirier
2017-01-27 12:12 ` Alexander Shishkin
2017-01-27 17:17 ` Mathieu Poirier
2017-02-01 12:46 ` Alexander Shishkin
2017-02-01 21:33 ` Mathieu Poirier
2017-02-01 22:15 ` Mathieu Poirier
2017-02-02 10:42 ` Alexander Shishkin
2017-02-02 17:36 ` Mathieu Poirier
2017-02-02 16:22 ` Alexander Shishkin
2017-02-07 17:50 ` Mathieu Poirier
[not found] ` <20180117123137.3hlmudzu5eogl53n@ukko.fi.intel.com>
2018-01-18 16:59 ` Mathieu Poirier
2018-01-18 17:06 ` Will Deacon
2018-01-18 18:19 ` Mathieu Poirier
2018-01-19 18:50 ` Mathieu Poirier
2017-01-26 9:40 ` [PATCH 2/3] perf: Do error out on a kernel filter on an exclude_filter event Alexander Shishkin
2017-01-26 18:32 ` Mathieu Poirier
2017-02-10 8:33 ` tip-bot for Alexander Shishkin [this message]
2017-01-26 9:40 ` [PATCH 3/3] perf: Allow kernel filters on cpu events Alexander Shishkin
2017-01-26 21:38 ` Mathieu Poirier
2017-01-27 12:31 ` Alexander Shishkin
2017-01-27 17:38 ` Mathieu Poirier
2017-02-10 8:07 ` Ingo Molnar
2017-02-14 12:59 ` Alexander Shishkin
2017-02-10 8:34 ` [tip:perf/core] perf/core: Allow kernel filters on CPU events tip-bot for Alexander Shishkin
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-9ccbfbb157a38921702402281ca7be530b4c3669@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@infradead.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.weaver@maine.edu \
--cc=will.deacon@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).