Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5633107imu; Mon, 26 Nov 2018 03:16:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/UfJ+CdrCLU0cVgC1l08SZ3ctwuS36jMF9KsOE2HvohQLES0c9FbhmrFh7QXUG6/1WunBVH X-Received: by 2002:a17:902:d806:: with SMTP id a6mr26251933plz.172.1543231016208; Mon, 26 Nov 2018 03:16:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543231016; cv=none; d=google.com; s=arc-20160816; b=NHfV98D45VH6TbvgqkGJ3Uqm7RfMoQhoaiomEPlqV0dXQ8YBlY4Km6oz7Dboq1UWjC WlyiNzjpyaMjvGn7WLmyplk4+U0MP9HzTvP8cnSfjMr5T2kD/Or8GGEwlebjW7+r466n gyok3s9iPsqMpnQS3n95PpUcOwaoWJEG+ZA9TbXj+4LmU0jSgwqfzHvkF3VKZpRIdd9V /SJDVo3m1QTKUz30TuNvjJyarGlfm9GWQQPN+1XRp4HilCMzWICUEIWrQEYvUHTq3x/1 uCeVCg3FO9N3JgeuoQOL7k/ad6cAS8mhei78IXCpk9VQ2ozovSxPbZcQxwhPUgn6E6yf f1xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=mEd369I+JSVrS1OlTjQOWmlyvuIqTMURsK1bCBLl7rY=; b=K0T/bVLIeGgVCu8uO8XBBOXUVS5xCzfXw1MO0j6YNChPg3EpdTLa5QZcw4EHwfJMW8 JKN/wqYVhRJG0th+dflEtMpy9l0uC6i/YYiyd4g7Y8V/BPuSC5wuwmpJpX/qqJ0l4Za4 3oV8VVn0GT9XhdZAVNgpcwN49ACRizXfGKA4jaNISKUKJWkMIyWNHPrI9CfBkDNG1Ycn iN6k+0/oxE7+CFPzTZU/uYdcnbi9YwoO32FDPdHS8FXT1nIfqumFEJvicxw/sQLOgXQP yDU0eIKGmwN18pzIkjLuo1e2rFtYf15UrILeO2bijyS9Il4XDukyhIX56XtFbOuYJFfj 3jew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e129si60818127pgc.333.2018.11.26.03.16.42; Mon, 26 Nov 2018 03:16:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730858AbeKZWH5 (ORCPT + 99 others); Mon, 26 Nov 2018 17:07:57 -0500 Received: from foss.arm.com ([217.140.101.70]:32854 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729507AbeKZWH5 (ORCPT ); Mon, 26 Nov 2018 17:07:57 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0AD2356D; Mon, 26 Nov 2018 03:14:09 -0800 (PST) Received: from e119886-lin.cambridge.arm.com (unknown [10.37.6.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 147B33F5AF; Mon, 26 Nov 2018 03:14:04 -0800 (PST) From: Andrew Murray To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Shawn Guo , Sascha Hauer , Will Deacon , Mark Rutland , Benjamin Herrenschmidt , Thomas Gleixner , Borislav Petkov , x86@kernel.org, Ralf Baechle , Paul Burton , James Hogan , Martin Schwidefsky , Heiko Carstens , "David S . Miller" , sparclinux@vger.kernel.org, Michael Ellerman Cc: linux-s390@vger.kernel.org, linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org Subject: [PATCH v2 09/20] drivers/perf: perf/core: remove unnecessary checks for exclusion Date: Mon, 26 Nov 2018 11:12:25 +0000 Message-Id: <1543230756-15319-10-git-send-email-andrew.murray@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543230756-15319-1-git-send-email-andrew.murray@arm.com> References: <1543230756-15319-1-git-send-email-andrew.murray@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For drivers that do not support context exclusion we do not advertise the PERF_PMU_CAP_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray --- drivers/perf/arm-cci.c | 9 --------- drivers/perf/arm-ccn.c | 5 +---- drivers/perf/arm_dsu_pmu.c | 8 +------- drivers/perf/hisilicon/hisi_uncore_pmu.c | 9 --------- 4 files changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c index 1bfeb16..501b497 100644 --- a/drivers/perf/arm-cci.c +++ b/drivers/perf/arm-cci.c @@ -1327,15 +1327,6 @@ static int cci_pmu_event_init(struct perf_event *event) if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) return -EOPNOTSUPP; - /* We have no filtering of any kind */ - if (event->attr.exclude_user || - event->attr.exclude_kernel || - event->attr.exclude_hv || - event->attr.exclude_idle || - event->attr.exclude_host || - event->attr.exclude_guest) - return -EINVAL; - /* * Following the example set by other "uncore" PMUs, we accept any CPU * and rewrite its affinity dynamically rather than having perf core diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c index 7dd850e..decf881 100644 --- a/drivers/perf/arm-ccn.c +++ b/drivers/perf/arm-ccn.c @@ -741,10 +741,7 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) return -EOPNOTSUPP; } - if (has_branch_stack(event) || event->attr.exclude_user || - event->attr.exclude_kernel || event->attr.exclude_hv || - event->attr.exclude_idle || event->attr.exclude_host || - event->attr.exclude_guest) { + if (has_branch_stack(event)) { dev_dbg(ccn->dev, "Can't exclude execution levels!\n"); return -EINVAL; } diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c index 660cb8a..036414c 100644 --- a/drivers/perf/arm_dsu_pmu.c +++ b/drivers/perf/arm_dsu_pmu.c @@ -562,13 +562,7 @@ static int dsu_pmu_event_init(struct perf_event *event) return -EINVAL; } - if (has_branch_stack(event) || - event->attr.exclude_user || - event->attr.exclude_kernel || - event->attr.exclude_hv || - event->attr.exclude_idle || - event->attr.exclude_host || - event->attr.exclude_guest) { + if (has_branch_stack(event)) { dev_dbg(dsu_pmu->pmu.dev, "Can't support filtering\n"); return -EINVAL; } diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index 9efd241..f028cbc 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -142,15 +142,6 @@ int hisi_uncore_pmu_event_init(struct perf_event *event) if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK) return -EOPNOTSUPP; - /* counters do not have these bits */ - if (event->attr.exclude_user || - event->attr.exclude_kernel || - event->attr.exclude_host || - event->attr.exclude_guest || - event->attr.exclude_hv || - event->attr.exclude_idle) - return -EINVAL; - /* * The uncore counters not specific to any CPU, so cannot * support per-task -- 2.7.4