From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbdBJIhg (ORCPT ); Fri, 10 Feb 2017 03:37:36 -0500 Received: from terminus.zytor.com ([65.50.211.136]:53230 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752266AbdBJIhG (ORCPT ); Fri, 10 Feb 2017 03:37:06 -0500 Date: Fri, 10 Feb 2017 00:33:53 -0800 From: tip-bot for Alexander Shishkin Message-ID: 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 Reply-To: mathieu.poirier@linaro.org, torvalds@linux-foundation.org, acme@infradead.org, linux-kernel@vger.kernel.org, peterz@infradead.org, jolsa@redhat.com, acme@redhat.com, alexander.shishkin@linux.intel.com, mark.rutland@arm.com, eranian@google.com, vincent.weaver@maine.edu, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, will.deacon@arm.com In-Reply-To: <20170126094057.13805-3-alexander.shishkin@linux.intel.com> References: <20170126094057.13805-3-alexander.shishkin@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/core: Do error out on a kernel filter on an exclude_filter event Git-Commit-ID: 9ccbfbb157a38921702402281ca7be530b4c3669 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9ccbfbb157a38921702402281ca7be530b4c3669 Gitweb: http://git.kernel.org/tip/9ccbfbb157a38921702402281ca7be530b4c3669 Author: Alexander Shishkin AuthorDate: Thu, 26 Jan 2017 11:40:56 +0200 Committer: Ingo Molnar 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mathieu Poirier Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: Will Deacon Cc: vince@deater.net Link: http://lkml.kernel.org/r/20170126094057.13805-3-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar --- 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;