diff options
author | Abhishek Sagar <sagar.abhishek@gmail.com> | 2008-05-31 04:53:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-02 05:32:20 -0400 |
commit | 014c257cce65e9d1cd2d28ec1c89a37c536b151d (patch) | |
tree | c7a28fbf6f295538964539d5b8c552ea786f7072 /arch/arm/kernel/entry-common.S | |
parent | b1829d2705daa7cb72eb1e08bdc8b7e9fad34266 (diff) |
ftrace: core support for ARM
Core ftrace support for the ARM architecture, which includes support
for dynamic function tracing.
Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/arm/kernel/entry-common.S')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 597ed00a08d8..8f79a4789ed4 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -99,6 +99,53 @@ ENTRY(ret_from_fork) | |||
99 | #undef CALL | 99 | #undef CALL |
100 | #define CALL(x) .long x | 100 | #define CALL(x) .long x |
101 | 101 | ||
102 | #ifdef CONFIG_FTRACE | ||
103 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
104 | ENTRY(mcount) | ||
105 | stmdb sp!, {r0-r3, lr} | ||
106 | mov r0, lr | ||
107 | |||
108 | .globl mcount_call | ||
109 | mcount_call: | ||
110 | bl ftrace_stub | ||
111 | ldmia sp!, {r0-r3, pc} | ||
112 | |||
113 | ENTRY(ftrace_caller) | ||
114 | stmdb sp!, {r0-r3, lr} | ||
115 | ldr r1, [fp, #-4] | ||
116 | mov r0, lr | ||
117 | |||
118 | .globl ftrace_call | ||
119 | ftrace_call: | ||
120 | bl ftrace_stub | ||
121 | ldmia sp!, {r0-r3, pc} | ||
122 | |||
123 | #else | ||
124 | |||
125 | ENTRY(mcount) | ||
126 | stmdb sp!, {r0-r3, lr} | ||
127 | ldr r0, =ftrace_trace_function | ||
128 | ldr r2, [r0] | ||
129 | adr r0, ftrace_stub | ||
130 | cmp r0, r2 | ||
131 | bne trace | ||
132 | ldmia sp!, {r0-r3, pc} | ||
133 | |||
134 | trace: | ||
135 | ldr r1, [fp, #-4] | ||
136 | mov r0, lr | ||
137 | mov lr, pc | ||
138 | mov pc, r2 | ||
139 | ldmia sp!, {r0-r3, pc} | ||
140 | |||
141 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
142 | |||
143 | .globl ftrace_stub | ||
144 | ftrace_stub: | ||
145 | mov pc, lr | ||
146 | |||
147 | #endif /* CONFIG_FTRACE */ | ||
148 | |||
102 | /*============================================================================= | 149 | /*============================================================================= |
103 | * SWI handler | 150 | * SWI handler |
104 | *----------------------------------------------------------------------------- | 151 | *----------------------------------------------------------------------------- |