[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <159528610934.3847286.7269726046959428266@swboyd.mtv.corp.google.com>
Date: Mon, 20 Jul 2020 16:01:49 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Pi-Hsun Shih <pihsun@...omium.org>
Cc: Pi-Hsun Shih <pihsun@...omium.org>, Shik Chen <shik@...omium.org>,
Sasha Levin <sashal@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Nicolas Boichat <drinkcat@...omium.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scripts/decode_stacktrace: Strip basepath from all paths.
Quoting Pi-Hsun Shih (2020-07-20 01:27:07)
> 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")
> Signed-off-by: Pi-Hsun Shih <pihsun@...omium.org>
> Co-developed-by: Shik Chen <shik@...omium.org>
> Signed-off-by: Shik Chen <shik@...omium.org>
I thought Co-developed-by and the other SoB came before your SoB.
> ---
> scripts/decode_stacktrace.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Stephen Boyd <swboyd@...omium.org>
>
> diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
> index 66a6d511b524..0869def435ee 100755
> --- a/scripts/decode_stacktrace.sh
> +++ b/scripts/decode_stacktrace.sh
> @@ -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'/' '}
Given that there's a while loop now maybe this line above could be
removed and the echo above replaced with a printf.
Powered by blists - more mailing lists