Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp280176imu; Fri, 16 Nov 2018 02:25:30 -0800 (PST) X-Google-Smtp-Source: AJdET5camUbgf416+qf8kpi15KgE16bDyGNVQKsQPT2gCNqXPp6N0konmvwQXdIe+niFZY69h9wS X-Received: by 2002:a65:62da:: with SMTP id m26mr9469230pgv.278.1542363930047; Fri, 16 Nov 2018 02:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542363930; cv=none; d=google.com; s=arc-20160816; b=pJP+R0ZvXmumfLttL5zjEIc7h6w5z2rY0vXtLWnXy36teD6v0Lg1RyIwqb+stl+eJ0 0sEKQQrnF1bSZiJDBzmXmCU8LyCFM/K0L7jDHQWYcl1VYGs8n5ZpZhBjoBowQ6aewmSh kbRqRzrVgBZiIG+oMFqlOlZUygVqaPSmetDa07DcQ00parxrR12ou5+0k3ntY58A/0Pc o1J/R1vngJTm9tAaLDn74xJlVvRmHKx2qiqwQP691hVyUQnI7l0dc1Qezz+fs+alTYlG N80ETFp5e0OWe4kgNQWu/9aI/oKqpQSGgnTPMz80CU/q5L1dF/WEOKlliA2x36EHK8D1 bFHA== 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=ZJ2qb/z43RLxaVoCGcAcNHyE1YvvePOBEKJvJ6YzGQc=; b=snlo0Dh4EsuyuSqyvHR0LDdlFlWs/r3PdgC7DWoWZCXp9EkdxiqrLCOIeIeBVgOPXu /tG8REaOdAzDx10/V3jtLOKVxNOR12WN+1RCovpD8uuTjJWubrePUl2+PGx/xunji7Ko PPt8TecRBT7s0zQsYknXSwyZvkXggzkuLd65/x4Zn5PWYNOghtHeloLnGgqfpJRTmcr+ jdEnBzBlwZ45pAYgltfrLYEV63kl8qSdEFqm8ENLHhlYXaXzkGxOdDc2MIRonlnDnE2p TtgqsC8V0nijmcT7PMPRwxY9ldqwMgpYJvhqQ28I2ZkW49+TFXMdp6wKHY3G0IYQePks U1EQ== 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 ca18-v6si33208133plb.261.2018.11.16.02.25.15; Fri, 16 Nov 2018 02:25:30 -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 S2389538AbeKPUgM (ORCPT + 99 others); Fri, 16 Nov 2018 15:36:12 -0500 Received: from foss.arm.com ([217.140.101.70]:48698 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727650AbeKPUgM (ORCPT ); Fri, 16 Nov 2018 15:36:12 -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 3829D15BE; Fri, 16 Nov 2018 02:24:30 -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 326BD3F5BD; Fri, 16 Nov 2018 02:24:27 -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 Cc: linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/10] arm: perf/core: generalise event exclusion checking with perf macro Date: Fri, 16 Nov 2018 10:24:05 +0000 Message-Id: <1542363853-13849-3-git-send-email-andrew.murray@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542363853-13849-1-git-send-email-andrew.murray@arm.com> References: <1542363853-13849-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 Replace checking of perf event exclusion flags with perf macro. Signed-off-by: Andrew Murray --- arch/arm/mach-imx/mmdc.c | 8 +------- arch/arm/mm/cache-l2x0-pmu.c | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 04b3bf7..d9d468f 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -293,13 +293,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_has_exclude_flags(event) || event->attr.sample_period) return -EINVAL; if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS) diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index afe5b4c..968fdf8 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -314,12 +314,7 @@ 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) + if (event_has_exclude_flags(event)) return -EINVAL; if (event->cpu < 0) -- 2.7.4