From: Xiong Nandi Date: Fri, 24 May 2024 04:26:00 +0000 (+0800) Subject: scripts/decode_stacktrace.sh: better support to ARM32 module stack trace X-Git-Tag: v6.11-rc1~84^2~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78efbfb5b7675b88d987fda108df0a2f3e07e722;p=thirdparty%2Fkernel%2Flinux.git 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 Suggested-by: Elliot Berman Cc: Bjorn Andersson Cc: Carlos Llamas Signed-off-by: Andrew Morton --- diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 2bc3a54ffba5c..a0f50a5b4f7c4 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#* }