[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-9ccbfbb157a38921702402281ca7be530b4c3669@git.kernel.org>
Date: Fri, 10 Feb 2017 00:33:53 -0800
From: tip-bot for Alexander Shishkin <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, will.deacon@....com, tglx@...utronix.de,
vincent.weaver@...ne.edu, mingo@...nel.org, peterz@...radead.org,
jolsa@...hat.com, alexander.shishkin@...ux.intel.com,
eranian@...gle.com, mark.rutland@....com, acme@...hat.com,
mathieu.poirier@...aro.org, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, acme@...radead.org
Subject: [tip:perf/core] perf/core: Do error out on a kernel filter on an
exclude_filter event
Commit-ID: 9ccbfbb157a38921702402281ca7be530b4c3669
Gitweb: http://git.kernel.org/tip/9ccbfbb157a38921702402281ca7be530b4c3669
Author: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
AuthorDate: Thu, 26 Jan 2017 11:40:56 +0200
Committer: Ingo Molnar <mingo@...nel.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@...ux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: Arnaldo Carvalho de Melo <acme@...radead.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Cc: Will Deacon <will.deacon@....com>
Cc: vince@...ter.net
Link: http://lkml.kernel.org/r/20170126094057.13805-3-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.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;
Powered by blists - more mailing lists