From: Peter Zijlstra <peterz@infradead.org>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: l00383200 <liucheng32@huawei.com>,
tglx@linutronix.de, gregkh@linuxfoundation.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Stacktrace in ARM32 architecture has jumped the first 2 layers, which may ignore the display of save_stack_trace_tsk.
Date: Fri, 31 May 2019 10:27:28 +0200 [thread overview]
Message-ID: <20190531082728.GK2623@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190530162219.dtooagpeyczfaazb@shell.armlinux.org.uk>
On Thu, May 30, 2019 at 05:22:19PM +0100, Russell King - ARM Linux admin wrote:
> On Thu, May 30, 2019 at 11:06:39PM +0800, l00383200 wrote:
> > Without optimization, both save_stack_trace_tsk and __save_stack_trace
> > will have stacktrace information in ARM32.
> >
> > In this situation, "data.skip += 2" operation will skip the first two layers,
> > which may make the stacktrace strange and different from other architectures.
> >
> > A simple example is as follows:
> > In ARM32 architecture:
> > [<ffffff80083cb3f8>] proc_pid_stack+0xac/0x12c
> > [<ffffff80083c7c70>] proc_single_show+0x5c/0xa8
> > [<ffffff800838aca8>] seq_read+0x130/0x420
> > [<ffffff8008365c54>] __vfs_read+0x60/0x11c
> > [<ffffff80083665dc>] vfs_read+0x8c/0x140
> > [<ffffff800836717c>] SyS_read+0x6c/0xcc
> > [<ffffff8008202cb8>] __sys_trace_return+0x0/0x4
> > [<ffffffffffffffff>] 0xffffffffffffffff
> >
> > In some other architectures(ARM64):
> > [<ffffff8008209be0>] save_stack_trace_tsk+0x0/0xf0
> > [<ffffff80083cb3f8>] proc_pid_stack+0xac/0x12c
> > [<ffffff80083c7c70>] proc_single_show+0x5c/0xa8
> > [<ffffff800838aca8>] seq_read+0x130/0x420
> > [<ffffff8008365c54>] __vfs_read+0x60/0x11c
> > [<ffffff80083665dc>] vfs_read+0x8c/0x140
> > [<ffffff800836717c>] SyS_read+0x6c/0xcc
> > [<ffffff8008202cb8>] __sys_trace_return+0x0/0x4
> > [<ffffffffffffffff>] 0xffffffffffffffff
> >
> > Therefore, we'd better just jump only one layer to ensure accuracy and consistency.
>
> Why do we want to log the function we called to save the stack trace
> _in_ the stack trace? What useful purpose does it serve?
>
> I've always taken the attitude that if we want a stack trace from a
> certain point in the function, then that's the point that the stack
> trace should start. It's entirely sensible.
Agreed, also the .skip interface sucks and is slated for replacement
(whenever we get around to it).
prev parent reply other threads:[~2019-05-31 8:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 15:06 l00383200
2019-05-30 16:22 ` Russell King - ARM Linux admin
2019-05-31 8:27 ` Peter Zijlstra [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=20190531082728.GK2623@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=liucheng32@huawei.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®