All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/decode_stacktrace: Strip basepath from all paths.
@ 2020-07-20  8:27 Pi-Hsun Shih
  2020-07-20 23:01 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Pi-Hsun Shih @ 2020-07-20  8:27 UTC (permalink / raw)
  Cc: Pi-Hsun Shih, Shik Chen, Sasha Levin, Stephen Boyd,
	Andrew Morton, Nicolas Boichat, open list

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@chromium.org>
Co-developed-by: Shik Chen <shik@chromium.org>
Signed-off-by: Shik Chen <shik@chromium.org>
---
 scripts/decode_stacktrace.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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'/' '}

base-commit: 5714ee50bb4375bd586858ad800b1d9772847452
-- 
2.28.0.rc0.105.gf9edc3c819-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/decode_stacktrace: Strip basepath from all paths.
  2020-07-20  8:27 [PATCH] scripts/decode_stacktrace: Strip basepath from all paths Pi-Hsun Shih
@ 2020-07-20 23:01 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-07-20 23:01 UTC (permalink / raw)
  To: Pi-Hsun Shih
  Cc: Pi-Hsun Shih, Shik Chen, Sasha Levin, Andrew Morton,
	Nicolas Boichat, linux-kernel

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@chromium.org>
> Co-developed-by: Shik Chen <shik@chromium.org>
> Signed-off-by: Shik Chen <shik@chromium.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@chromium.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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-20 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20  8:27 [PATCH] scripts/decode_stacktrace: Strip basepath from all paths Pi-Hsun Shih
2020-07-20 23:01 ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.