2024-03-11 15:32:54

by Luca Ceresoli

[permalink] [raw]
Subject: [PATCH 2/3] scripts/decode_stacktrace.sh: clarify command line

The syntax as expressed by usage() is not entirely correct: "<modules
path>" cannot be passed without "<base path>|auto". Additionally human
reading of this syntax can be subject to misunderstanding due the mixture
of '|' and '[]'.

Improve readability in various ways:
* rewrite using two lines for the two allowed usages
* add square brackets around "<vmlinux>" as it is optional when using
debuginfod-find
* move "<modules path>" to inside the square brackets of the 2nd
positional parameter
* use underscores instead of spaces in <...> strings

Signed-off-by: Luca Ceresoli <[email protected]>
---
scripts/decode_stacktrace.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index 7f3fb5e82707..b56e79060e9f 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -5,7 +5,8 @@

usage() {
echo "Usage:"
- echo " $0 -r <release> | <vmlinux> [<base path>|auto] [<modules path>]"
+ echo " $0 -r <release>"
+ echo " $0 [<vmlinux> [<base_path>|auto [<modules_path>]]]"
}

# Try to find a Rust demangler

--
2.34.1



2024-05-08 21:38:03

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 2/3] scripts/decode_stacktrace.sh: clarify command line

Quoting Luca Ceresoli (2024-03-11 08:24:55)
> The syntax as expressed by usage() is not entirely correct: "<modules
> path>" cannot be passed without "<base path>|auto". Additionally human
> reading of this syntax can be subject to misunderstanding due the mixture
> of '|' and '[]'.
>
> Improve readability in various ways:
> * rewrite using two lines for the two allowed usages
> * add square brackets around "<vmlinux>" as it is optional when using
> debuginfod-find
> * move "<modules path>" to inside the square brackets of the 2nd
> positional parameter
> * use underscores instead of spaces in <...> strings
>
> Signed-off-by: Luca Ceresoli <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>