Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3230341imu; Sat, 24 Nov 2018 00:38:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/UDJjYxbqdqoxn+pMpF+PHuRyik3tpdGllEuZE3CdIH5w+qIwJSU5xnxLkMHiyC62fhg5qa X-Received: by 2002:a17:902:42e4:: with SMTP id h91mr19440486pld.18.1543048681961; Sat, 24 Nov 2018 00:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543048681; cv=none; d=google.com; s=arc-20160816; b=fljz1VSxszRoPsimEuo83wU/SzbgQImEPt7aVElPm7bTOIWpqPeAVv6s16nZJUDU0W 7eufXzTpNB3HESBqvhaQBihynFqjSmjt1THV1m4f/bYhtGy5IHe1UhTnv2KWh3fAwKyA xz3AtQ3LUJmO3286MrJrDkx/AQ4NuyWZ435DDVXwcSNTcDmYkhRLyp9oVrtc52F/qIIy hlktuisxlheCktuEPIlz1qZKWhHIYgR2M5Xp4M4TsFzxkLHlP6lQijcKlQyg/9YyNPvD IQmbxfNCbuYvQine2eiM9SMfN+wS1VCjp96lm8LNk1ZBjx86+EAnJqSfR0QZlMb9mtWT PAcQ== 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=vX/+e/V9XJ4+195wNn2bFW+MSK9W2A4itJb43WFmE34=; b=uezSekZPD4YsFQhQxh1yVgzeKQpETdlTT1rn8dHicU4r3Q3ik4o/PZXpZGD7r73gAI ng8yMXqcKdXda5MmIsFkZmmlhyS29qcQLdk7lJ7lQu3ikz549kkMmaudgFwjQd1+d649 CjeKBW1F5ejpIqGRoxPV6AIzi5CwoRl6xpCd7xFD2T8VJ64Ydft1/EISvUin4cZUgea+ EWioW4lrMwLUAbC+M0FV9n8GTGpGDQMTAnwkP+d7hU8CMEPWBtf4E1OpMmY1iFGYtHd5 u8ijids1CzDRFOpTgcsoeX3bLjZY+Carm+gDGdE51xbZOYzCl5zWHIFtxgwX/qxyEwsW tDmA== 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 h19si37812030plr.67.2018.11.24.00.37.47; Sat, 24 Nov 2018 00:38:01 -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 S2440013AbeKXBQk (ORCPT + 99 others); Fri, 23 Nov 2018 20:16:40 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:46516 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391009AbeKXBQk (ORCPT ); Fri, 23 Nov 2018 20:16:40 -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 A2DB03620; Fri, 23 Nov 2018 06:32:15 -0800 (PST) Received: from localhost (unknown [10.37.6.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 391283F575; Fri, 23 Nov 2018 06:32:15 -0800 (PST) Date: Fri, 23 Nov 2018 14:32:13 +0000 From: Andrew Murray To: Michael Ellerman Cc: 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, 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: <20181123143213.GB1617@e119886-lin.cambridge.arm.com> References: <1542363853-13849-1-git-send-email-andrew.murray@arm.com> <1542363853-13849-2-git-send-email-andrew.murray@arm.com> <87sgzw0yzh.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sgzw0yzh.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 10:28:34PM +1100, Michael Ellerman wrote: > 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. No problem - I'll go with event_has_any_exclude_flag. Thanks, Andrew Murray > > cheers