Skip to content

Commit d178770

Browse files
peter50216torvalds
authored andcommitted
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: 3101383 ("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]>
1 parent 2910c59 commit d178770

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/decode_stacktrace.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ parse_symbol() {
8787
return
8888
fi
8989

90-
# Strip out the base of the path
91-
code=${code#$basepath/}
90+
# Strip out the base of the path on each line
91+
code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
9292

9393
# In the case of inlines, move everything to same line
9494
code=${code//$'\n'/' '}

0 commit comments

Comments
 (0)