diff options
author | 2021-10-08 11:13:31 +0200 | |
---|---|---|
committer | 2021-10-20 23:44:43 -0400 | |
commit | 0c0593b45c9b4e5b212ffb3fb28bb8d3c0ec0dc8 (patch) | |
tree | 59c3f8fe9cfa47a20889f8264b6f6a12f27ccfeb /include/linux/ftrace.h | |
parent | ftrace/x86_64: Have function graph tracer depend on DYNAMIC_FTRACE (diff) | |
download | linux-0c0593b45c9b4e5b212ffb3fb28bb8d3c0ec0dc8.tar.gz linux-0c0593b45c9b4e5b212ffb3fb28bb8d3c0ec0dc8.tar.bz2 linux-0c0593b45c9b4e5b212ffb3fb28bb8d3c0ec0dc8.zip |
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>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 12fcfa2d23ea..16a7baaba702 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -803,6 +803,15 @@ static inline bool is_ftrace_trampoline(unsigned long addr) } #endif /* CONFIG_DYNAMIC_FTRACE */ +#ifdef CONFIG_FUNCTION_GRAPH_TRACER +#ifndef ftrace_graph_func +#define ftrace_graph_func ftrace_stub +#define FTRACE_OPS_GRAPH_STUB FTRACE_OPS_FL_STUB +#else +#define FTRACE_OPS_GRAPH_STUB 0 +#endif +#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ + /* totally disable ftrace - can not re-enable after this */ void ftrace_kill(void); |