perf: Fix enable_on_exec for sibling events
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Tue, 22 Nov 2011 10:25:43 +0000 (11:25 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 6 Dec 2011 07:34:01 +0000 (08:34 +0100)
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>
kernel/events/core.c

index eeda5403590ca5c4f94da4ab3a66290491efaecd..3c1541d7a53da2cf9b2704b7740c83f6aac10f3d 100644 (file)
@@ -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;