[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240522185741891-0700.eberman@hu-eberman-lv.qualcomm.com>
Date: Wed, 22 May 2024 19:00:30 -0700
From: Elliot Berman <quic_eberman@...cinc.com>
To: Xiong Nandi <xndchn@...il.com>
CC: <akpm@...ux-foundation.org>, <linux-kernel@...r.kernel.org>,
<quic_bjorande@...cinc.com>, <cmllamas@...gle.com>
Subject: Re: [PATCH v2 2/2] scripts/decode_stacktrace.sh: better support to
ARM32 module stack trace
On Thu, May 23, 2024 at 09:03:18AM +0800, Xiong Nandi wrote:
> Sometimes there is special characters around module name in stack trace,
> such as ARM32 with BACKTRACE_VERBOSE in "(%pS)" format, such as:
> [<806e4845>] (dump_stack_lvl) from [<7f806013>] (hello_init+0x13/0x1000 [test])
>
> After stripping other characters around "[module]", it can be finally decoded:
> (dump_stack_lvl) from hello_init (/foo/test.c:10) test
>
> Signed-off-by: Xiong Nandi <xndchn@...il.com>
> ---
> scripts/decode_stacktrace.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
> index 2bc3a54ffba5..324e4a6c260a 100755
> --- a/scripts/decode_stacktrace.sh
> +++ b/scripts/decode_stacktrace.sh
> @@ -283,8 +283,8 @@ handle_line() {
>
> if [[ ${words[$last]} =~ \[([^]]+)\] ]]; then
> module=${words[$last]}
> - module=${module#\[}
> - module=${module%\]}
> + module=${module#*\[}
> + module=${module%\]*}
I think it'd be better to just remove the parenthesis similar to how is
done in the symbol name.
That is:
module=${words[$last]}
module=${module#\[}
module=${module%\]}
# some nice comment explaining only the closing paren is
# need to be stripped
module=${module%\)}
modbuildid=${module#* }
> modbuildid=${module#* }
> module=${module% *}
> if [[ $modbuildid == $module ]]; then
> --
> 2.25.1
>
Powered by blists - more mailing lists