Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3811232imu; Mon, 7 Jan 2019 09:52:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN5q9vdQd5MYf2Baw/IhWfXLLNX/BsdPYDsOwxwMYCskCOzXi3P3iD6BkuRHP14f7Aekdqp6 X-Received: by 2002:a65:4b82:: with SMTP id t2mr11770904pgq.189.1546883541354; Mon, 07 Jan 2019 09:52:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546883541; cv=none; d=google.com; s=arc-20160816; b=BjxvMbHg/WzT2gAuof32+3pzqJfV/qGPwhNWeSNWR1VtsHLVwUCuMAg1laeNMeCxZL Rw0K1Wv522/+XZr3GxduwaXKvzJLcuU/fj6kKnK26HZbTWYfc4nbNok7PHnJl4Xbx4BV tIWQ5cIEy3BLauSKX+btbyN7FEXoeck6k+qhehMJMI/3tsNqjA7r1IkRIAChDqVRJtWy ZyoJDY8MDdLr7ixVm+AS+60+3UhCDiOSDptCSXG+43D43R1bilwcBt6Mub6LPVDkCpNO eVzuYgX53JHHKGja/VZ7tOT1R6z8yihA55zv8iSEpCPsGfTsEJ/oyf6yHe2EOuTM6YKJ Cskg== 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=HS0zL46UpTCIlkw5YEJt8COrjcokFFA5PwMgH17yhHk=; b=sdyObdqskH8zpj83FFPJ93F3XIVqLSpsQe/NTXQNTxm2ESmEABMm8tF5HhiDqVxqFy RS0G71LoFkw1vY3op4QqgfcbFQiYSntblNh5Igb44lRzeGAzEgizUF1Qu2k2+OeWtqtX BrgedXJHnAPvUUQbNp8xGa8FyGuTMyD05HMkTGbzwPi1h9D0A50f3v5+EHgxA/DqebMh 1nq0kzC0yAGj2oXlBL8eJt4MDbazORzy6kQ+KJASzCGkeMKB4Y6kYs1jhwGpBbHQkoI7 7LP+4CusgXVGkEAnxCJuCvcU85ex3jM112pLlUU2JSZT9S6mPYz+LXG2st7KBm54is+C oktA== 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 u9si9515229plk.61.2019.01.07.09.52.05; Mon, 07 Jan 2019 09:52:21 -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 S1730515AbfAGQ2L (ORCPT + 99 others); Mon, 7 Jan 2019 11:28:11 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34306 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbfAGQ2K (ORCPT ); Mon, 7 Jan 2019 11:28:10 -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 E44CE15AD; Mon, 7 Jan 2019 08:28: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 6EE303F5A0; Mon, 7 Jan 2019 08:28:05 -0800 (PST) From: Andrew Murray To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Richard Henderson , Ivan Kokshaysky , Matt Turner , Will Deacon , Mark Rutland , Shawn Guo , Sascha Hauer , Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Borislav Petkov , Russell King , suzuki.poulose@arm.com, robin.murphy@arm.com, Michael Ellerman Cc: x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org Subject: [PATCH v4 06/13] arm: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs Date: Mon, 7 Jan 2019 16:27:23 +0000 Message-Id: <1546878450-20341-7-git-send-email-andrew.murray@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546878450-20341-1-git-send-email-andrew.murray@arm.com> References: <1546878450-20341-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 let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray Acked-by: Shawn Guo Acked-by: Will Deacon --- arch/arm/mach-imx/mmdc.c | 9 ++------- arch/arm/mm/cache-l2x0-pmu.c | 9 +-------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index e49e068..fce4b42 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -294,13 +294,7 @@ static int mmdc_pmu_event_init(struct perf_event *event) return -EOPNOTSUPP; } - 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 || - event->attr.sample_period) + if (event->attr.sample_period) return -EINVAL; if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS) @@ -456,6 +450,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, .start = mmdc_pmu_event_start, .stop = mmdc_pmu_event_stop, .read = mmdc_pmu_event_update, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE, }, .mmdc_base = mmdc_base, .dev = dev, diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index afe5b4c..99bcd07 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -314,14 +314,6 @@ static int l2x0_pmu_event_init(struct perf_event *event) event->attach_state & PERF_ATTACH_TASK) return -EINVAL; - 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; - if (event->cpu < 0) return -EINVAL; @@ -544,6 +536,7 @@ static __init int l2x0_pmu_init(void) .del = l2x0_pmu_event_del, .event_init = l2x0_pmu_event_init, .attr_groups = l2x0_pmu_attr_groups, + .capabilities = PERF_PMU_CAP_NO_EXCLUDE, }; l2x0_pmu_reset(); -- 2.7.4