OSDN Git Service

scripts/decode_stacktrace: only strip base path when a prefix of the path
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 28 Dec 2018 08:31:25 +0000 (00:31 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:13:13 +0000 (10:13 +0100)
commitbc5abb80f1299581ae6d55fabd5da7bcbc72e3ea
tree36ee2fe6ee8cb3077f9bfb0de2740175762ec6a9
parent1f8aea084cb3d962bdd1ceaadf0f6d54aa7862d5
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 <marc.zyngier@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/decode_stacktrace.sh