[PATCH bpf-next 1/4] ftrace: Allow users to disable ftrace direct call

Xu Kuohai xukuohai at huaweicloud.com
Mon Sep 12 23:31:43 PDT 2022


From: Xu Kuohai <xukuohai at huawei.com>

To support ftrace direct call on arm64, multiple NOP instructions need
to be added to the ftrace fentry, which will make the kernel image
larger. For users who don't need direct calls, they should not pay this
unnecessary price, so they should be allowed to disable this option.

Signed-off-by: Xu Kuohai <xukuohai at huawei.com>
---
 kernel/trace/Kconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 1052126bdca2..fc8a22f1a6a0 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -240,9 +240,14 @@ config DYNAMIC_FTRACE_WITH_REGS
 	depends on HAVE_DYNAMIC_FTRACE_WITH_REGS
 
 config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
-	def_bool y
+	bool "Support for calling custom trampoline from fentry directly"
+	default y
 	depends on DYNAMIC_FTRACE_WITH_REGS
 	depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
+	help
+	  This option enables calling custom trampoline from ftrace fentry
+	  directly, instead of using ftrace regs caller. This may reserve more
+	  space in the fentry, making the kernel image larger.
 
 config DYNAMIC_FTRACE_WITH_ARGS
 	def_bool y
-- 
2.30.2




More information about the linux-arm-kernel mailing list