perf: Simplify task_clock_event_read()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Tue, 22 Feb 2011 15:52:24 +0000 (16:52 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 23 Feb 2011 10:35:47 +0000 (11:35 +0100)
There is no point in us having different code paths for nmi and !nmi
here, so remove the !nmi one.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_event.c

index dadeaea..64a018e 100644 (file)
@@ -5810,16 +5810,9 @@ static void task_clock_event_del(struct perf_event *event, int flags)
 
 static void task_clock_event_read(struct perf_event *event)
 {
-       u64 time;
-
-       if (!in_nmi()) {
-               update_context_time(event->ctx);
-               time = event->ctx->time;
-       } else {
-               u64 now = perf_clock();
-               u64 delta = now - event->ctx->timestamp;
-               time = event->ctx->time + delta;
-       }
+       u64 now = perf_clock();
+       u64 delta = now - event->ctx->timestamp;
+       u64 time = event->ctx->time + delta;
 
        task_clock_event_update(event, time);
 }