perf: Revert ("perf: Always destroy groups on exit")
authorPeter Zijlstra <peterz@infradead.org>
Tue, 15 Jul 2014 15:27:27 +0000 (17:27 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 16 Jul 2014 11:18:39 +0000 (13:18 +0200)
commit1903d50cba54261a6562a476c05085f3d7a54097
treed40302cb9e98f490d6426c3e0c02c5a13f097f6f
parent1f9a7268c67f0290837aada443d28fd953ddca90
perf: Revert ("perf: Always destroy groups on exit")

Vince reported that commit 15a2d4de0eab5 ("perf: Always destroy groups
on exit") causes a regression with grouped events. In particular his
read_group_attached.c test fails.

  https://github.com/deater/perf_event_tests/blob/master/tests/bugs/read_group_attached.c

Because of the context switch optimization in
perf_event_context_sched_out() the 'original' event may end up in the
child process and when that exits the change in the patch in question
destroys the actual grouping.

Therefore revert that change and only destroy inherited groups.

Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-zedy3uktcp753q8fw8dagx7a@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c