]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace, orc, x86: Handle ftrace dynamically allocated trampolines
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 23 Jan 2018 03:32:51 +0000 (22:32 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 23 Jan 2018 20:56:55 +0000 (15:56 -0500)
commitc8b6874aba3bee36ddb869b38dd9ed8f4b95e0ce
tree4ce16d7acac4f57ab60005997ca097faaf216e87
parent40db8a815b350fb9738b67ec0628b0c91c77a21d
ftrace, orc, x86: Handle ftrace dynamically allocated trampolines

The function tracer can create a dynamically allocated trampoline that is
called by the function mcount or fentry hook that is used to call the
function callback that is registered. The problem is that the orc undwinder
will bail if it encounters one of these trampolines. This breaks the stack
trace of function callbacks, which include the stack tracer and setting the
stack trace for individual functions.

Since these dynamic trampolines are basically copies of the static ftrace
trampolines defined in ftrace_*.S, we do not need to create new orc entries
for the dynamic trampolines. Finding the return address on the stack will be
identical as the functions that were copied to create the dynamic
trampolines. When encountering a ftrace dynamic trampoline, we can just use
the orc entry of the ftrace static function that was copied for that
trampoline.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/x86/kernel/unwind_orc.c
include/linux/ftrace.h
kernel/trace/ftrace.c