@@ -236,6 +236,8 @@ config PPC
236236 select HAVE_DEBUG_STACKOVERFLOW
237237 select HAVE_DYNAMIC_FTRACE
238238 select HAVE_DYNAMIC_FTRACE_WITH_ARGS if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
239+ select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS if PPC_FTRACE_OUT_OF_LINE || (PPC32 && ARCH_USING_PATCHABLE_FUNCTION_ENTRY)
240+ select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS if HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
239241 select HAVE_DYNAMIC_FTRACE_WITH_REGS if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
240242 select HAVE_EBPF_JIT
241243 select HAVE_EFFICIENT_UNALIGNED_ACCESS
@@ -245,7 +247,7 @@ config PPC
245247 select HAVE_FUNCTION_DESCRIPTORS if PPC64_ELF_ABI_V1
246248 select HAVE_FUNCTION_ERROR_INJECTION
247249 select HAVE_FUNCTION_GRAPH_TRACER
248- select HAVE_FUNCTION_TRACER if PPC64 || (PPC32 && CC_IS_GCC)
250+ select HAVE_FUNCTION_TRACER if !COMPILE_TEST && ( PPC64 || (PPC32 && CC_IS_GCC) )
249251 select HAVE_GCC_PLUGINS if GCC_VERSION >= 50200 # plugin support on gcc <= 5.1 is buggy on PPC
250252 select HAVE_GENERIC_VDSO
251253 select HAVE_HARDLOCKUP_DETECTOR_ARCH if PPC_BOOK3S_64 && SMP
@@ -276,6 +278,8 @@ config PPC
276278 select HAVE_REGS_AND_STACK_ACCESS_API
277279 select HAVE_RELIABLE_STACKTRACE
278280 select HAVE_RSEQ
281+ select HAVE_SAMPLE_FTRACE_DIRECT if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
282+ select HAVE_SAMPLE_FTRACE_DIRECT_MULTI if HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
279283 select HAVE_SETUP_PER_CPU_AREA if PPC64
280284 select HAVE_SOFTIRQ_ON_OWN_STACK
281285 select HAVE_STACKPROTECTOR if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2)
@@ -572,6 +576,22 @@ config ARCH_USING_PATCHABLE_FUNCTION_ENTRY
572576 def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mlittle-endian) if PPC64 && CPU_LITTLE_ENDIAN
573577 def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mbig-endian) if PPC64 && CPU_BIG_ENDIAN
574578
579+ config PPC_FTRACE_OUT_OF_LINE
580+ def_bool PPC64 && ARCH_USING_PATCHABLE_FUNCTION_ENTRY
581+ select ARCH_WANTS_PRE_LINK_VMLINUX
582+
583+ config PPC_FTRACE_OUT_OF_LINE_NUM_RESERVE
584+ int "Number of ftrace out-of-line stubs to reserve within .text"
585+ depends on PPC_FTRACE_OUT_OF_LINE
586+ default 32768
587+ help
588+ Number of stubs to reserve for use by ftrace. This space is
589+ reserved within .text, and is distinct from any additional space
590+ added at the end of .text before the final vmlinux link. Set to
591+ zero to have stubs only be generated at the end of vmlinux (only
592+ if the size of vmlinux is less than 32MB). Set to a higher value
593+ if building vmlinux larger than 48MB.
594+
575595config HOTPLUG_CPU
576596 bool "Support for enabling/disabling CPUs"
577597 depends on SMP && (PPC_PSERIES || \
0 commit comments