From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Jiping Ma <jiping.ma2@windriver.com>,
catalin.marinas@arm.com, will.deacon@arm.com, mingo@redhat.com,
Joel Fernandes <joel@joelfernandes.org>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/2 v2] tracing/arm: Fix the stack tracer when LR is saved after local storage
Date: Wed, 07 Aug 2019 13:28:26 -0400 [thread overview]
Message-ID: <20190807172826.352574408@goodmis.org> (raw)
As arm64 saves the link register after a function's local variables are
stored, it causes the max stack tracer to be off by one in its output
of which function has the bloated stack frame.
The first patch fixes this by creating a ARCH_RET_ADDR_BEFORE_LOCAL_VARS
define that an achitecture (arm64) may set in asm/ftrace.h, and this
will cause the stack tracer to make the shift.
As it has been proven that the stack tracer isn't the most trivial
algorithm to understand by staring at the code, the second patch adds
comments to the code to explain the algorithm with and without the
ARCH_RET_ADDR_BEFORE_LOCAL_VARS.
Hmm, should this be sent to stable (and for inclusion now?)
-- Steve
Changes since v1:
- Fixed wrong value in stack_trace_index[] array in comment
- Added a comment about gcc currently saves the LR after local variables,
but there's no guarantee that it will be like that in the future.
(Notified of this by Mark Rutland)
Steven Rostedt (VMware) (2):
tracing/arm64: Have max stack tracer handle the case of return address after data
tracing: Document the stack trace algorithm in the comments
----
arch/arm64/include/asm/ftrace.h | 13 +++++
kernel/trace/trace_stack.c | 112 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 125 insertions(+)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Joel Fernandes <joel@joelfernandes.org>,
Jiping Ma <jiping.ma2@windriver.com>,
mingo@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/2 v2] tracing/arm: Fix the stack tracer when LR is saved after local storage
Date: Wed, 07 Aug 2019 13:28:26 -0400 [thread overview]
Message-ID: <20190807172826.352574408@goodmis.org> (raw)
As arm64 saves the link register after a function's local variables are
stored, it causes the max stack tracer to be off by one in its output
of which function has the bloated stack frame.
The first patch fixes this by creating a ARCH_RET_ADDR_BEFORE_LOCAL_VARS
define that an achitecture (arm64) may set in asm/ftrace.h, and this
will cause the stack tracer to make the shift.
As it has been proven that the stack tracer isn't the most trivial
algorithm to understand by staring at the code, the second patch adds
comments to the code to explain the algorithm with and without the
ARCH_RET_ADDR_BEFORE_LOCAL_VARS.
Hmm, should this be sent to stable (and for inclusion now?)
-- Steve
Changes since v1:
- Fixed wrong value in stack_trace_index[] array in comment
- Added a comment about gcc currently saves the LR after local variables,
but there's no guarantee that it will be like that in the future.
(Notified of this by Mark Rutland)
Steven Rostedt (VMware) (2):
tracing/arm64: Have max stack tracer handle the case of return address after data
tracing: Document the stack trace algorithm in the comments
----
arch/arm64/include/asm/ftrace.h | 13 +++++
kernel/trace/trace_stack.c | 112 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 125 insertions(+)
next reply other threads:[~2019-08-07 17:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 17:28 Steven Rostedt [this message]
2019-08-07 17:28 ` [PATCH 0/2 v2] tracing/arm: Fix the stack tracer when LR is saved after local storage Steven Rostedt
2019-08-07 17:28 ` [PATCH 1/2 v2] tracing/arm64: Have max stack tracer handle the case of return address after data Steven Rostedt
2019-08-07 17:28 ` Steven Rostedt
2019-08-07 19:29 ` Steven Rostedt
2019-08-07 19:29 ` Steven Rostedt
2019-08-08 16:28 ` Will Deacon
2019-08-08 16:28 ` Will Deacon
2019-08-08 16:36 ` Steven Rostedt
2019-08-08 16:36 ` Steven Rostedt
2019-08-08 17:11 ` Will Deacon
2019-08-08 17:11 ` Will Deacon
2019-08-08 17:24 ` Steven Rostedt
2019-08-08 17:24 ` Steven Rostedt
2019-08-09 2:17 ` Jiping Ma
2019-08-09 2:24 ` Steven Rostedt
2019-08-09 2:24 ` Steven Rostedt
2019-08-13 17:31 ` Will Deacon
2019-08-13 17:31 ` Will Deacon
2019-08-13 17:47 ` Steven Rostedt
2019-08-13 17:47 ` Steven Rostedt
2019-08-09 8:55 ` Mark Rutland
2019-08-09 8:55 ` Mark Rutland
2019-08-07 17:28 ` [PATCH 2/2 v2] tracing: Document the stack trace algorithm in the comments Steven Rostedt
2019-08-07 17:28 ` Steven Rostedt
2019-08-08 20:17 ` Joel Fernandes
2019-08-08 20:17 ` Joel Fernandes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190807172826.352574408@goodmis.org \
--to=rostedt@goodmis.org \
--cc=catalin.marinas@arm.com \
--cc=jiping.ma2@windriver.com \
--cc=joel@joelfernandes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.