Skip to content

Commit 0280a1e

Browse files
peter50216gregkh
authored andcommitted
scripts/decode_stacktrace: strip basepath from all paths
[ Upstream commit d178770d8d21489abf5bafefcbb6d5243b482e9a ] 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: 31013836a71e ("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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 7b8d75a commit 0280a1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: scripts/decode_stacktrace.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ parse_symbol() {
7777
return
7878
fi
7979

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

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

0 commit comments

Comments
 (0)