From 74a69e4f0bee220103bba81891c168579494b14b Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Sun, 9 Aug 2015 13:18:50 +0200 Subject: Hookup sched_trace_XXX() tracing in Linux scheduler This patch adds context switch tracing to the main Linux scheduler. --- kernel/sched/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 377273d6cecc..cbf2995d3871 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -88,6 +88,7 @@ #include "../smpboot.h" #include +#include #define CREATE_TRACE_POINTS #include @@ -2293,6 +2294,9 @@ asmlinkage __visible void schedule_tail(struct task_struct *prev) /* finish_task_switch() drops rq->lock and enables preemtion */ preempt_disable(); rq = finish_task_switch(prev); + + sched_trace_task_switch_to(current); + post_schedule(rq); if (sched_state_validate_switch()) @@ -2756,6 +2760,7 @@ static void __sched __schedule(void) prev = rq->curr; TS_SCHED_START; + sched_trace_task_switch_away(prev); schedule_debug(prev); @@ -2821,6 +2826,7 @@ static void __sched __schedule(void) } TS_SCHED2_START(prev); + sched_trace_task_switch_to(current); post_schedule(rq); -- cgit v1.2.2