Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3917880imu; Mon, 7 Jan 2019 11:54:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN4LDld8HwCNf83I5jGadcnqjmB+wrUcIWndVk4OZerzb4yBJx5Nlqv3Blj40j37WAG5/rx7 X-Received: by 2002:a63:6d48:: with SMTP id i69mr11645588pgc.215.1546890886415; Mon, 07 Jan 2019 11:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546890886; cv=none; d=google.com; s=arc-20160816; b=i7it5DZocq8pLN2JG2lyy9Z9obT71ksmoQO8vYM/6mXGNZf4iWYOAuhl5VQgBr7QC7 YzNHsBkgEoWSwy3j+8lnXnSV83jQ+yQorvSarfAiPCRXmXVVbwZlYkNLoc9FHYG9sGmK aqFNiAu3psiw6A+QZjmQ3dd55yenkmQE4JSZDVpOrSsEc78ZzDDfEgrCRyhY3p+fWkLI 6QQ2BtmPQ/LDVUfzTaqpCAUbQZ8HXwB2mTlCbULWkjIwLjNVytcSPug+Q8DXhnH30j3F smlpbX5C24a6lHxxvTZchIPsmTxomZYAcR0U97+f8fsQ+NC01ID3uIUqhuXLpKEQrZzv mj0w== 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=PwqOvCfcch9omiIL6ylkhXdA1OAIbejxHHGTHdK+flo=; b=gsA22qGQQT9zBBbzBatFo//43xtMALt/ZIEHkO92K+zqTwFZcA2qww4Ge6cAYWcyS2 lnRusgD026u2UHWgTrDWiqK+333PE/uUJVAGSEUq2AgFzYGYYGiIQCukUfDEZ+7KkgLs VqMiOD4OtEKAot6uUAHU02yS2n7P7WWbnNvV3ZwmTy2SgXAUJ7ZUGZyCaW9/xMgxSV25 KnX9OgTsfJNLMGXu5OB1yc3SQPcmckexYKhWLwk0Ygs8sFvL5oIASKctfyoBwEXvBue4 ZmolUxhSjAaeXwESplKFzgeNsrmrnJbPilAa4uvwQwX/KgtGcHfkSvCGfdLqJnuL7ZSU 8F+w== 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 64si34962292pfe.74.2019.01.07.11.54.31; Mon, 07 Jan 2019 11:54:46 -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 S1730413AbfAGQ1w (ORCPT + 99 others); Mon, 7 Jan 2019 11:27:52 -0500 Received: from foss.arm.com ([217.140.101.70]:34116 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730399AbfAGQ1v (ORCPT ); Mon, 7 Jan 2019 11:27:51 -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 B8C5B1650; Mon, 7 Jan 2019 08:27:50 -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 42CF43F5A0; Mon, 7 Jan 2019 08:27:46 -0800 (PST) From: Andrew Murray To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Richard Henderson , Ivan Kokshaysky , Matt Turner , Will Deacon , Mark Rutland , Shawn Guo , Sascha Hauer , Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Borislav Petkov , Russell King , suzuki.poulose@arm.com, robin.murphy@arm.com, Michael Ellerman Cc: x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org Subject: [PATCH v4 02/13] perf/core: add function to test for event exclusion flags Date: Mon, 7 Jan 2019 16:27:19 +0000 Message-Id: <1546878450-20341-3-git-send-email-andrew.murray@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546878450-20341-1-git-send-email-andrew.murray@arm.com> References: <1546878450-20341-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 Add a function 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 1d5c551..54a78d2 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_any_exclude_flag(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