提交 d178770d 编写于 作者: P Pi-Hsun Shih 提交者: Linus Torvalds

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: 31013836 ("scripts/decode_stacktrace: match basepath using shell prefix operator, not regex")
Co-developed-by: NShik Chen <shik@chromium.org>
Signed-off-by: NPi-Hsun Shih <pihsun@chromium.org>
Signed-off-by: NShik Chen <shik@chromium.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: NStephen 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.orgSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 2910c59f
...@@ -87,8 +87,8 @@ parse_symbol() { ...@@ -87,8 +87,8 @@ parse_symbol() {
return return
fi fi
# Strip out the base of the path # Strip out the base of the path on each line
code=${code#$basepath/} code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
# In the case of inlines, move everything to same line # In the case of inlines, move everything to same line
code=${code//$'\n'/' '} code=${code//$'\n'/' '}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册