Skip to content

Commit

Permalink
perf: Simplify __perf_event_read
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Nov 21, 2009
1 parent 3dbebf1 commit 58e5ad1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 58e5ad1

Please sign in to comment.