Skip to content

Commit 70927d0

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: ftrace: fix ifdeffery
When I tweaked the ftrace entry assembly in commit: 3b23e49 ("arm64: implement ftrace with regs") ... my ifdeffery tweaks left ftrace_graph_caller undefined for CONFIG_DYNAMIC_FTRACE && CONFIG_FUNCTION_GRAPH_TRACER when ftrace is based on mcount. The kbuild test robot reported that this issue is detected at link time: | arch/arm64/kernel/entry-ftrace.o: In function `skip_ftrace_call': | arch/arm64/kernel/entry-ftrace.S:238: undefined reference to `ftrace_graph_caller' | arch/arm64/kernel/entry-ftrace.S:238:(.text+0x3c): relocation truncated to fit: R_AARCH64_CONDBR19 against undefined symbol | `ftrace_graph_caller' | arch/arm64/kernel/entry-ftrace.S:243: undefined reference to `ftrace_graph_caller' | arch/arm64/kernel/entry-ftrace.S:243:(.text+0x54): relocation truncated to fit: R_AARCH64_CONDBR19 against undefined symbol | `ftrace_graph_caller' This patch fixes the ifdeffery so that the mcount version of ftrace_graph_caller doesn't depend on CONFIG_DYNAMIC_FTRACE. At the same time, a redundant #else is removed from the ifdeffery for the patchable-function-entry version of ftrace_graph_caller. Fixes: 3b23e49 ("arm64: implement ftrace with regs") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Cc: Amit Daniel Kachhap <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Torsten Duwe <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 0492747 commit 70927d0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/arm64/kernel/entry-ftrace.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ ENTRY(ftrace_graph_caller)
133133
bl prepare_ftrace_return
134134
b ftrace_common_return
135135
ENDPROC(ftrace_graph_caller)
136-
#else
137136
#endif
138137

139138
#else /* CONFIG_DYNAMIC_FTRACE_WITH_REGS */
@@ -287,6 +286,7 @@ GLOBAL(ftrace_graph_call) // ftrace_graph_caller();
287286

288287
mcount_exit
289288
ENDPROC(ftrace_caller)
289+
#endif /* CONFIG_DYNAMIC_FTRACE */
290290

291291
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
292292
/*
@@ -307,7 +307,6 @@ ENTRY(ftrace_graph_caller)
307307
mcount_exit
308308
ENDPROC(ftrace_graph_caller)
309309
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
310-
#endif /* CONFIG_DYNAMIC_FTRACE */
311310
#endif /* CONFIG_DYNAMIC_FTRACE_WITH_REGS */
312311

313312
ENTRY(ftrace_stub)

0 commit comments

Comments
 (0)