Skip to content

Commit

Permalink
perf: Fix enable_on_exec for sibling events
Browse files Browse the repository at this point in the history
Deng-Cheng Zhu reported that sibling events that were created disabled
with enable_on_exec would never get enabled. Iterate all events
instead of the group lists.

Reported-by: Deng-Cheng Zhu <dczhu@mips.com>
Tested-by: Deng-Cheng Zhu <dczhu@mips.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1322048382.14799.41.camel@twins
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 6, 2011
1 parent 1d9b482 commit b79387e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2497,13 +2497,7 @@ static void perf_event_enable_on_exec(struct perf_event_context *ctx)
raw_spin_lock(&ctx->lock);
task_ctx_sched_out(ctx);

list_for_each_entry(event, &ctx->pinned_groups, group_entry) {
ret = event_enable_on_exec(event, ctx);
if (ret)
enabled = 1;
}

list_for_each_entry(event, &ctx->flexible_groups, group_entry) {
list_for_each_entry(event, &ctx->event_list, event_entry) {
ret = event_enable_on_exec(event, ctx);
if (ret)
enabled = 1;
Expand Down

0 comments on commit b79387e

Please sign in to comment.