Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp776338imu; Tue, 20 Nov 2018 06:50:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/XlMJG7vQBRU/D0tu/p1bTNUHusmQRQ3cf2qMltRfb+ab8bm6w1iB2Fe1MmDg1CbL0R2YHG X-Received: by 2002:a63:165e:: with SMTP id 30mr2172571pgw.103.1542725445718; Tue, 20 Nov 2018 06:50:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542725445; cv=none; d=google.com; s=arc-20160816; b=C2QlkdENGQyaJDnu58GTHkeNMqYGBo6D2SKdFqwhiXY93tFGp629ussMq/ZIAjIzLq TEQwzwJCswRvWV97Cwwo6cO+9OI2e4kqzLT4gpMREa9UY11/rAjr5833aFJNvPM8T602 j+bw4FLNYzAYiphGX3rDm9ccB2t5Ji6wXu0X0UrhH4U0c94iQ/qrKt1tpvGzgcRbKaWj G8Q/JfQmniObkoWTwSUcyd+1AhqzAdDhXLkZ9s7p5iu7XvmUAi9YaEIvhwDi8Z1A5URR 8N9we3MMjzxGkut9qlej7p8oAAKh2NjWomp3lpqMDnt6HFPuf1Q9jmI6QNy2U1Odg2QQ 6ulw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=d3h4hmHUHiutJehHOi9mkNQ6108Py7tduLgqfUwVI5w=; b=hAJHV5eOPeTIOwB6fqctAKx8ZP7ZihRnezej9nuSf51hs76frRdlmL/D3UvM+RGJYi 4Lc8Eu13ZtKZPi8rMjHS6Inlw44uGacgxxRSVjIyKNfuC01Z4J4NlFrOLXHHbhzirIv3 dr3/YS6hQfs93lS3VjmmQ373Rf+Gzyg+BaAIuBOCyKVR0JCd18gCKx6iPn4z9bwqnmeG UHtFnHNVydeowsK+kClWmgGg21XEDNRDObXdy4+6/FQROb+G7t3EysFd16SiaxaX1+cL NugjIUQn49mr09zLHhtAHjS5CipL8hYTPQbaOnAHa8KQ51IPXZ5ethLDHImj5GjCPQ+2 /OtA== 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 n4si23667695pgd.10.2018.11.20.06.50.30; Tue, 20 Nov 2018 06:50:45 -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 S1729164AbeKTV5T (ORCPT + 99 others); Tue, 20 Nov 2018 16:57:19 -0500 Received: from ozlabs.org ([203.11.71.1]:44239 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbeKTV5T (ORCPT ); Tue, 20 Nov 2018 16:57:19 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42zk3n22Mpz9s3l; Tue, 20 Nov 2018 22:28:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Andrew Murray , 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: Re: [PATCH 01/10] perf/core: Add macro to test for event exclusion flags In-Reply-To: <1542363853-13849-2-git-send-email-andrew.murray@arm.com> References: <1542363853-13849-1-git-send-email-andrew.murray@arm.com> <1542363853-13849-2-git-send-email-andrew.murray@arm.com> Date: Tue, 20 Nov 2018 22:28:34 +1100 Message-ID: <87sgzw0yzh.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew Murray writes: > Add a macro that tests if any of the perf event exclusion flags > are set on a given event. > > Signed-off-by: Andrew Murray > --- > include/linux/perf_event.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > index 53c500f..89ee7fa 100644 > --- a/include/linux/perf_event.h > +++ b/include/linux/perf_event.h > @@ -1004,6 +1004,15 @@ perf_event__output_id_sample(struct perf_event *event, > extern void > perf_log_lost_samples(struct perf_event *event, u64 lost); > > +static inline bool event_has_exclude_flags(struct perf_event *event) > +{ > + struct perf_event_attr *attr = &event->attr; > + > + return attr->exclude_idle || attr->exclude_user || > + attr->exclude_kernel || attr->exclude_hv || > + attr->exclude_guest || attr->exclude_host; > +} Sorry to be a total PITA, but using "flags" plural suggests that it only returns true if there is more than one exclude flag set. A better name would be event_has_exclude_flag() or maybe event_has_any_exclude_flag(). If you're doing a respin anyway it'd be nice to fix the name, but obviously it's not high priority. cheers