Commit 78efbfb5 authored by Xiong Nandi's avatar Xiong Nandi Committed by Andrew Morton

scripts/decode_stacktrace.sh: better support to ARM32 module stack trace

Sometimes there are special characters around module names in stack
traces, such as ARM32 with BACKTRACE_VERBOSE in "(%pS)" format, such as:
[<806e4845>] (dump_stack_lvl) from [<7f806013>] (hello_init+0x13/0x1000
[test])

In this case, $module will be "[test])", the trace can be decoded by
stripping the right parenthesis first: (dump_stack_lvl) from hello_init
(/foo/test.c:10) test.

Link: https://lkml.kernel.org/r/20240524042600.14738-3-xndchn@gmail.comSigned-off-by: default avatarXiong Nandi <xndchn@gmail.com>
Suggested-by: default avatarElliot Berman <quic_eberman@quicinc.com>
Cc: Bjorn Andersson <quic_bjorande@quicinc.com>
Cc: Carlos Llamas <cmllamas@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent b41838fe
......@@ -283,6 +283,9 @@ handle_line() {
if [[ ${words[$last]} =~ \[([^]]+)\] ]]; then
module=${words[$last]}
# some traces format is "(%pS)", which like "(foo+0x0/0x1 [bar])"
# so $module may like "[bar])". Strip the right parenthesis firstly
module=${module%\)}
module=${module#\[}
module=${module%\]}
modbuildid=${module#* }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment