提交 8f4b326d 编写于 作者: J Joel Fernandes 提交者: Will Deacon

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 <tkjos@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: NJoel Fernandes <joelaf@google.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 a121103c
...@@ -339,7 +339,7 @@ static void entry_task_switch(struct task_struct *next) ...@@ -339,7 +339,7 @@ static void entry_task_switch(struct task_struct *next)
/* /*
* Thread switching. * 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 *next)
{ {
struct task_struct *last; struct task_struct *last;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册