Commit 724b6daa authored by Michael Ellerman's avatar Michael Ellerman Committed by Ingo Molnar

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 75f937f2 ("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: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1334109253-31329-1-git-send-email-michael@ellerman.id.auSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent c716ef56
...@@ -3183,7 +3183,7 @@ static void perf_event_for_each(struct perf_event *event, ...@@ -3183,7 +3183,7 @@ static void perf_event_for_each(struct perf_event *event,
perf_event_for_each_child(event, func); perf_event_for_each_child(event, func);
func(event); func(event);
list_for_each_entry(sibling, &event->sibling_list, group_entry) list_for_each_entry(sibling, &event->sibling_list, group_entry)
perf_event_for_each_child(event, func); perf_event_for_each_child(sibling, func);
mutex_unlock(&ctx->mutex); mutex_unlock(&ctx->mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment