[patch 12/15] scripts/decode_stacktrace: strip basepath from all paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Pi-Hsun Shih <pihsun@xxxxxxxxxxxx>
Subject: 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.

Link: http://lkml.kernel.org/r/20200720082709.252805-1-pihsun@xxxxxxxxxxxx
Fixes: 31013836a71e ("scripts/decode_stacktrace: match basepath using shell prefix operator, not regex")
Signed-off-by: Pi-Hsun Shih <pihsun@xxxxxxxxxxxx>
Signed-off-by: Shik Chen <shik@xxxxxxxxxxxx>
Co-developed-by: Shik Chen <shik@xxxxxxxxxxxx>
Reviewed-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
Cc: Sasha Levin <sashal@xxxxxxxxxx>
Cc: Nicolas Boichat <drinkcat@xxxxxxxxxxxx>
Cc: Jiri Slaby <jslaby@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/decode_stacktrace.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/scripts/decode_stacktrace.sh~scripts-decode_stacktrace-strip-basepath-from-all-paths
+++ a/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'/' '}
_



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux