Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp280335imu; Fri, 16 Nov 2018 02:25:41 -0800 (PST) X-Google-Smtp-Source: AJdET5d55aIgh5N0lTRLpgFylVRzyHw5z6qg4HDVsPLsSh+dEFPrKV1z97ecqHUny1BMIVJiQEjl X-Received: by 2002:a62:d405:: with SMTP id a5mr10551855pfh.116.1542363941546; Fri, 16 Nov 2018 02:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542363941; cv=none; d=google.com; s=arc-20160816; b=CTxICZ37ZP2atCi2QEtuu+yxI4cir+BKPfzwqsxBxDnUafcYif1Fwnf9PjgCQckPm0 gjSNCERfNovhRsAMFzipi5cGQdyGuLQ97safcfGaWWhSkU26N7KUGE9wykXeNXWjXcvH iIb5fCMwO9Fh0UZEb/LaMSCXImV0mofF4RJ330LgiWA5Dpo9TqzI4SvHV6Is+3toR6eN FelTmg8RrHHTGg/piFRZ9TqWZPBkZEjCd8BkKWWAmyTdDBLs8yKH2KJ91+Q834udZqf1 xt1oO3vkCKKDJkdt2yC0PWpRqbx9Bs5n6tTuo//t8Zt4zLbCEOLpZ6pwxieQ+b8Ym70M 65Iw== 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=VbOlY/7ErqEAFQyiNspW/w+TKUJv8fBlNs0M2KqZqF8=; b=O0KPWV+i0FHQHBgj05yewqKuhcuJDHOZ9O720LQS0Tzn9xTDRj76i5XKnZXar6O+IF 0Oed15o/X4mySk20uIgCf4ckJvBS/+ih1kicPRipeXRkcgfWqbwQ7idGYSHAgX7soY55 YmhHpajqmC2FIfOhH91e8qFxz8ByHXWzE+fpuPrPKcEo0MavdXx+/9wbJaDev6tgSmyq xvuIlvGAeC8rERUg55rL+EjDtDg5GllU/2iZPnuMJBEVI9GboqI5Z/ugxlGlXp04GdMC R8h6v2pOlGTZU8SorCYdBFTEX8zWQ6lWsoEYIurPSLi4U89V6l4mIPVM3IL/v5fMAqYU LBxQ== 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 d139-v6si32410858pfd.93.2018.11.16.02.25.27; Fri, 16 Nov 2018 02:25:41 -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 S2389584AbeKPUgT (ORCPT + 99 others); Fri, 16 Nov 2018 15:36:19 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48750 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727681AbeKPUgT (ORCPT ); Fri, 16 Nov 2018 15:36:19 -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 DF1C7165C; Fri, 16 Nov 2018 02:24:36 -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 D8E253F5BD; Fri, 16 Nov 2018 02:24:33 -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 04/10] powerpc: perf/core: generalise event exclusion checking with perf macro Date: Fri, 16 Nov 2018 10:24:07 +0000 Message-Id: <1542363853-13849-5-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/powerpc/perf/hv-24x7.c | 7 +------ arch/powerpc/perf/hv-gpci.c | 7 +------ arch/powerpc/perf/imc-pmu.c | 14 ++------------ 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index 72238ee..60db22d 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c @@ -1307,12 +1307,7 @@ static int h_24x7_event_init(struct perf_event *event) } /* unsupported modes and filters */ - 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; /* no branch sampling */ diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c index 43fabb3..2d2b5c0 100644 --- a/arch/powerpc/perf/hv-gpci.c +++ b/arch/powerpc/perf/hv-gpci.c @@ -233,12 +233,7 @@ static int h_gpci_event_init(struct perf_event *event) } /* unsupported modes and filters */ - 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; /* no branch sampling */ diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 1fafc32b..1ae1d3f 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -474,12 +474,7 @@ static int nest_imc_event_init(struct perf_event *event) return -EINVAL; /* unsupported modes and filters */ - 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) @@ -749,12 +744,7 @@ static int core_imc_event_init(struct perf_event *event) return -EINVAL; /* unsupported modes and filters */ - 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