summaryrefslogtreecommitdiff
path: root/scripts/decode_stacktrace.sh
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2024-07-29 16:32:02 +0200
committerJerome Brunet <jbrunet@baylibre.com>2024-07-29 16:32:02 +0200
commit66e72a01b60ae6950ddbb3585fdc1424d303e14b (patch)
tree05789274ef25cb5d08b99d1797e7760047469685 /scripts/decode_stacktrace.sh
parent3d0e8b6edd6b08f72e07e1230f371f6ca93531e4 (diff)
parent8400291e289ee6b2bf9779ff1c83a291501f017b (diff)
Merge tag 'v6.11-rc1' into clk-meson-next
Linux 6.11-rc1
Diffstat (limited to 'scripts/decode_stacktrace.sh')
-rwxr-xr-xscripts/decode_stacktrace.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index fa5be6f57b00..a0f50a5b4f7c 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -30,6 +30,7 @@ fi
READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX}
ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
+NM=${UTIL_PREFIX}nm${UTIL_SUFFIX}
if [[ $1 == "-r" ]] ; then
vmlinux=""
@@ -158,7 +159,7 @@ parse_symbol() {
if [[ $aarray_support == true && "${cache[$module,$name]+isset}" == "isset" ]]; then
local base_addr=${cache[$module,$name]}
else
- local base_addr=$(nm "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {print $1; exit}')
+ local base_addr=$(${NM} "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {print $1; exit}')
if [[ $base_addr == "" ]] ; then
# address not found
return
@@ -282,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#* }