perf: Simplify __perf_event_read
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 20 Nov 2009 21:19:53 +0000 (22:19 +0100)
committerIngo Molnar <mingo@elte.hu>
Sat, 21 Nov 2009 13:11:39 +0000 (14:11 +0100)
cpuctx is always active, task context is always active for
current

the previous condition verifies that if its a task context its
for current, hence we can assume ctx->is_active.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20091120212509.000272254@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_event.c

index af150bbcfc5b63ded3322cb22a949a74a1bcd7d7..028619dd6d0ea4615f0363bda96986302cd1e5af 100644 (file)
@@ -1526,10 +1526,9 @@ static void __perf_event_read(void *info)
        if (ctx->task && cpuctx->task_ctx != ctx)
                return;
 
-       if (ctx->is_active)
-               update_context_time(ctx);
-       event->pmu->read(event);
+       update_context_time(ctx);
        update_event_times(event);
+       event->pmu->read(event);
 }
 
 static u64 perf_event_read(struct perf_event *event)