From: chenqiwu <qiwuchen55@gmail.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: qiwuchen55@gmail.com, catalin.marinas@arm.com, will@kernel.org,
kaleshsingh@google.com, mhiramat@kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] arm64: Add USER_STACKTRACE support
Date: Sat, 9 Dec 2023 21:20:38 +0800 [thread overview]
Message-ID: <20231209132038.GA9628@rlk> (raw)
In-Reply-To: <ZWX9wPMPLUlMeDc3@FVFF77S0Q05N.cambridge.arm.com>
On Tue, Nov 28, 2023 at 02:48:32PM +0000, Mark Rutland wrote:
> On Fri, Nov 24, 2023 at 11:27:39PM -0800, qiwuchen55@gmail.com wrote:
> > From: chenqiwu <qiwu.chen@transsion.com>
> >
> > Use the perf_callchain_user() code as blueprint to implement
> > arch_stack_walk_user() which add ftrace userstacktrace support
> > on arm64.
> > With this patch, tracer can get userstacktrace by below callchain:
> > ftrace_trace_userstack ->
> > stack_trace_save_user ->
> > aasrch_stack_walk_user
> > An example test case is as shown below:
> > # cd /sys/kernel/debug/tracing
> > # echo 1 > options/userstacktrace
> > # echo 1 > options/sym-userobj
> > # echo 1 > events/sched/sched_process_fork/enable
> > # cat trace
> > ......
> > bash-418 [000] ..... 121.820661: sched_process_fork: comm=bash pid=418 child_comm=bash child_pid=441
> > bash-418 [000] ..... 121.821340: <user stack trace>
> > => /lib/aarch64-linux-gnu/libc-2.32.so[+0xa76d8]
> > => /bin/bash[+0x5f354]
> > => /bin/bash[+0x47fe8]
> > => /bin/bash[+0x493f8]
> > => /bin/bash[+0x4aec4]
> > => /bin/bash[+0x4c31c]
> > => /bin/bash[+0x339b0]
> > => /bin/bash[+0x322f8]
> >
> > changes in v2:
> > - Remove useless arch_dump_user_stacktrace().
> > - Rework arch_stack_walk_user() implementation.
> > - Modify the commit message.
> > Tested-by: chenqiwu <qiwu.chen@transsion.com>
> > Signed-off-by: chenqiwu <qiwu.chen@transsion.com>
> > ---
> > arch/arm64/Kconfig | 1 +
> > arch/arm64/kernel/stacktrace.c | 120 +++++++++++++++++++++++++++++++++
> > 2 files changed, 121 insertions(+)
>
> Thanks for this, it looks much better than v1.
> However, as I mentioned on v1, we want to have one copy of this code.
>
> Rather than just copying the logic from perf_callchain.c, please also update
> perf_callchain_user() to use arch_stack_walk_user() and delete the redundant code.
>
> Thanks,
> Mark.
>
Hi Mark,
Thanks for your professional advice, I make an improvement in patch v3.
Please help review this again:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20231129160119.60829-1-qiwu.chen@transsion.com/
Thanks
Qiwu
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-12-09 13:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-25 7:27 [PATCH v2] arm64: Add USER_STACKTRACE support qiwuchen55
2023-11-28 14:48 ` Mark Rutland
2023-12-09 13:20 ` chenqiwu [this message]
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=20231209132038.GA9628@rlk \
--to=qiwuchen55@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=kaleshsingh@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=will@kernel.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