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
 
 #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 */
 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)
 
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 extern void ftrace_graph_call(void);
 extern void ftrace_graph_stub(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
 
 #include <asm/ftrace.h>
 #include <asm/export.h>
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 _GLOBAL(mcount)
 _GLOBAL(_mcount)
        /*
        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)
 
 #include <asm/ppc-opcode.h>
 #include <asm/export.h>
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 _GLOBAL(mcount)
 _GLOBAL(_mcount)
 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 */
 
 #include <asm/bug.h>
 #include <asm/ptrace.h>
 
-#ifdef CONFIG_DYNAMIC_FTRACE
 /*
  *
  * ftrace_caller()/ftrace_regs_caller() is the function that replaces _mcount()
        blr
 #endif /* CONFIG_LIVEPATCH */
 
-#endif /* CONFIG_DYNAMIC_FTRACE */
-
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 _GLOBAL(ftrace_graph_caller)
        stdu    r1, -112(r1)
 
 #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
 
 _GLOBAL(ftrace_stub)
        blr
-#endif /* CONFIG_DYNAMIC_FTRACE */
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 _GLOBAL(ftrace_graph_caller)