Browse files

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 75f937f ("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 <>
Signed-off-by: Peter Zijlstra <>
Signed-off-by: Ingo Molnar <>
  • Loading branch information...
1 parent c716ef5 commit 724b6daa13e100067c30cfc4d1ad06629609dc4e @mpe mpe committed with Ingo Molnar Apr 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 kernel/events/core.c
@@ -3183,7 +3183,7 @@ static void perf_event_for_each(struct perf_event *event,
perf_event_for_each_child(event, func);
list_for_each_entry(sibling, &event->sibling_list, group_entry)
- perf_event_for_each_child(event, func);
+ perf_event_for_each_child(sibling, func);

0 comments on commit 724b6da

Please sign in to comment.