Skip to content

Commit

Permalink
sh: Decouple mcount from ftrace.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mundt committed Jul 11, 2009
1 parent f686d8c commit 473d1cf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions arch/sh/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions arch/sh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/sh_ksyms_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions arch/sh/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 473d1cf

Please sign in to comment.