]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc: Only support DYNAMIC_FTRACE not static
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 27 Mar 2018 04:29:06 +0000 (15:29 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 May 2018 12:32:29 +0000 (22:32 +1000)
We've had dynamic ftrace support for over 9 years since Steve first
wrote it, all the distros use dynamic, and static is basically
untested these days, so drop support for static ftrace.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/Kconfig
arch/powerpc/include/asm/ftrace.h
arch/powerpc/kernel/trace/ftrace.c
arch/powerpc/kernel/trace/ftrace_32.S
arch/powerpc/kernel/trace/ftrace_64.S
arch/powerpc/kernel/trace/ftrace_64_mprofile.S
arch/powerpc/kernel/trace/ftrace_64_pg.S

index c32a181a7cbbfc30ab9c55d925d89a282857bbf3..ebb90f09e74fa5ed016efd453049c5efaad37566 100644 (file)
@@ -162,6 +162,7 @@ config PPC
        select BUILDTIME_EXTABLE_SORT
        select CLONE_BACKWARDS
        select DCACHE_WORD_ACCESS               if PPC64 && CPU_LITTLE_ENDIAN
+       select DYNAMIC_FTRACE                   if FUNCTION_TRACER
        select EDAC_ATOMIC_SCRUB
        select EDAC_SUPPORT
        select GENERIC_ATOMIC64                 if PPC32
index f0806a2fd45186e1ea12d1153161ee877b272b79..fc3a2203c566e78730f43f55fbd1a48e7fd034a7 100644 (file)
@@ -48,7 +48,6 @@
 #else /* !__ASSEMBLY__ */
 extern void _mcount(void);
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
        /* reloction of mcount call site is the same as the address */
@@ -58,13 +57,12 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
 struct dyn_arch_ftrace {
        struct module *mod;
 };
-#endif /*  CONFIG_DYNAMIC_FTRACE */
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
 #define ARCH_SUPPORTS_FTRACE_OPS 1
 #endif
-#endif
+#endif /* CONFIG_FUNCTION_TRACER */
 
 #ifndef __ASSEMBLY__
 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(PPC64_ELF_ABI_v1)
index 79d2924e75d5f305d16651c379478b32f045492f..c076a32093fdd90c03209735113d2948a91903c4 100644 (file)
@@ -662,7 +662,6 @@ int __init ftrace_dyn_arch_init(void)
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 extern void ftrace_graph_call(void);
 extern void ftrace_graph_stub(void);
 
@@ -691,7 +690,6 @@ int ftrace_disable_ftrace_graph_caller(void)
 
        return ftrace_modify_code(ip, old, new);
 }
-#endif /* CONFIG_DYNAMIC_FTRACE */
 
 /*
  * Hook the return address and push it in the stack of return addrs
index afef2c0762822a536d1e8753fb21d15b1eee2c1e..2c29098f630f6014e9dec9adc25792962d16c7c4 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/ftrace.h>
 #include <asm/export.h>
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 _GLOBAL(mcount)
 _GLOBAL(_mcount)
        /*
@@ -47,26 +46,7 @@ _GLOBAL(ftrace_graph_stub)
        MCOUNT_RESTORE_FRAME
        /* old link register ends up in ctr reg */
        bctr
-#else
-_GLOBAL(mcount)
-_GLOBAL(_mcount)
-
-       MCOUNT_SAVE_FRAME
 
-       subi    r3, r3, MCOUNT_INSN_SIZE
-       LOAD_REG_ADDR(r5, ftrace_trace_function)
-       lwz     r5,0(r5)
-
-       mtctr   r5
-       bctrl
-       nop
-
-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
-       b       ftrace_graph_caller
-#endif
-       MCOUNT_RESTORE_FRAME
-       bctr
-#endif
 EXPORT_SYMBOL(_mcount)
 
 _GLOBAL(ftrace_stub)
index e5ccea19821e1eb800822c88e7ae28f848d5fc35..e25f77c10a72c7a2536b86b6867444e32f682078 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/ppc-opcode.h>
 #include <asm/export.h>
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 _GLOBAL(mcount)
 _GLOBAL(_mcount)
 EXPORT_SYMBOL(_mcount)
@@ -23,34 +22,6 @@ EXPORT_SYMBOL(_mcount)
        mtlr    r0
        bctr
 
-#else /* CONFIG_DYNAMIC_FTRACE */
-_GLOBAL_TOC(_mcount)
-EXPORT_SYMBOL(_mcount)
-       /* Taken from output of objdump from lib64/glibc */
-       mflr    r3
-       ld      r11, 0(r1)
-       stdu    r1, -112(r1)
-       std     r3, 128(r1)
-       ld      r4, 16(r11)
-
-       subi    r3, r3, MCOUNT_INSN_SIZE
-       LOAD_REG_ADDR(r5,ftrace_trace_function)
-       ld      r5,0(r5)
-       ld      r5,0(r5)
-       mtctr   r5
-       bctrl
-       nop
-
-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
-       b       ftrace_graph_caller
-#endif
-       ld      r0, 128(r1)
-       mtlr    r0
-       addi    r1, r1, 112
-_GLOBAL(ftrace_stub)
-       blr
-#endif /* CONFIG_DYNAMIC_FTRACE */
-
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 _GLOBAL(return_to_handler)
        /* need to save return values */
index ed9d7a46c3af2c812f5e294b3521f9d3eb2b5424..9a5b5a513604018b3ff878b41c2871e135d1e579 100644 (file)
@@ -17,7 +17,6 @@
 #include <asm/bug.h>
 #include <asm/ptrace.h>
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 /*
  *
  * ftrace_caller()/ftrace_regs_caller() is the function that replaces _mcount()
@@ -311,8 +310,6 @@ livepatch_handler:
        blr
 #endif /* CONFIG_LIVEPATCH */
 
-#endif /* CONFIG_DYNAMIC_FTRACE */
-
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 _GLOBAL(ftrace_graph_caller)
        stdu    r1, -112(r1)
index b7ba51a0f3b60b0ba91682d3a1f990aefbc5eafe..4c515c4023de0b799fa8a82a9537c7634d5f1067 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/ppc-opcode.h>
 #include <asm/export.h>
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 _GLOBAL_TOC(ftrace_caller)
        lbz     r3, PACA_FTRACE_ENABLED(r13)
        cmpdi   r3, 0
@@ -43,7 +42,6 @@ _GLOBAL(ftrace_graph_stub)
 
 _GLOBAL(ftrace_stub)
        blr
-#endif /* CONFIG_DYNAMIC_FTRACE */
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 _GLOBAL(ftrace_graph_caller)