Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2706962imu; Mon, 19 Nov 2018 04:59:51 -0800 (PST) X-Google-Smtp-Source: AJdET5co++/NFO+/PxtbQny8yV2Z+4yg8/vyrNvv3NeZqmkWdjrV5HDU+zQh5WBNkJ8ps+MLc8jt X-Received: by 2002:a62:399b:: with SMTP id u27mr23666147pfj.181.1542632391606; Mon, 19 Nov 2018 04:59:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542632391; cv=none; d=google.com; s=arc-20160816; b=G7rl5aCVggon7mV+EqU6BRlZkrQrgIHlM2/aIv4ynas3DE1/jx9Hijuz8f5PDI3rdw Q3ZeO+LppBM0MBnkK+GD1K6QjHvWQFPn5tOie1V/9ppehe5T3EE+CqOHu1rg0LJkpMjh bJYbcyzFJC3h2Kn0cLGvqpwZNQJShPCgJvM42Jgf4QHM7q6KpxLhw8HOtSY44kF56MPE y+6RLOBphOqEm+wVUqlHpAjlEnka2SaMRbVkKaFbnnKLw46DASPC2dXwAIzUtTLKd3M8 IzsuQRGEo8s8nlxHh/5kORBg0kTNmayRfLmQ68rO/sLId4lvWjt+1MhVFtRml6JPmnER TKyA== 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:dkim-signature; bh=5ODMqUXIxXlq8NQaGVEI5LGykRgTtYVNr5q1ok1UGiQ=; b=DFW7ap+qs/Gfmsm04Lp3Nd7Iuaa6HM4EslHbkRBs9vQtpdXvzuNxFbdmzKFmWDsN98 TmBY2fzLD4o6DGQ/p20OGciIU8aHwgMVbdOtDhrjVU8SUt8yKkBmUGQICSXPzhSZR3RY THFO7qvw9QVkIB90oQ+nCTUIuQSNwn72pJgPVqja7WKPSNTLbrmJ0RFvPSuhdpQE+UDm AWbgWhT/NADzECPdXepd08fwsSc6Pr4pTIkGustPogZvzf0nh0WKoOOk+J6BdImX3x6g +MU2qsQhkcavs3cF3LEjemM1xLmxWvleiliK0OitY/8huoowxEc78t8rBZ+psNPHbkig ivqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=IGpQKqMk; 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 w14-v6si38249839plq.327.2018.11.19.04.59.36; Mon, 19 Nov 2018 04:59:51 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=IGpQKqMk; 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 S1728930AbeKSXVw (ORCPT + 99 others); Mon, 19 Nov 2018 18:21:52 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:36742 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728903AbeKSXVv (ORCPT ); Mon, 19 Nov 2018 18:21:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5ODMqUXIxXlq8NQaGVEI5LGykRgTtYVNr5q1ok1UGiQ=; b=IGpQKqMkciwDKHo7ruv/LuIQU R43GWF+/4wGRLhswNCXDNsb3Qq4Z+SGGAZbaoSBN3AdPkwxiGGyK/PlFQRE3H2biKgaXMQlDZgjQs EP11ipfPrnYPDrDKXDQ5yEL/xft9VcnlD/nHtLo1GE9XEbZdstxoGlz5gluhVwKiFIqSpNJOfvLdt Lp2Vi6i2RqvfmeFcu2PTKPRMO0UMNOOGietR5lSuAQ5vZNIXiNFOd77P7WfenX1VImWCYu+ZGksE5 gCdtS5v41FnhSPyUb2ClKsyDz58UeTI0+YTdQk0zdgtSc/fMBfX5nnRJSqaAyd8/+reROxKtQfHbU YbPQedCoQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOj7w-0001gt-Nj; Mon, 19 Nov 2018 12:58:08 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 41F0020298BFC; Mon, 19 Nov 2018 13:58:07 +0100 (CET) Date: Mon, 19 Nov 2018 13:58:07 +0100 From: Peter Zijlstra To: Andrew Murray Cc: 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: <20181119125807.GD9761@hirez.programming.kicks-ass.net> 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: Mutt/1.10.1 (2018-07-13) 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. It is in fact an inline function, not a CPP macro. > 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; > +} > + > static inline bool is_sampling_event(struct perf_event *event) > { > return event->attr.sample_period != 0; > -- > 2.7.4 >