Blackfin: implement ftrace mcount test
authorMike Frysinger <vapier@gentoo.org>
Fri, 22 Jan 2010 12:35:20 +0000 (07:35 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 9 Mar 2010 05:30:50 +0000 (00:30 -0500)
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/Kconfig
arch/blackfin/kernel/ftrace-entry.S

index f46db59eac8a87537eaeef302e85671ef9abd084..3123aa49ff790596faf2f9566dfcbbe052f6bee9 100644 (file)
@@ -25,6 +25,7 @@ config BLACKFIN
        def_bool y
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER
+       select HAVE_FUNCTION_TRACE_MCOUNT_TEST
        select HAVE_IDE
        select HAVE_KERNEL_GZIP if RAMKERNEL
        select HAVE_KERNEL_BZIP2 if RAMKERNEL
index 76dd4fbcd17a2e8f7adc45f76237e0c2a4d19538..db3a51b0af21b98b560d6a5e50b5db97ba45f681 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * mcount and friends -- ftrace stuff
  *
- * Copyright (C) 2009 Analog Devices Inc.
+ * Copyright (C) 2009-2010 Analog Devices Inc.
  * Licensed under the GPL-2 or later.
  */
 
  * function will be waiting there.  mmmm pie.
  */
 ENTRY(__mcount)
+#ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
+       /* optional micro optimization: return if stopped */
+       p1.l = _function_trace_stop;
+       p1.h = _function_trace_stop;
+       r3 = [p1];
+       cc = r3 == 0;
+       if ! cc jump _ftrace_stub (bp);
+#endif
+
        /* save third function arg early so we can do testing below */
        [--sp] = r2;