[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1324337005-31718-2-git-send-email-asharma@fb.com>
Date: Mon, 19 Dec 2011 15:23:24 -0800
From: Arun Sharma <asharma@...com>
To: linux-kernel@...r.kernel.org
Cc: Arun Sharma <asharma@...com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Andrew Vagin <avagin@...nvz.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...e.hu>
Subject: [PATCH 1/2] tracing, sched: move the sched_switch tracepoint
Move the tracepoint from prepare_task_switch() to
finish_task_switch().
Without this, the event gets attributed to prev rather
than next. For sleep profiling purposes, we want to collect
the stacktrace of "next".
This also makes the event usable in per-process mode, without
root privileges.
I can't think of this breaking the semantics of the existing
uses of this tracepoint. If there are any concerns, we should
be able to define a new tracepoint usable for sleep profiling.
Signed-off-by: Arun Sharma <asharma@...com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Arnaldo Carvalho de Melo <acme@...radead.org>
Cc: Andrew Vagin <avagin@...nvz.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: linux-kernel@...r.kernel.org
---
kernel/sched.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index d6b149c..b06b3c6 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3157,7 +3157,6 @@ prepare_task_switch(struct rq *rq, struct task_struct *prev,
fire_sched_out_preempt_notifiers(prev, next);
prepare_lock_switch(rq, next);
prepare_arch_switch(next);
- trace_sched_switch(prev, next);
}
/**
@@ -3205,6 +3204,7 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
#endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */
finish_lock_switch(rq, prev);
+ trace_sched_switch(prev, current, rq->clock);
fire_sched_in_preempt_notifiers(current);
if (mm)
mmdrop(mm);
--
1.7.4
--
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