From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Michal Suchanek <msuchanek@suse.de>, Torsten Duwe <duwe@suse.de>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/6] powerpc: Stack tracer fixes
Date: Fri, 21 May 2021 12:18:35 +0530 [thread overview]
Message-ID: <cover.1621577151.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
While the stack tracer worked fine with ppc64 ELFv1 ABI, it was never
ported/enabled to run properly with ppc64 ELFv2 ABI, -mprofile-kernel in
particular. The primary issue is that the call to ftrace happens before
a function sets up its own stackframe. Due to this, the traced function
never shows up in the stack trace. This produces confusing results,
especially with the stack trace filter and is evident with the selftest
failure. This is also an issue on ppc32.
The first two commits add support to the stack tracer for powerpc. This
support utilizes the powerpc ABI to produce reliable stack traces, as
well as to determine stackframe sizes.
Patches 3, 4 and 6 add support for decoding the traced function name in
various stack traces and to show the same.
Patch 5 makes this change for livepatching and I am a bit unsure of this
change. More details in patch 5.
- Naveen
Naveen N. Rao (6):
trace/stack: Move code to save the stack trace into a separate
function
powerpc/trace: Add support for stack tracer
powerpc: Indicate traced function name in show_stack()
powerpc/perf: Include traced function in the callchain
powerpc/stacktrace: Include ftraced function in
arch_stack_walk_reliable()
powerpc/stacktrace: Include ftraced function in arch_stack_walk()
arch/powerpc/include/asm/ftrace.h | 18 ++++++
arch/powerpc/kernel/process.c | 3 +
arch/powerpc/kernel/stacktrace.c | 8 +++
arch/powerpc/kernel/trace/ftrace.c | 70 +++++++++++++++++++++
arch/powerpc/perf/callchain.c | 5 ++
include/linux/ftrace.h | 8 +++
kernel/trace/trace_stack.c | 98 ++++++++++++++++--------------
7 files changed, 164 insertions(+), 46 deletions(-)
base-commit: 258eb1f3aaa9face35e613c229c1337263491ea0
--
2.30.2
next reply other threads:[~2021-05-21 6:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 6:48 Naveen N. Rao [this message]
2021-05-21 6:48 ` [RFC PATCH 1/6] trace/stack: Move code to save the stack trace into a separate function Naveen N. Rao
2021-06-01 15:28 ` Steven Rostedt
2021-06-02 10:35 ` Naveen N. Rao
2021-06-02 14:09 ` Steven Rostedt
2021-05-21 6:48 ` [RFC PATCH 2/6] powerpc/trace: Add support for stack tracer Naveen N. Rao
2021-06-01 13:51 ` Naveen N. Rao
2021-05-21 6:48 ` [RFC PATCH 3/6] powerpc: Indicate traced function name in show_stack() Naveen N. Rao
2021-05-21 6:48 ` [RFC PATCH 4/6] powerpc/perf: Include traced function in the callchain Naveen N. Rao
2021-05-21 6:48 ` [RFC PATCH 5/6] powerpc/stacktrace: Include ftraced function in arch_stack_walk_reliable() Naveen N. Rao
2021-05-21 6:48 ` [RFC PATCH 6/6] powerpc/stacktrace: Include ftraced function in arch_stack_walk() Naveen N. Rao
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=cover.1621577151.git.naveen.n.rao@linux.vnet.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=duwe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).