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/include/asm/ftrace.h | |
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/include/asm/ftrace.h')
-rw-r--r-- | arch/mips/include/asm/ftrace.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftrace.h index 40a8c178f10..5f8ebcf9fa6 100644 --- a/arch/mips/include/asm/ftrace.h +++ b/arch/mips/include/asm/ftrace.h | |||
@@ -1 +1,24 @@ | |||
1 | /* empty */ | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive for | ||
4 | * more details. | ||
5 | * | ||
6 | * Copyright (C) 2009 DSLab, Lanzhou University, China | ||
7 | * Author: Wu Zhangjin <wuzj@lemote.com> | ||
8 | */ | ||
9 | |||
10 | #ifndef _ASM_MIPS_FTRACE_H | ||
11 | #define _ASM_MIPS_FTRACE_H | ||
12 | |||
13 | #ifdef CONFIG_FUNCTION_TRACER | ||
14 | |||
15 | #define MCOUNT_ADDR ((unsigned long)(_mcount)) | ||
16 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ | ||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | extern void _mcount(void); | ||
20 | #define mcount _mcount | ||
21 | |||
22 | #endif /* __ASSEMBLY__ */ | ||
23 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
24 | #endif /* _ASM_MIPS_FTRACE_H */ | ||