perf: Always destroy groups on exit
authorPeter Zijlstra <[email protected]>
Mon, 5 May 2014 09:41:02 +0000 (11:41 +0200)
committerIngo Molnar <[email protected]>
Wed, 7 May 2014 11:44:18 +0000 (13:44 +0200)
Commit 38b435b16c36 ("perf: Fix tear-down of inherited group events")
states that we need to destroy groups for inherited events, but it
doesn't make any sense to not also destroy groups for normal events.

And while it usually makes no difference (the normal events won't
leak, and its very likely all the group events will die in quick
succession) it does make the code more consistent and closes a
potential hole for trouble.

Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Vince Weaver <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/events/core.c

index 1de0d709f69fd83924c5ff6b8df077624c4bf151..819ffc006d673c60528ccf582733a49500b4a373 100644 (file)
@@ -7400,7 +7400,7 @@ __perf_event_exit_task(struct perf_event *child_event,
                         struct perf_event_context *child_ctx,
                         struct task_struct *child)
 {
-       perf_remove_from_context(child_event, !!child_event->parent);
+       perf_remove_from_context(child_event, true);
 
        /*
         * It can happen that the parent exits first, and has events