aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/decode_stacktrace.sh
diff options
context:
space:
mode:
authorPi-Hsun Shih <[email protected]>2020-07-24 04:15:43 +0000
committerLinus Torvalds <[email protected]>2020-07-24 19:42:42 +0000
commitd178770d8d21489abf5bafefcbb6d5243b482e9a (patch)
treef3d08e05d896357f4a9ea4022c0a5a1bcc444988 /scripts/decode_stacktrace.sh
parentsquashfs: fix length field overlap check in metadata reading (diff)
downloadkernel-d178770d8d21489abf5bafefcbb6d5243b482e9a.tar.gz
kernel-d178770d8d21489abf5bafefcbb6d5243b482e9a.zip
scripts/decode_stacktrace: strip basepath from all paths
Currently the basepath is removed only from the beginning of the string. When the symbol is inlined and there's multiple line outputs of addr2line, only the first line would have basepath removed. Change to remove the basepath prefix from all lines. Fixes: 31013836a71e ("scripts/decode_stacktrace: match basepath using shell prefix operator, not regex") Co-developed-by: Shik Chen <[email protected]> Signed-off-by: Pi-Hsun Shih <[email protected]> Signed-off-by: Shik Chen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Nicolas Boichat <[email protected]> Cc: Jiri Slaby <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/decode_stacktrace.sh')
-rwxr-xr-xscripts/decode_stacktrace.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 66a6d511b524..0869def435ee 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -87,8 +87,8 @@ parse_symbol() {
return
fi
- # Strip out the base of the path
- code=${code#$basepath/}
+ # Strip out the base of the path on each line
+ code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
# In the case of inlines, move everything to same line
code=${code//$'\n'/' '}