Re: [PATCH] powerpc/ftrace: Remove ftrace init tramp once kernel init is complete

From
Michael Ellerman <mpe@ellerman.id.au>
Date
2022-05-05 14:00:16
Reply to
Naveen N. Rao, 2022-03-23
"Naveen N. Rao" [off-list ref] writes:
Stop using the ftrace trampoline for init section once kernel init is
complete.

Fixes: 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs")
Cc: <redacted> # v4.20+
Signed-off-by: Naveen N. Rao <redacted>
---
 arch/powerpc/include/asm/ftrace.h  |  2 ++
 arch/powerpc/kernel/trace/ftrace.c | 15 ++++++++++++---
 arch/powerpc/mm/mem.c              |  2 ++
 3 files changed, 16 insertions(+), 3 deletions(-)
This breaks the corenet64_smp_defconfig build:

  ld: arch/powerpc/mm/mem.o: in function `.free_initmem':
  (.text+0x130): undefined reference to `.ftrace_free_init_tramp'
  make[1]: *** [/home/michael/linux/Makefile:1158: vmlinux] Error 1
  make: *** [Makefile:219: __sub-make] Error 2

quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
index d83758acd1c7c3..d329f4ad18944d 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -110,11 +110,13 @@ static inline u8 this_cpu_get_ftrace_enabled(void)
 	return get_paca()->ftrace_enabled;
 }
 
+void ftrace_free_init_tramp(void);
 #else /* CONFIG_PPC64 */
 static inline void this_cpu_disable_ftrace(void) { }
 static inline void this_cpu_enable_ftrace(void) { }
 static inline void this_cpu_set_ftrace_enabled(u8 ftrace_enabled) { }
 static inline u8 this_cpu_get_ftrace_enabled(void) { return 1; }
+static inline void ftrace_free_init_tramp(void) { }
 #endif /* CONFIG_PPC64 */
I think because we need that stub to be defined.

But this config does have PPC64=y but *doesn't* have DYNAMIC_FTRACE or
FTRACE_SYSCALLS or FUNCTION_GRAPH_TRACER enabled.

cheers
Thread (2 messages) 2 messages, 2 authors, last reply 2022-05-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help