x86/ftrace: Make function graph use ftrace directly
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 8 Oct 2021 09:13:31 +0000 (11:13 +0200)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 21 Oct 2021 03:44:43 +0000 (23:44 -0400)
commit0c0593b45c9b4e5b212ffb3fb28bb8d3c0ec0dc8
tree59c3f8fe9cfa47a20889f8264b6f6a12f27ccfeb
parent4a30e4c9305142ba40ab09a02a2e8ff3c1f3751f
x86/ftrace: Make function graph use ftrace directly

We don't need special hook for graph tracer entry point,
but instead we can use graph_ops::func function to install
the return_hooker.

This moves the graph tracing setup _before_ the direct
trampoline prepares the stack, so the return_hooker will
be called when the direct trampoline is finished.

This simplifies the code, because we don't need to take into
account the direct trampoline setup when preparing the graph
tracer hooker and we can allow function graph tracer on entries
registered with direct trampoline.

Link: https://lkml.kernel.org/r/20211008091336.33616-4-jolsa@kernel.org
[fixed compile error reported by kernel test robot <lkp@intel.com>]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/x86/include/asm/ftrace.h
arch/x86/kernel/ftrace.c
arch/x86/kernel/ftrace_64.S
include/linux/ftrace.h
kernel/trace/fgraph.c