perf: Fix tear-down of inherited group events
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Tue, 15 Mar 2011 13:37:10 +0000 (14:37 +0100)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 16 Jan 2013 21:45:07 +0000 (16:45 -0500)
commitebc8f5c86a76386df6ca4e335f6f504e218eead4
tree76ab419aaca86ab85177c113fa5be95d8b7df396
parente732ebc42aea321ee84514330eb3a675307fcc83
perf: Fix tear-down of inherited group events

commit 38b435b16c36b0d863efcf3f07b34a6fac9873fd upstream.

When destroying inherited events, we need to destroy groups too,
otherwise the event iteration in perf_event_exit_task_context() will
miss group siblings and we leak events with all the consequences.

Reported-and-tested-by: Vince Weaver <vweaver1@eecs.utk.edu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1300196470.2203.61.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
kernel/perf_event.c