sched: Introduce the 'trace_sched_waking' tracepoint
authorPeter Zijlstra <peterz@infradead.org>
Tue, 9 Jun 2015 09:13:36 +0000 (11:13 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 3 Aug 2015 10:21:22 +0000 (12:21 +0200)
commitfbd705a0c6184580d0e2fbcbd47a37b6e5822511
treec6e2e4369726d453bf695784c2d41528be909a50
parent9d7fb04276481c59610983362d8e023d262b58ca
sched: Introduce the 'trace_sched_waking' tracepoint

Mathieu reported that since 317f394160e9 ("sched: Move the second half
of ttwu() to the remote cpu") trace_sched_wakeup() can happen out of
context of the waker.

This is a problem when you want to analyse wakeup paths because it is
now very hard to correlate the wakeup event to whoever issued the
wakeup.

OTOH trace_sched_wakeup() is issued at the point where we set
p->state = TASK_RUNNING, which is right were we hand the task off to
the scheduler, so this is an important point when looking at
scheduling behaviour, up to here its been the wakeup path everything
hereafter is due to scheduler policy.

To bridge this gap, introduce a second tracepoint: trace_sched_waking.
It is guaranteed to be called in the waker context.

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Francis Giraldeau <francis.giraldeau@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20150609091336.GQ3644@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/trace/events/sched.h
kernel/sched/core.c
kernel/trace/trace_sched_switch.c
kernel/trace/trace_sched_wakeup.c