Skip to content

Commit

Permalink
scripts/decode_stacktrace: strip basepath from all paths
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
peter50216 authored and torvalds committed Jul 24, 2020
1 parent 2910c59 commit d178770
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/decode_stacktrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'/' '}
Expand Down

0 comments on commit d178770

Please sign in to comment.