summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2019-11-08 19:12:57 +0100
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-11-13 15:36:49 +0100
commita3ad1a7e39689005cb04a4f2adb82f9d55b4724f (patch)
tree64deafb73e244d233836735dd2fa6a3c41462cc6 /arch/x86/kernel
parentftrace/x86: Add register_ftrace_direct() for custom trampolines (diff)
downloadlinux-a3ad1a7e39689005cb04a4f2adb82f9d55b4724f.tar.xz
linux-a3ad1a7e39689005cb04a4f2adb82f9d55b4724f.zip
ftrace/x86: Add a counter to test function_graph with direct
As testing for direct calls from the function graph tracer adds a little overhead (which is a lot when tracing every function), add a counter that can be used to test if function_graph tracer needs to test for a direct caller or not. It would have been nicer if we could use a static branch, but the static branch logic fails when used within the function graph tracer trampoline. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/ftrace.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index fef283f6341d..060a361d9d11 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -1049,9 +1049,11 @@ void prepare_ftrace_return(unsigned long self_addr, unsigned long *parent,
* return address is actually off by one word, and we
* need to adjust for that.
*/
- if (ftrace_find_direct_func(self_addr + MCOUNT_INSN_SIZE)) {
- self_addr = *parent;
- parent++;
+ if (ftrace_direct_func_count) {
+ if (ftrace_find_direct_func(self_addr + MCOUNT_INSN_SIZE)) {
+ self_addr = *parent;
+ parent++;
+ }
}
/*