diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2015-01-09 07:06:33 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-01-29 03:19:19 -0500 |
commit | c0a80c0c27e5e65b180a25e6c4c2f7ef9e386cd3 (patch) | |
tree | 4c3a34ab47f07da13df0f351db4cef929f07bcf9 /kernel | |
parent | 4d92f50249eb3ed1c066276e214e8cc7be81e96d (diff) |
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: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/Makefile | 4 | ||||
-rw-r--r-- | kernel/events/Makefile | 2 | ||||
-rw-r--r-- | kernel/locking/Makefile | 8 | ||||
-rw-r--r-- | kernel/sched/Makefile | 2 | ||||
-rw-r--r-- | kernel/trace/Makefile | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index a59481a3fa6c..13af308f2460 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -13,8 +13,8 @@ obj-y = fork.o exec_domain.o panic.o \ | |||
13 | 13 | ||
14 | ifdef CONFIG_FUNCTION_TRACER | 14 | ifdef CONFIG_FUNCTION_TRACER |
15 | # Do not trace debug files and internal ftrace files | 15 | # Do not trace debug files and internal ftrace files |
16 | CFLAGS_REMOVE_cgroup-debug.o = -pg | 16 | CFLAGS_REMOVE_cgroup-debug.o = $(CC_FLAGS_FTRACE) |
17 | CFLAGS_REMOVE_irq_work.o = -pg | 17 | CFLAGS_REMOVE_irq_work.o = $(CC_FLAGS_FTRACE) |
18 | endif | 18 | endif |
19 | 19 | ||
20 | # cond_syscall is currently not LTO compatible | 20 | # cond_syscall is currently not LTO compatible |
diff --git a/kernel/events/Makefile b/kernel/events/Makefile index 103f5d147b2f..2925188f50ea 100644 --- a/kernel/events/Makefile +++ b/kernel/events/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | ifdef CONFIG_FUNCTION_TRACER | 1 | ifdef CONFIG_FUNCTION_TRACER |
2 | CFLAGS_REMOVE_core.o = -pg | 2 | CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE) |
3 | endif | 3 | endif |
4 | 4 | ||
5 | obj-y := core.o ring_buffer.o callchain.o | 5 | obj-y := core.o ring_buffer.o callchain.o |
diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile index 8541bfdfd232..4caca3f7af53 100644 --- a/kernel/locking/Makefile +++ b/kernel/locking/Makefile | |||
@@ -2,10 +2,10 @@ | |||
2 | obj-y += mutex.o semaphore.o rwsem.o mcs_spinlock.o | 2 | obj-y += mutex.o semaphore.o rwsem.o mcs_spinlock.o |
3 | 3 | ||
4 | ifdef CONFIG_FUNCTION_TRACER | 4 | ifdef CONFIG_FUNCTION_TRACER |
5 | CFLAGS_REMOVE_lockdep.o = -pg | 5 | CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE) |
6 | CFLAGS_REMOVE_lockdep_proc.o = -pg | 6 | CFLAGS_REMOVE_lockdep_proc.o = $(CC_FLAGS_FTRACE) |
7 | CFLAGS_REMOVE_mutex-debug.o = -pg | 7 | CFLAGS_REMOVE_mutex-debug.o = $(CC_FLAGS_FTRACE) |
8 | CFLAGS_REMOVE_rtmutex-debug.o = -pg | 8 | CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE) |
9 | endif | 9 | endif |
10 | 10 | ||
11 | obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o | 11 | obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o |
diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index ab32b7b0db5c..46be87024875 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | ifdef CONFIG_FUNCTION_TRACER | 1 | ifdef CONFIG_FUNCTION_TRACER |
2 | CFLAGS_REMOVE_clock.o = -pg | 2 | CFLAGS_REMOVE_clock.o = $(CC_FLAGS_FTRACE) |
3 | endif | 3 | endif |
4 | 4 | ||
5 | ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) | 5 | ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) |
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile index 67d6369ddf83..9a7e0e60a1a8 100644 --- a/kernel/trace/Makefile +++ b/kernel/trace/Makefile | |||
@@ -3,11 +3,11 @@ | |||
3 | 3 | ||
4 | ifdef CONFIG_FUNCTION_TRACER | 4 | ifdef CONFIG_FUNCTION_TRACER |
5 | ORIG_CFLAGS := $(KBUILD_CFLAGS) | 5 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
6 | KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS)) | 6 | KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS)) |
7 | 7 | ||
8 | ifdef CONFIG_FTRACE_SELFTEST | 8 | ifdef CONFIG_FTRACE_SELFTEST |
9 | # selftest needs instrumentation | 9 | # selftest needs instrumentation |
10 | CFLAGS_trace_selftest_dynamic.o = -pg | 10 | CFLAGS_trace_selftest_dynamic.o = $(CC_FLAGS_FTRACE) |
11 | obj-y += trace_selftest_dynamic.o | 11 | obj-y += trace_selftest_dynamic.o |
12 | endif | 12 | endif |
13 | endif | 13 | endif |