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 <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>
1 parent 2910c59 commit d178770

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎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)