perf: Validate locking assumption
authorPeter Zijlstra <[email protected]>
Mon, 5 May 2014 09:49:16 +0000 (11:49 +0200)
committerIngo Molnar <[email protected]>
Wed, 7 May 2014 11:44:18 +0000 (13:44 +0200)
Document and validate the locking assumption of event_sched_in().

Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Vince Weaver <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/events/core.c

index 819ffc006d673c60528ccf582733a49500b4a373..0de199729f04f88fbac802319e6d774055b9d80b 100644 (file)
@@ -1678,6 +1678,8 @@ event_sched_in(struct perf_event *event,
        u64 tstamp = perf_event_time(event);
        int ret = 0;
 
+       lockdep_assert_held(&ctx->lock);
+
        if (event->state <= PERF_EVENT_STATE_OFF)
                return 0;