Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2918662imu; Mon, 19 Nov 2018 08:04:27 -0800 (PST) X-Google-Smtp-Source: AJdET5eR+iNDYhPhyS35JAsFpOFVioi9A428U8qjH1DLGJm27V0swLd9d8z+G366fdEDH9mtOzOp X-Received: by 2002:a63:fd0a:: with SMTP id d10mr20943868pgh.164.1542643467822; Mon, 19 Nov 2018 08:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542643467; cv=none; d=google.com; s=arc-20160816; b=HeCJ/fIjsg/DDfiUne0Jgxl2Z5LF6ZmNHB8ZkA+wGmzqlkKAqX235HdXfR6I/uCW+b UASFChoZsmaYBKpabSAPkzkSVXZK9Btct83oVdY9z5zvAORLEfmaSp3SE76s+zGat8Eb Mu+nurCSJG1FWri23U2JZxjdHeyaCKqPAKRfYEx/wRVxcW/cbcgCUAPcHZCDX5npSkVF aL+veofFwh+9QHyO9TK3APxpmQm+0uC5cb4l7GkhmhoSYe0PUTSsIrXMPnsdyuZMW91I f/58wjMMXjWSxruCklOANmQZhoNWZbbMDceVlTV8OIuIglOMPHknBFM+cXI07lzTlrvD Oj+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=iQTsBNpEhfzzxmi4pKHP2iraafra8rO3xV5ZErS7+g4=; b=cxAzEBRanQP88t1bs+BdXZqHAcTUSoO7rQg/W+Gsp+La/LFCd4yJhIDTaKyRTv+nYT A+d/gKwudoyxEYslV0HQ08ZeE5TDqe/OJpUsNwYN1i9HXdvnF3nNhx9i9v86Ly3YFky9 /Hdz1Jxh1EQxjDQATKdf3dNfQ4OQPWsA2bjmAyvZmhplu1qi4MFxsAjDyOo3pJ/EL5RS sPPNFGAXPoMTAm0ny86gYBdYmTJ1e8jEi7p9chnc1Z1sC2H+HoNOL7BCOdeIjPrCGSlz 8JSTtX+MF3nunBeK6S7bn5P5NQYpKsPOZaMtHPiS51FD/PZWQo9uw5pqJ6NwwTNEZUYi L1bg== 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 u69si22547472pfj.219.2018.11.19.08.03.57; Mon, 19 Nov 2018 08:04:27 -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 S1729933AbeKTCZ0 (ORCPT + 99 others); Mon, 19 Nov 2018 21:25:26 -0500 Received: from foss.arm.com ([217.140.101.70]:60340 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729825AbeKTCZZ (ORCPT ); Mon, 19 Nov 2018 21:25:25 -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 04D7A80D; Mon, 19 Nov 2018 08:01:25 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7A4403F575; Mon, 19 Nov 2018 08:01:22 -0800 (PST) Date: Mon, 19 Nov 2018 16:01:20 +0000 From: Mark Rutland To: Andrew Murray Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Shawn Guo , Sascha Hauer , Will Deacon , Benjamin Herrenschmidt , Thomas Gleixner , Borislav Petkov , x86@kernel.org, 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 Message-ID: <20181119160119.mp6oq6rt5k4fdrd5@lakrids.cambridge.arm.com> References: <1542363853-13849-1-git-send-email-andrew.murray@arm.com> <1542363853-13849-2-git-send-email-andrew.murray@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542363853-13849-2-git-send-email-andrew.murray@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 16, 2018 at 10:24:04AM +0000, Andrew Murray wrote: > Add a macro that tests if any of the perf event exclusion flags > are set on a given event. > > Signed-off-by: Andrew Murray Aside from the s/macro/function, or s/macro/helper/, this looks sound to me. Assuming you fix that up here and in subsequent commit messages, for this patch feel free to add: Acked-by: Mark Rutland Mark. > --- > 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; > +} > + > static inline bool is_sampling_event(struct perf_event *event) > { > return event->attr.sample_period != 0; > -- > 2.7.4 >