perf_events: Fix bad software/trace event recursion counting
authorFrederic Weisbecker <[email protected]>
Tue, 24 Nov 2009 19:38:22 +0000 (20:38 +0100)
committerIngo Molnar <[email protected]>
Tue, 24 Nov 2009 20:34:00 +0000 (21:34 +0100)
Commit 4ed7c92d68a5387ba5f7030dc76eab03558e27f5
(perf_events: Undo some recursion damage) has introduced a bad
reference counting of the recursion context. putting the context
behaves like getting it, dropping every software/trace events
after the first one in a context.

Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Li Zefan <[email protected]>
Cc: Steven Rostedt <[email protected]>
LKML-Reference: <1259091502[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
kernel/perf_event.c

index accfd7bfe3877292259d5005ec5f2c0a33a869fc..35df94e344f2b8acc4fc927e1aaf7426f9cd534d 100644 (file)
@@ -3914,7 +3914,7 @@ void perf_swevent_put_recursion_context(int rctx)
 {
        struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
        barrier();
-       cpuctx->recursion[rctx]++;
+       cpuctx->recursion[rctx]--;
        put_cpu_var(perf_cpu_context);
 }
 EXPORT_SYMBOL_GPL(perf_swevent_put_recursion_context);