diff options
author | Wu Zhangjin <wuzhangjin@gmail.com> | 2009-11-20 07:34:29 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-12-16 20:57:21 -0500 |
commit | d2bb0762993e11363d8343127516b8fe88f9006f (patch) | |
tree | f210c4c4b0234a776977e6d2b749384e1d3699c1 /arch/mips/kernel/Makefile | |
parent | 8922f79ee56e9dab6fc144defc0bc901ff0a7f8a (diff) |
MIPS: Tracing: Add static function tracer support for MIPS
If -pg of gcc is enabled with CONFIG_FUNCTION_TRACER=y. a calling to
_mcount will be inserted into each kernel function. so, there is a
possibility to trace the kernel functions in _mcount.
This patch add the MIPS specific _mcount support for static function
tracing. by default, ftrace_trace_function is initialized as
ftrace_stub(an empty function), so, the default _mcount will introduce
very little overhead. after enabling ftrace in user-space, it will jump
to a real tracing function and do static function tracing for us.
and -ffunction-sections is incompatible with -pg, so, disable it when
ftracer is enabled.
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/672/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/Makefile')
-rw-r--r-- | arch/mips/kernel/Makefile | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index f442de804d8..1340ba3dd38 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile | |||
@@ -10,6 +10,10 @@ obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ | |||
10 | ptrace.o reset.o setup.o signal.o syscall.o \ | 10 | ptrace.o reset.o setup.o signal.o syscall.o \ |
11 | time.o topology.o traps.o unaligned.o watch.o | 11 | time.o topology.o traps.o unaligned.o watch.o |
12 | 12 | ||
13 | ifdef CONFIG_FUNCTION_TRACER | ||
14 | CFLAGS_REMOVE_early_printk.o = -pg | ||
15 | endif | ||
16 | |||
13 | obj-$(CONFIG_CEVT_BCM1480) += cevt-bcm1480.o | 17 | obj-$(CONFIG_CEVT_BCM1480) += cevt-bcm1480.o |
14 | obj-$(CONFIG_CEVT_R4K_LIB) += cevt-r4k.o | 18 | obj-$(CONFIG_CEVT_R4K_LIB) += cevt-r4k.o |
15 | obj-$(CONFIG_MIPS_MT_SMTC) += cevt-smtc.o | 19 | obj-$(CONFIG_MIPS_MT_SMTC) += cevt-smtc.o |
@@ -27,6 +31,8 @@ obj-$(CONFIG_SYNC_R4K) += sync-r4k.o | |||
27 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 31 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
28 | obj-$(CONFIG_MODULES) += mips_ksyms.o module.o | 32 | obj-$(CONFIG_MODULES) += mips_ksyms.o module.o |
29 | 33 | ||
34 | obj-$(CONFIG_FUNCTION_TRACER) += mcount.o | ||
35 | |||
30 | obj-$(CONFIG_CPU_LOONGSON2) += r4k_fpu.o r4k_switch.o | 36 | obj-$(CONFIG_CPU_LOONGSON2) += r4k_fpu.o r4k_switch.o |
31 | obj-$(CONFIG_CPU_MIPS32) += r4k_fpu.o r4k_switch.o | 37 | obj-$(CONFIG_CPU_MIPS32) += r4k_fpu.o r4k_switch.o |
32 | obj-$(CONFIG_CPU_MIPS64) += r4k_fpu.o r4k_switch.o | 38 | obj-$(CONFIG_CPU_MIPS64) += r4k_fpu.o r4k_switch.o |