[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-486efe9f8e30bac1e236f867df164f4966f3e207@git.kernel.org>
Date: Mon, 21 Jan 2019 03:16:41 -0800
From: tip-bot for Andrew Murray <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: paulus@...ba.org, andrew.murray@....com, mingo@...nel.org,
mpe@...erman.id.au, linux@...linux.org.uk, mattst88@...il.com,
peterz@...radead.org, acme@...nel.org,
linux-kernel@...r.kernel.org, s.hauer@...gutronix.de,
torvalds@...ux-foundation.org, tglx@...utronix.de,
ink@...assic.park.msu.ru, rth@...ddle.net, mark.rutland@....com,
bp@...en8.de, shawnguo@...nel.org, hpa@...or.com,
will.deacon@....com, benh@...nel.crashing.org
Subject: [tip:perf/core] perf/core: Add function to test for event exclusion
flags
Commit-ID: 486efe9f8e30bac1e236f867df164f4966f3e207
Gitweb: https://git.kernel.org/tip/486efe9f8e30bac1e236f867df164f4966f3e207
Author: Andrew Murray <andrew.murray@....com>
AuthorDate: Thu, 10 Jan 2019 13:53:24 +0000
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 21 Jan 2019 11:01:19 +0100
perf/core: Add function to test for event exclusion flags
Add a function that tests if any of the perf event exclusion flags
are set on a given event.
Signed-off-by: Andrew Murray <andrew.murray@....com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Ivan Kokshaysky <ink@...assic.park.msu.ru>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Matt Turner <mattst88@...il.com>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Richard Henderson <rth@...ddle.net>
Cc: Russell King <linux@...linux.org.uk>
Cc: Sascha Hauer <s.hauer@...gutronix.de>
Cc: Shawn Guo <shawnguo@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Will Deacon <will.deacon@....com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linuxppc-dev@...ts.ozlabs.org
Cc: robin.murphy@....com
Cc: suzuki.poulose@....com
Link: https://lkml.kernel.org/r/1547128414-50693-3-git-send-email-andrew.murray@arm.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
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 1d5c551a5add..54a78d22f0a6 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;
Powered by blists - more mailing lists