sh: Mark __switch_to() as __notrace_funcgraph
authorMatt Fleming <matt@console-pimps.org>
Sat, 11 Jul 2009 00:29:04 +0000 (00:29 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Sat, 11 Jul 2009 01:08:06 +0000 (10:08 +0900)
commit7816fecd03e480ed0b47d674ed772ca0b45e1b5e
tree33ed6c1780f3ebccd5915f724e7345875bee93b1
parent327933f5d6cdf083284d3c06e0370d1de464aef4
sh: Mark __switch_to() as __notrace_funcgraph

Annotate __switch_to() so that the function graph tracer does not try to
trace it. Use __notrace_funcgraph, as opposed to notrace, so that other
tracers can continue to trace __switch_to().

The reason that we don't want to trace __switch_to() with the function
graph tracer is because of how the return address stack in task_struct
is implemented. When we enter __switch_to we store the real return
address on prev's ret_stack. When we return from __switch_to() we've
patched the return address on the kernel stack to be
return_to_handler. Calling return_to_handler we do,

       -> ftrace_return_to_handler()
          -> ftrace_pop_return_ftrace()

Which tries to pop the real return address from current->ret_stack. The
problem being that we stored the return address on prev->ret_stack, but
current now points to next, and next->ret_stack doesn't contain the
correct return address (and is possibly even empty).

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/process_32.c