Skip to content

Commit

Permalink
perf: Simplify task_clock_event_read()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Feb 23, 2011
1 parent 3f7cce3 commit 768a06e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 768a06e

Please sign in to comment.