[4.2.y-ckt stable] Patch "perf: Fix inherited events vs. tracepoint filters" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Mon Jan 4 23:22:41 UTC 2016


This is a note to let you know that I have just added a patch titled

    perf: Fix inherited events vs. tracepoint filters

to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue

This patch is scheduled to be released in version 4.2.8-ckt1.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 6c9496f25404e9952a91f3a64a535d280b1a4a56 Mon Sep 17 00:00:00 2001
From: Peter Zijlstra <peterz at infradead.org>
Date: Mon, 2 Nov 2015 10:50:51 +0100
Subject: perf: Fix inherited events vs. tracepoint filters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

commit b71b437eedaed985062492565d9d421d975ae845 upstream.

Arnaldo reported that tracepoint filters seem to misbehave (ie. not
apply) on inherited events.

The fix is obvious; filters are only set on the actual (parent)
event, use the normal pattern of using this parent event for filters.
This is safe because each child event has a reference to it.

Reported-by: Arnaldo Carvalho de Melo <acme at kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme at kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz at infradead.org>
Cc: Adrian Hunter <adrian.hunter at intel.com>
Cc: Arnaldo Carvalho de Melo <acme at redhat.com>
Cc: David Ahern <dsahern at gmail.com>
Cc: Frédéric Weisbecker <fweisbec at gmail.com>
Cc: Jiri Olsa <jolsa at kernel.org>
Cc: Jiri Olsa <jolsa at redhat.com>
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Steven Rostedt <rostedt at goodmis.org>
Cc: Thomas Gleixner <tglx at linutronix.de>
Cc: Wang Nan <wangnan0 at huawei.com>
Link: http://lkml.kernel.org/r/20151102095051.GN17308@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo at kernel.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 kernel/events/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index e6feb51..c06fa66 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6644,6 +6644,10 @@ static int perf_tp_filter_match(struct perf_event *event,
 {
 	void *record = data->raw->data;

+	/* only top level events have filters set */
+	if (event->parent)
+		event = event->parent;
+
 	if (likely(!event->filter) || filter_match_preds(event->filter, record))
 		return 1;
 	return 0;
--
1.9.1





More information about the kernel-team mailing list