Skip to content

Commit b21e023

Browse files
vitkyrkaRussell King
authored andcommitted
ARM: 7689/1: add unwind annotations to ftrace asm
Add unwind annotations to the ftrace assembly code so that the function tracer's stacktracing options (func_stack_trace, etc.) work when CONFIG_ARM_UNWIND is enabled. Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 6f3d90e commit b21e023

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arch/arm/kernel/entry-common.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,13 @@ ENDPROC(ftrace_graph_caller_old)
276276
*/
277277

278278
.macro mcount_enter
279+
/*
280+
* This pad compensates for the push {lr} at the call site. Note that we are
281+
* unable to unwind through a function which does not otherwise save its lr.
282+
*/
283+
UNWIND(.pad #4)
279284
stmdb sp!, {r0-r3, lr}
285+
UNWIND(.save {r0-r3, lr})
280286
.endm
281287

282288
.macro mcount_get_lr reg
@@ -289,24 +295,30 @@ ENDPROC(ftrace_graph_caller_old)
289295
.endm
290296

291297
ENTRY(__gnu_mcount_nc)
298+
UNWIND(.fnstart)
292299
#ifdef CONFIG_DYNAMIC_FTRACE
293300
mov ip, lr
294301
ldmia sp!, {lr}
295302
mov pc, ip
296303
#else
297304
__mcount
298305
#endif
306+
UNWIND(.fnend)
299307
ENDPROC(__gnu_mcount_nc)
300308

301309
#ifdef CONFIG_DYNAMIC_FTRACE
302310
ENTRY(ftrace_caller)
311+
UNWIND(.fnstart)
303312
__ftrace_caller
313+
UNWIND(.fnend)
304314
ENDPROC(ftrace_caller)
305315
#endif
306316

307317
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
308318
ENTRY(ftrace_graph_caller)
319+
UNWIND(.fnstart)
309320
__ftrace_graph_caller
321+
UNWIND(.fnend)
310322
ENDPROC(ftrace_graph_caller)
311323
#endif
312324

0 commit comments

Comments
 (0)