Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc: Merge ftrace C-helper and assembler functions into .text.hot section

When enabling all-branch ftrace support (CONFIG_PROFILE_ALL_BRANCHES)
the kernel gets really huge and some ftrace assembler functions like
mcount can't reach the ftrace helper functions which are written in C.
Avoid this problem of too distant branches by moving the ftrace C-helper
functions into the .text.hot section which is put in front of the
standard .text section by the linker.

Signed-off-by: Helge Deller <deller@gmx.de>

+6 -3
+1 -1
arch/parisc/kernel/entry.S
··· 667 667 * boundary 668 668 */ 669 669 670 - .text 670 + .section .text.hot 671 671 .align 2048 672 672 673 673 ENTRY(fault_vector_20)
+5 -2
arch/parisc/kernel/ftrace.c
··· 18 18 #include <asm/ftrace.h> 19 19 20 20 21 + #define __hot __attribute__ ((__section__ (".text.hot"))) 22 + 21 23 #ifdef CONFIG_FUNCTION_GRAPH_TRACER 22 24 /* 23 25 * Hook the return address and push it in the stack of return addrs 24 26 * in current thread info. 25 27 */ 26 - static void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) 28 + static void __hot prepare_ftrace_return(unsigned long *parent, 29 + unsigned long self_addr) 27 30 { 28 31 unsigned long old; 29 32 struct ftrace_graph_ent trace; ··· 56 53 } 57 54 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 58 55 59 - void notrace ftrace_function_trampoline(unsigned long parent, 56 + void notrace __hot ftrace_function_trampoline(unsigned long parent, 60 57 unsigned long self_addr, 61 58 unsigned long org_sp_gr3) 62 59 {