Skip to content
Commit 04574fd5 authored by Zqiang's avatar Zqiang Committed by Bruce Ashfield
Browse files

tracing/arm: Have max stack tracer handle the case of return address after data



This change is similar to the following patch,
it also suitable for arm.

[
Author: Steven Rostedt (VMware)
Email: rostedt@goodmis.org
Subject: tracing/arm64: Have max stack tracer handle the case of return address after data
Date: Fri, 9 Aug 2019 02:15:05 +0000

Most archs (well at least x86) store the function call return address on the
stack before storing the local variables for the function. The max stack
tracer depends on this in its algorithm to display the stack size of each
function it finds in the back trace.

Some archs (arm64), may store the return address (from its link register)
just before calling a nested function. There's no reason to save the link
register on leaf functions, as it wont be updated. This breaks the algorithm
of the max stack tracer.

Add a new define ARCH_FTRACE_SHIFT_STACK_TRACER that an architecture may set
if it stores the return address (link register) after it stores the
function's local variables, and have the stack trace shift the values of the
mapped stack size to the appropriate functions.

Link: 20190802094103.163576-1-jiping.ma2@windriver.com

Reported-by: default avatarJiping Ma <jiping.ma2@windriver.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarJiping Ma <jiping.ma2@windriver.com>
]

Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
Signed-off-by: default avatarBruce Ashfield <bruce.ashfield@gmail.com>
parent 0e51e571
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment