From: Joel Fernandes Date: Wed, 21 Dec 2016 22:44:46 +0000 (-0800) Subject: arm64: Don't trace __switch_to if function graph tracer is enabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8f4b326d663b92e1c2a53a6857bef42e91aea5a6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git arm64: Don't trace __switch_to if function graph tracer is enabled Function graph tracer shows negative time (wrap around) when tracing __switch_to if the nosleep-time trace option is enabled. Time compensation for nosleep-time is done by an ftrace probe on sched_switch. This doesn't work well for the following events (with letters representing timestamps): A - sched switch probe called for task T switch out B - __switch_to calltime is recorded C - sched_switch probe called for task T switch in D - __switch_to rettime is recorded If C - A > D - B, then we end up over compensating for the time spent in __switch_to giving rise to negative times in the trace output. On x86, __switch_to is not traced if function graph tracer is enabled. Do the same for arm64 as well. Cc: Todd Kjos Cc: Steven Rostedt Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Joel Fernandes Signed-off-by: Will Deacon --- diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index a3a2816ba73a..0b07d42819da 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -339,7 +339,7 @@ static void entry_task_switch(struct task_struct *next) /* * Thread switching. */ -struct task_struct *__switch_to(struct task_struct *prev, +__notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next) { struct task_struct *last;