summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPi-Hsun Shih <pihsun@chromium.org>2020-07-23 21:15:43 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-29 07:42:54 +0200
commit0280a1eb2308d6acc457779a1f0a0a813c39af1e (patch)
tree15acf4c92c5c3270a2f4cd6ec3d4ce3b8b4d02e6
parent7b8d75ae4de2572db2c8b9fb2b14d1110ed6a140 (diff)
downloadlinux-stable-0280a1eb2308d6acc457779a1f0a0a813c39af1e.tar.gz
linux-stable-0280a1eb2308d6acc457779a1f0a0a813c39af1e.tar.bz2
linux-stable-0280a1eb2308d6acc457779a1f0a0a813c39af1e.zip
scripts/decode_stacktrace: strip basepath from all paths
[ Upstream commit d178770d8d21489abf5bafefcbb6d5243b482e9a ] 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 <shik@chromium.org> Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Signed-off-by: Shik Chen <shik@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Cc: Sasha Levin <sashal@kernel.org> Cc: Nicolas Boichat <drinkcat@chromium.org> Cc: Jiri Slaby <jslaby@suse.cz> Link: http://lkml.kernel.org/r/20200720082709.252805-1-pihsun@chromium.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-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 5aa75a0a1ced..946735bd5a25 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -77,8 +77,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'/' '}