From: Marc Zyngier Date: Fri, 28 Dec 2018 08:31:25 +0000 (-0800) Subject: scripts/decode_stacktrace: only strip base path when a prefix of the path X-Git-Tag: v4.19.21~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa3c7c098c6a718fcb6656380fb306fabd98c818;p=platform%2Fkernel%2Flinux-rpi.git scripts/decode_stacktrace: only strip base path when a prefix of the path [ Upstream commit 67a28de47faa83585dd644bd4c31e5a1d9346c50 ] Running something like: decodecode vmlinux . leads to interested results where not only the leading "." gets stripped from the displayed paths, but also anywhere in the string, displaying something like: kvm_vcpu_check_block (arch/arm64/kvm/virt/kvm/kvm_mainc:2141) which doesn't help further processing. Fix it by only stripping the base path if it is a prefix of the path. Link: http://lkml.kernel.org/r/20181210174659.31054-3-marc.zyngier@arm.com Signed-off-by: Marc Zyngier Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 64220e3..98a7d63 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -78,7 +78,7 @@ parse_symbol() { fi # Strip out the base of the path - code=${code//$basepath/""} + code=${code//^$basepath/""} # In the case of inlines, move everything to same line code=${code//$'\n'/' '}