diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-10-15 05:40:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-10-18 13:58:51 -0400 |
commit | 74c3337c2fc6389d3a57a622a936036b6db6b2e8 (patch) | |
tree | d87232b7cc19eef0f1fe0a0bb167868513819b31 /kernel/perf_event.c | |
parent | e360adbe29241a0194e10e20595360dd7b98a2b3 (diff) |
perf: Fix group moving
Matt found we trigger the WARN_ON_ONCE() in perf_group_attach() when we take
the move_group path in perf_event_open().
Since we cannot de-construct the group (we rely on it to move the events), we
have to simply ignore the double attach. The group state is context invariant
and doesn't need changing.
Reported-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1287135757.29097.1368.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 99b9700e74d0..346dc0e35a0a 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -315,7 +315,12 @@ static void perf_group_attach(struct perf_event *event) | |||
315 | { | 315 | { |
316 | struct perf_event *group_leader = event->group_leader; | 316 | struct perf_event *group_leader = event->group_leader; |
317 | 317 | ||
318 | WARN_ON_ONCE(event->attach_state & PERF_ATTACH_GROUP); | 318 | /* |
319 | * We can have double attach due to group movement in perf_event_open. | ||
320 | */ | ||
321 | if (event->attach_state & PERF_ATTACH_GROUP) | ||
322 | return; | ||
323 | |||
319 | event->attach_state |= PERF_ATTACH_GROUP; | 324 | event->attach_state |= PERF_ATTACH_GROUP; |
320 | 325 | ||
321 | if (group_leader == event) | 326 | if (group_leader == event) |