diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2012-04-10 21:54:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-04-26 07:51:31 -0400 |
commit | 724b6daa13e100067c30cfc4d1ad06629609dc4e (patch) | |
tree | 290b86e3c259922c350ea6469f43ddb953a83aa3 /kernel | |
parent | c716ef56f1319e8a515cb1947a3ec59b06e94a5e (diff) |
perf: Fix perf_event_for_each() to use sibling
In perf_event_for_each() we call a function on an event, and then
iterate over the siblings of the event.
However we don't call the function on the siblings, we call it
repeatedly on the original event - it seems "obvious" that we should
be calling it with sibling as the argument.
It looks like this broke in commit 75f937f24bd9 ("Fix ctx->mutex
vs counter->mutex inversion").
The only effect of the bug is that the PERF_IOC_FLAG_GROUP parameter
to the ioctls doesn't work.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1334109253-31329-1-git-send-email-michael@ellerman.id.au
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/events/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index a6a9ec4cd8f5..fd126f82b57c 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -3183,7 +3183,7 @@ static void perf_event_for_each(struct perf_event *event, | |||
3183 | perf_event_for_each_child(event, func); | 3183 | perf_event_for_each_child(event, func); |
3184 | func(event); | 3184 | func(event); |
3185 | list_for_each_entry(sibling, &event->sibling_list, group_entry) | 3185 | list_for_each_entry(sibling, &event->sibling_list, group_entry) |
3186 | perf_event_for_each_child(event, func); | 3186 | perf_event_for_each_child(sibling, func); |
3187 | mutex_unlock(&ctx->mutex); | 3187 | mutex_unlock(&ctx->mutex); |
3188 | } | 3188 | } |
3189 | 3189 | ||