[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-10989fb2451763fae6f42d85fa6106c8fd010cf5@git.kernel.org>
Date: Mon, 25 May 2009 13:04:18 GMT
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, acme@...hat.com, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, jkacur@...hat.com,
a.p.zijlstra@...llo.nl, tglx@...utronix.de,
cjashfor@...ux.vnet.ibm.com, mingo@...e.hu
Subject: [tip:perfcounters/core] perf_counter: Fix PERF_COUNTER_CONTEXT_SWITCHES for cpu counters
Commit-ID: 10989fb2451763fae6f42d85fa6106c8fd010cf5
Gitweb: http://git.kernel.org/tip/10989fb2451763fae6f42d85fa6106c8fd010cf5
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Mon, 25 May 2009 14:45:28 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Mon, 25 May 2009 14:55:01 +0200
perf_counter: Fix PERF_COUNTER_CONTEXT_SWITCHES for cpu counters
Ingo noticed that cpu counters had 0 context switches, even though
there was plenty scheduling on the cpu.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: John Kacur <jkacur@...hat.com>
LKML-Reference: <20090525124600.419025548@...llo.nl>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
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 7a7a144..14b1fe9 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,
struct perf_counter_context *next_ctx;
struct pt_regs *regs;
+ regs = task_pt_regs(task);
+ perf_swcounter_event(PERF_COUNT_CONTEXT_SWITCHES, 1, 1, regs, 0);
+
if (likely(!ctx || !cpuctx->task_ctx))
return;
update_context_time(ctx);
-
- regs = task_pt_regs(task);
- perf_swcounter_event(PERF_COUNT_CONTEXT_SWITCHES, 1, 1, regs, 0);
-
next_ctx = next->perf_counter_ctxp;
if (next_ctx && context_equiv(ctx, next_ctx)) {
task->perf_counter_ctxp = next_ctx;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists