Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0a80c0c authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

ftrace: allow architectures to specify ftrace compile options



If the kernel is compiled with function tracer support the -pg compile option
is passed to gcc to generate extra code into the prologue of each function.

This patch replaces the "open-coded" -pg compile flag with a CC_FLAGS_FTRACE
makefile variable which architectures can override if a different option
should be used for code generation.

Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 4d92f502
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -724,10 +724,14 @@ KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
endif

ifdef CONFIG_FUNCTION_TRACER
ifndef CC_FLAGS_FTRACE
CC_FLAGS_FTRACE := -pg
endif
export CC_FLAGS_FTRACE
ifdef CONFIG_HAVE_FENTRY
CC_USING_FENTRY	:= $(call cc-option, -mfentry -DCC_USING_FENTRY)
endif
KBUILD_CFLAGS	+= -pg $(CC_USING_FENTRY)
KBUILD_CFLAGS	+= $(CC_FLAGS_FTRACE) $(CC_USING_FENTRY)
KBUILD_AFLAGS	+= $(CC_USING_FENTRY)
ifdef CONFIG_DYNAMIC_FTRACE
	ifdef CONFIG_HAVE_C_RECORDMCOUNT
+2 −2
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ obj-y = fork.o exec_domain.o panic.o \

ifdef CONFIG_FUNCTION_TRACER
# Do not trace debug files and internal ftrace files
CFLAGS_REMOVE_cgroup-debug.o = -pg
CFLAGS_REMOVE_irq_work.o = -pg
CFLAGS_REMOVE_cgroup-debug.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_irq_work.o = $(CC_FLAGS_FTRACE)
endif

# cond_syscall is currently not LTO compatible
+1 −1
Original line number Diff line number Diff line
ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_core.o = -pg
CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE)
endif

obj-y := core.o ring_buffer.o callchain.o
+4 −4
Original line number Diff line number Diff line
@@ -2,10 +2,10 @@
obj-y += mutex.o semaphore.o rwsem.o mcs_spinlock.o

ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_lockdep.o = -pg
CFLAGS_REMOVE_lockdep_proc.o = -pg
CFLAGS_REMOVE_mutex-debug.o = -pg
CFLAGS_REMOVE_rtmutex-debug.o = -pg
CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_lockdep_proc.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_mutex-debug.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE)
endif

obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o
+1 −1
Original line number Diff line number Diff line
ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_clock.o = -pg
CFLAGS_REMOVE_clock.o = $(CC_FLAGS_FTRACE)
endif

ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
Loading