mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
scripts/decode_stacktrace: strip basepath from all paths
[ Upstream commitd178770d8d
] 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:31013836a7
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8fede296d5
commit
5b031bbd72
@ -77,8 +77,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'/' '}
|
||||
|
Loading…
Reference in New Issue
Block a user