If unsure, say "N".
 
-config DISABLE_MPROFILE_KERNEL
-       bool "Disable use of mprofile-kernel for kernel tracing"
-       depends on PPC64 && CPU_LITTLE_ENDIAN
-       default y
-       help
-         Selecting this options disables use of the mprofile-kernel ABI for
-         kernel tracing. That will cause options such as live patching
-         (CONFIG_LIVEPATCH) which depend on CONFIG_DYNAMIC_FTRACE_WITH_REGS to
-         be disabled also.
-
-         If you have a toolchain which supports mprofile-kernel, then you can
-         disable this. Otherwise leave it enabled. If you're not sure, say
-         "Y".
-
 config MPROFILE_KERNEL
        depends on PPC64 && CPU_LITTLE_ENDIAN
-       def_bool !DISABLE_MPROFILE_KERNEL
+       def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__)
 
 config HOTPLUG_CPU
        bool "Support for enabling/disabling CPUs"
 
 endif
 
 ifdef CONFIG_MPROFILE_KERNEL
-    ifeq ($(shell $(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__),OK)
-        CC_FLAGS_FTRACE := -pg -mprofile-kernel
-        KBUILD_CPPFLAGS += -DCC_USING_MPROFILE_KERNEL
-    else
-        # If the user asked for mprofile-kernel but the toolchain doesn't
-        # support it, emit a warning and deliberately break the build later
-        # with mprofile-kernel-not-supported. We would prefer to make this an
-        # error right here, but then the user would never be able to run
-        # oldconfig to change their configuration.
-        $(warning Compiler does not support mprofile-kernel, set CONFIG_DISABLE_MPROFILE_KERNEL)
-        CC_FLAGS_FTRACE := -mprofile-kernel-not-supported
-    endif
+       CC_FLAGS_FTRACE := -pg -mprofile-kernel
 endif
 
 CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)
 
 #include <asm-generic/module.h>
 
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
 #define MODULE_ARCH_VERMAGIC_FTRACE    "mprofile-kernel "
 #else
 #define MODULE_ARCH_VERMAGIC_FTRACE    ""
 
        return (unsigned long)&stubs[i];
 }
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
 static bool is_mprofile_mcount_callsite(const char *name, u32 *instruction)
 {
        if (strcmp("_mcount", name))
 
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
 
 #define PACATOC offsetof(struct paca_struct, kernel_toc)
 
 
                return -EINVAL;
        }
 
-#ifdef CC_USING_MPROFILE_KERNEL
+#ifdef CONFIG_MPROFILE_KERNEL
        /* When using -mkernel_profile there is no load to jump over */
        pop = PPC_INST_NOP;
 
                pr_err("Expected %08x found %08x\n", PPC_INST_LD_TOC, op);
                return -EINVAL;
        }
-#endif /* CC_USING_MPROFILE_KERNEL */
+#endif /* CONFIG_MPROFILE_KERNEL */
 
        if (patch_instruction((unsigned int *)ip, pop)) {
                pr_err("Patching NOP failed.\n");
  * They should effectively be a NOP, and follow formal constraints,
  * depending on the ABI. Return false if they don't.
  */
-#ifndef CC_USING_MPROFILE_KERNEL
+#ifndef CONFIG_MPROFILE_KERNEL
 static int
 expected_nop_sequence(void *ip, unsigned int op0, unsigned int op1)
 {
 
     2> /dev/null | grep -q "_mcount" && \
     exit 1
 
-echo "OK"
 exit 0