From: Frederic Weisbecker Date: Mon, 7 Mar 2011 20:27:09 +0000 (+0100) Subject: perf: Handle stopped state with tracepoints X-Git-Tag: firefly_0821_release~10186^2~316 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6f197b73304b3bd3d5a43b931383a5331d6b2987;p=firefly-linux-kernel-4.4.55.git 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 --- 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.