summaryrefslogtreecommitdiffstats
path: root/scripts/decode_stacktrace.sh
diff options
context:
space:
mode:
authorXiong Nandi <xndchn@gmail.com>2024-05-24 06:26:00 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-06-25 07:25:00 +0200
commit78efbfb5b7675b88d987fda108df0a2f3e07e722 (patch)
treefc0d7a498a3a38da7cb980652fd3c22f0e07aae1 /scripts/decode_stacktrace.sh
parentscripts/decode_stacktrace.sh: wrap nm with UTIL_PREFIX and UTIL_SUFFIX (diff)
downloadlinux-78efbfb5b7675b88d987fda108df0a2f3e07e722.tar.xz
linux-78efbfb5b7675b88d987fda108df0a2f3e07e722.zip
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.com Signed-off-by: Xiong Nandi <xndchn@gmail.com> Suggested-by: Elliot Berman <quic_eberman@quicinc.com> Cc: Bjorn Andersson <quic_bjorande@quicinc.com> Cc: Carlos Llamas <cmllamas@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to '')
-rwxr-xr-xscripts/decode_stacktrace.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 2bc3a54ffba5..a0f50a5b4f7c 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -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#* }