diff options
author | Rabin Vincent <rabin@rab.in> | 2010-08-10 14:32:37 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-09-02 10:24:53 -0400 |
commit | 09bfafac3e237415cc4b6adde49f9f28b3a42659 (patch) | |
tree | 980006ad889a1395140dba2a3718ead537975df3 /arch/arm | |
parent | 7e9501fdecdee8151938e624b41978307cadddd2 (diff) |
ARM: 6314/1: ftrace: allow build without frame pointers on ARM
With a new enough GCC, ARM function tracing can be supported without the
need for frame pointers. This is essential for Thumb-2 support, since
frame pointers aren't available then.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig.debug | 5 | ||||
-rw-r--r-- | arch/arm/kernel/armksyms.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/entry-common.S | 14 |
3 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 91344af75f39..4dbce538fec4 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -27,6 +27,11 @@ config ARM_UNWIND | |||
27 | the performance is not affected. Currently, this feature | 27 | the performance is not affected. Currently, this feature |
28 | only works with EABI compilers. If unsure say Y. | 28 | only works with EABI compilers. If unsure say Y. |
29 | 29 | ||
30 | config OLD_MCOUNT | ||
31 | bool | ||
32 | depends on FUNCTION_TRACER && FRAME_POINTER | ||
33 | default y | ||
34 | |||
30 | config DEBUG_USER | 35 | config DEBUG_USER |
31 | bool "Verbose user fault messages" | 36 | bool "Verbose user fault messages" |
32 | help | 37 | help |
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c index 8214bfebfaca..e5e1e5387678 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c | |||
@@ -165,6 +165,8 @@ EXPORT_SYMBOL(_find_next_bit_be); | |||
165 | #endif | 165 | #endif |
166 | 166 | ||
167 | #ifdef CONFIG_FUNCTION_TRACER | 167 | #ifdef CONFIG_FUNCTION_TRACER |
168 | #ifdef CONFIG_OLD_MCOUNT | ||
168 | EXPORT_SYMBOL(mcount); | 169 | EXPORT_SYMBOL(mcount); |
170 | #endif | ||
169 | EXPORT_SYMBOL(__gnu_mcount_nc); | 171 | EXPORT_SYMBOL(__gnu_mcount_nc); |
170 | #endif | 172 | #endif |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index f05a35a59694..6805a7216bf8 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -128,6 +128,13 @@ ENDPROC(ret_from_fork) | |||
128 | * allows it to be clobbered in subroutines and doesn't use it to hold | 128 | * allows it to be clobbered in subroutines and doesn't use it to hold |
129 | * parameters.) | 129 | * parameters.) |
130 | */ | 130 | */ |
131 | |||
132 | #ifndef CONFIG_OLD_MCOUNT | ||
133 | #if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) | ||
134 | #error Ftrace requires CONFIG_FRAME_POINTER=y with GCC older than 4.4.0. | ||
135 | #endif | ||
136 | #endif | ||
137 | |||
131 | #ifdef CONFIG_DYNAMIC_FTRACE | 138 | #ifdef CONFIG_DYNAMIC_FTRACE |
132 | ENTRY(mcount) | 139 | ENTRY(mcount) |
133 | stmdb sp!, {r0-r3, lr} | 140 | stmdb sp!, {r0-r3, lr} |
@@ -173,6 +180,12 @@ gnu_trace: | |||
173 | ldmia sp!, {r0-r3, ip, lr} | 180 | ldmia sp!, {r0-r3, ip, lr} |
174 | mov pc, ip | 181 | mov pc, ip |
175 | 182 | ||
183 | #ifdef CONFIG_OLD_MCOUNT | ||
184 | /* | ||
185 | * This is under an ifdef in order to force link-time errors for people trying | ||
186 | * to build with !FRAME_POINTER with a GCC which doesn't use the new-style | ||
187 | * mcount. | ||
188 | */ | ||
176 | ENTRY(mcount) | 189 | ENTRY(mcount) |
177 | stmdb sp!, {r0-r3, lr} | 190 | stmdb sp!, {r0-r3, lr} |
178 | ldr r0, =ftrace_trace_function | 191 | ldr r0, =ftrace_trace_function |
@@ -191,6 +204,7 @@ trace: | |||
191 | mov pc, r2 | 204 | mov pc, r2 |
192 | ldr lr, [fp, #-4] @ restore lr | 205 | ldr lr, [fp, #-4] @ restore lr |
193 | ldmia sp!, {r0-r3, pc} | 206 | ldmia sp!, {r0-r3, pc} |
207 | #endif | ||
194 | 208 | ||
195 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 209 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
196 | 210 | ||