]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ARM: 6314/1: ftrace: allow build without frame pointers on ARM
authorRabin Vincent <rabin@rab.in>
Tue, 10 Aug 2010 18:32:37 +0000 (19:32 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 2 Sep 2010 14:24:53 +0000 (15:24 +0100)
With a new enough GCC, ARM function tracing can be supported without the
need for frame pointers.  This is essential for Thumb-2 support, since
frame pointers aren't available then.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig.debug
arch/arm/kernel/armksyms.c
arch/arm/kernel/entry-common.S
kernel/trace/Kconfig

index 91344af75f39694f89d1b4e16529184816f42965..4dbce538fec403138730ba79bce75cc886eb6d89 100644 (file)
@@ -27,6 +27,11 @@ config ARM_UNWIND
          the performance is not affected. Currently, this feature
          only works with EABI compilers. If unsure say Y.
 
+config OLD_MCOUNT
+       bool
+       depends on FUNCTION_TRACER && FRAME_POINTER
+       default y
+
 config DEBUG_USER
        bool "Verbose user fault messages"
        help
index 8214bfebfaca6625226f8b2dd041d978e5ddc25e..e5e1e5387678f7ff5d9df7811b4f902c2b385f41 100644 (file)
@@ -165,6 +165,8 @@ EXPORT_SYMBOL(_find_next_bit_be);
 #endif
 
 #ifdef CONFIG_FUNCTION_TRACER
+#ifdef CONFIG_OLD_MCOUNT
 EXPORT_SYMBOL(mcount);
+#endif
 EXPORT_SYMBOL(__gnu_mcount_nc);
 #endif
index f05a35a59694dc7af54a76ffb899e02f8b849875..6805a7216bf881bfe6a380984caeb3443f289703 100644 (file)
@@ -128,6 +128,13 @@ ENDPROC(ret_from_fork)
  * allows it to be clobbered in subroutines and doesn't use it to hold
  * parameters.)
  */
+
+#ifndef CONFIG_OLD_MCOUNT
+#if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
+#error Ftrace requires CONFIG_FRAME_POINTER=y with GCC older than 4.4.0.
+#endif
+#endif
+
 #ifdef CONFIG_DYNAMIC_FTRACE
 ENTRY(mcount)
        stmdb   sp!, {r0-r3, lr}
@@ -173,6 +180,12 @@ gnu_trace:
        ldmia   sp!, {r0-r3, ip, lr}
        mov     pc, ip
 
+#ifdef CONFIG_OLD_MCOUNT
+/*
+ * This is under an ifdef in order to force link-time errors for people trying
+ * to build with !FRAME_POINTER with a GCC which doesn't use the new-style
+ * mcount.
+ */
 ENTRY(mcount)
        stmdb   sp!, {r0-r3, lr}
        ldr     r0, =ftrace_trace_function
@@ -191,6 +204,7 @@ trace:
        mov     pc, r2
        ldr     lr, [fp, #-4]                   @ restore lr
        ldmia   sp!, {r0-r3, pc}
+#endif
 
 #endif /* CONFIG_DYNAMIC_FTRACE */
 
index 538501c6ea5058cf703eaa2608307f03f3aee89a..6329d063b5e4eb0ea9adc9b2d6909f1b42557f1f 100644 (file)
@@ -121,7 +121,7 @@ if FTRACE
 config FUNCTION_TRACER
        bool "Kernel Function Tracer"
        depends on HAVE_FUNCTION_TRACER
-       select FRAME_POINTER
+       select FRAME_POINTER if (!ARM_UNWIND)
        select KALLSYMS
        select GENERIC_TRACER
        select CONTEXT_SWITCH_TRACER