diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/perf_counter.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 7a7a144870ef..14b1fe984832 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -924,14 +924,13 @@ void perf_counter_task_sched_out(struct task_struct *task, | |||
924 | struct perf_counter_context *next_ctx; | 924 | struct perf_counter_context *next_ctx; |
925 | struct pt_regs *regs; | 925 | struct pt_regs *regs; |
926 | 926 | ||
927 | regs = task_pt_regs(task); | ||
928 | perf_swcounter_event(PERF_COUNT_CONTEXT_SWITCHES, 1, 1, regs, 0); | ||
929 | |||
927 | if (likely(!ctx || !cpuctx->task_ctx)) | 930 | if (likely(!ctx || !cpuctx->task_ctx)) |
928 | return; | 931 | return; |
929 | 932 | ||
930 | update_context_time(ctx); | 933 | update_context_time(ctx); |
931 | |||
932 | regs = task_pt_regs(task); | ||
933 | perf_swcounter_event(PERF_COUNT_CONTEXT_SWITCHES, 1, 1, regs, 0); | ||
934 | |||
935 | next_ctx = next->perf_counter_ctxp; | 934 | next_ctx = next->perf_counter_ctxp; |
936 | if (next_ctx && context_equiv(ctx, next_ctx)) { | 935 | if (next_ctx && context_equiv(ctx, next_ctx)) { |
937 | task->perf_counter_ctxp = next_ctx; | 936 | task->perf_counter_ctxp = next_ctx; |