]> git.baikalelectronics.ru Git - kernel.git/commit
x86/ftrace: Do not call function graph from dynamic trampolines
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 8 Dec 2018 17:58:51 +0000 (12:58 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 20 Dec 2018 03:43:37 +0000 (22:43 -0500)
commit2475cca3a9afab4a4564aaa66eebbe7ad8357a8a
tree106572c3531013ace0f8bb9c4d0a9b4440eebb8b
parent30677e7c57ef08e1bdcc89efe1733b588adb099e
x86/ftrace: Do not call function graph from dynamic trampolines

Since commit eb1f7da1226ce ("ftrace: Optimize function graph to be
called directly"), dynamic trampolines should not be calling the
function graph tracer at the end. If they do, it could cause the function
graph tracer to trace functions that it filtered out.

Right now it does not cause a problem because there's a test to check if
the function graph tracer is attached to the same function as the
function tracer, which for now is true. But the function graph tracer is
undergoing changes that can make this no longer true which will cause
the function graph tracer to trace other functions.

 For example:

 # cd /sys/kernel/tracing/
 # echo do_IRQ > set_ftrace_filter
 # mkdir instances/foo
 # echo ip_rcv > instances/foo/set_ftrace_filter
 # echo function_graph > current_tracer
 # echo function > instances/foo/current_tracer

Would cause the function graph tracer to trace both do_IRQ and ip_rcv,
if the current tests change.

As the current tests prevent this from being a problem, this code does
not need to be backported. But it does make the code cleaner.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/x86/kernel/ftrace.c
arch/x86/kernel/ftrace_64.S