From 6f197b73304b3bd3d5a43b931383a5331d6b2987 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Mon, 7 Mar 2011 21:27:09 +0100 Subject: [PATCH] perf: Handle stopped state with tracepoints commit a0f7d0f7fc02465bb9758501f611f63381792996 upstream. We toggle the state from start and stop callbacks but actually don't check it when the event triggers. Do it so that these callbacks actually work. Signed-off-by: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: Paul Mackerras Cc: Stephane Eranian Signed-off-by: Peter Zijlstra LKML-Reference: <1299529629-18280-2-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- kernel/perf_event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 183d437f4a0f..f9af60f30adf 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -4167,6 +4167,8 @@ static void tp_perf_event_destroy(struct perf_event *event) static const struct pmu *tp_perf_event_init(struct perf_event *event) { + if (event->hw.state & PERF_HES_STOPPED) + return 0; /* * Raw tracepoint data is a severe data leak, only allow root to * have these. -- 2.34.1