diff options
author | Rabin Vincent <rabin@rab.in> | 2010-08-10 14:43:28 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-09-02 10:27:40 -0400 |
commit | 3b6c223b1b97ad60bbb0f4efda57d649414ac2a2 (patch) | |
tree | 291dcb285e8cb64415a82ed1c65dc9681921a257 /arch/arm/include/asm/ftrace.h | |
parent | f9810a82536e0c730c57844753e6c08cc7f77881 (diff) |
ARM: 6318/1: ftrace: fix and update dynamic ftrace
This adds mcount recording and updates dynamic ftrace for ARM to work
with the new ftrace dyamic tracing implementation. It also adds support
for the mcount format used by newer ARM compilers.
With dynamic tracing, mcount() is implemented as a nop. Callsites are
patched on startup with nops, and dynamically patched to call to the
ftrace_caller() routine as needed.
Acked-by: Steven Rostedt <rostedt@goodmis.org> [recordmcount.pl change]
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm/ftrace.h')
-rw-r--r-- | arch/arm/include/asm/ftrace.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h index 103f7ee97313..4a56a2ee067c 100644 --- a/arch/arm/include/asm/ftrace.h +++ b/arch/arm/include/asm/ftrace.h | |||
@@ -2,12 +2,29 @@ | |||
2 | #define _ASM_ARM_FTRACE | 2 | #define _ASM_ARM_FTRACE |
3 | 3 | ||
4 | #ifdef CONFIG_FUNCTION_TRACER | 4 | #ifdef CONFIG_FUNCTION_TRACER |
5 | #define MCOUNT_ADDR ((long)(mcount)) | 5 | #define MCOUNT_ADDR ((unsigned long)(__gnu_mcount_nc)) |
6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ | 6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ |
7 | 7 | ||
8 | #ifndef __ASSEMBLY__ | 8 | #ifndef __ASSEMBLY__ |
9 | extern void mcount(void); | 9 | extern void mcount(void); |
10 | extern void __gnu_mcount_nc(void); | 10 | extern void __gnu_mcount_nc(void); |
11 | |||
12 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
13 | struct dyn_arch_ftrace { | ||
14 | #ifdef CONFIG_OLD_MCOUNT | ||
15 | bool old_mcount; | ||
16 | #endif | ||
17 | }; | ||
18 | |||
19 | static inline unsigned long ftrace_call_adjust(unsigned long addr) | ||
20 | { | ||
21 | return addr; | ||
22 | } | ||
23 | |||
24 | extern void ftrace_caller_old(void); | ||
25 | extern void ftrace_call_old(void); | ||
26 | #endif | ||
27 | |||
11 | #endif | 28 | #endif |
12 | 29 | ||
13 | #endif | 30 | #endif |