sh: Decouple mcount from ftrace.
authorPaul Mundt <lethal@linux-sh.org>
Sat, 11 Jul 2009 10:56:58 +0000 (19:56 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Sat, 11 Jul 2009 10:56:58 +0000 (19:56 +0900)
This adds a general CONFIG_MCOUNT in order to permit mcount generation
without ftrace support. This is primarily for allowing platforms to
enable aggressive stack overflow checking without having to enable ftrace
support. Based on the sparc64 implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/Kconfig.debug
arch/sh/Makefile
arch/sh/boot/compressed/Makefile
arch/sh/kernel/sh_ksyms_32.c
arch/sh/lib/Makefile

index 52a132c24aab1968f38c22bfb73eddee6bc68533..75b5f4e06670c09808510ec61a22c1b391555650 100644 (file)
@@ -134,4 +134,9 @@ config STACK_DEBUG
          call and will therefore incur a major performance hit. Most
          users should say N.
 
+config MCOUNT
+       def_bool y
+       depends on SUPERH32
+       depends on STACK_DEBUG || FUNCTION_TRACER
+
 endmenu
index 75d049b03f7e04231de0525ba6b57e3779fe2984..52c34bf56962cef60e39f78ba715e0eefbf225e0 100644 (file)
@@ -186,6 +186,10 @@ KBUILD_CFLAGS              += -pipe $(cflags-y)
 KBUILD_CPPFLAGS                += $(cflags-y)
 KBUILD_AFLAGS          += $(cflags-y)
 
+ifeq ($(CONFIG_MCOUNT),y)
+  KBUILD_CFLAGS += -pg
+endif
+
 libs-$(CONFIG_SUPERH32)                := arch/sh/lib/ $(libs-y)
 libs-$(CONFIG_SUPERH64)                := arch/sh/lib64/ $(libs-y)
 
index 9531bf1b7c2f878b632f154f5e9a4bd06717758b..3af239cb9b0dd77c40a450032164fa8e281c1488 100644 (file)
@@ -23,7 +23,7 @@ IMAGE_OFFSET  := $(shell /bin/bash -c 'printf "0x%08x" \
 
 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
 
-ifeq ($(CONFIG_FUNCTION_TRACER),y)
+ifeq ($(CONFIG_MCOUNT),y)
 ORIG_CFLAGS := $(KBUILD_CFLAGS)
 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
 endif
index fcc5de31f83b81a6a1305bae666623b0e212e34e..5b81116046c112e73a27709f4da6e81d3f0dfe58 100644 (file)
@@ -106,7 +106,7 @@ EXPORT_SYMBOL(flush_dcache_page);
 EXPORT_SYMBOL(clear_user_page);
 #endif
 
-#ifdef CONFIG_FUNCTION_TRACER
+#ifdef CONFIG_MCOUNT
 EXPORT_SYMBOL(mcount);
 #endif
 EXPORT_SYMBOL(csum_partial);
index 19328d90a2d1088c828b07f84c7f1546f0ca80cb..c2b28d8b2dd1b2faef732da7cae6cac81278ee47 100644 (file)
@@ -24,8 +24,7 @@ memcpy-y                      := memcpy.o
 memcpy-$(CONFIG_CPU_SH4)       := memcpy-sh4.o
 
 lib-$(CONFIG_MMU)              += copy_page.o clear_page.o
-lib-$(CONFIG_FUNCTION_TRACER)  += mcount.o
-lib-$(CONFIG_FUNCTION_GRAPH_TRACER) += mcount.o
+lib-$(CONFIG_MCOUNT)           += mcount.o
 lib-y                          += $(memcpy-y) $(udivsi3-y)
 
 EXTRA_CFLAGS += -Werror
This page took 0.044826 seconds and 5 git commands to generate.