From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: "Konstantin Khlebnikov" <koct9i@gmail.com>,
"Stephen Boyd" <swboyd@chromium.org>,
"Sasha Levin" <sashal@kernel.org>,
"Alexis Lothoré" <alexis.lothore@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
linux-kernel@vger.kernel.org,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>
Subject: [PATCH 3/3] scripts/decode_stacktrace.sh: add '-h' flag
Date: Mon, 11 Mar 2024 16:24:56 +0100 [thread overview]
Message-ID: <20240311-decode_stacktrace-find_module-improvements-v1-3-8bea42b421aa@bootlin.com> (raw)
In-Reply-To: <20240311-decode_stacktrace-find_module-improvements-v1-0-8bea42b421aa@bootlin.com>
When no parameters are passed, the usage instructions are presented only
when debuginfod-find is not found. This makes sense because with debuginfod
none of the positional parameters are needed. However it means that users
having debuginfod-find installed will have no chance of reading the usage
text without opening the file.
Many programs have a '-h' flag to get the usage, so add such a flag.
Invoking 'scripts/decode_stacktrace.sh -h' will now show the usage text and
exit.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
scripts/decode_stacktrace.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index b56e79060e9f..e8c9976062d0 100755
--- a/scripts/decode_stacktrace.sh
+++ b/scripts/decode_stacktrace.sh
@@ -7,6 +7,7 @@ usage() {
echo "Usage:"
echo " $0 -r <release>"
echo " $0 [<vmlinux> [<base_path>|auto [<modules_path>]]]"
+ echo " $0 -h"
}
# Try to find a Rust demangler
@@ -32,7 +33,10 @@ fi
READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX}
ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
-if [[ $1 == "-r" ]] ; then
+if [[ $1 == "-h" ]] ; then
+ usage
+ exit 0
+elif [[ $1 == "-r" ]] ; then
vmlinux=""
basepath="auto"
modpath=""
--
2.34.1
next prev parent reply other threads:[~2024-03-11 15:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 15:24 [PATCH 0/3] scripts/decode_stacktrace.sh: improve error reporting and usability Luca Ceresoli
2024-03-11 15:24 ` [PATCH 1/3] scripts/decode_stacktrace.sh: remove find_module recursion and improve error reporting Luca Ceresoli
2024-05-08 21:35 ` Stephen Boyd
2024-05-09 8:16 ` Luca Ceresoli
2024-03-11 15:24 ` [PATCH 2/3] scripts/decode_stacktrace.sh: clarify command line Luca Ceresoli
2024-05-08 21:37 ` Stephen Boyd
2024-03-11 15:24 ` Luca Ceresoli [this message]
2024-05-08 21:38 ` [PATCH 3/3] scripts/decode_stacktrace.sh: add '-h' flag Stephen Boyd
2024-04-22 9:42 ` [PATCH 0/3] scripts/decode_stacktrace.sh: improve error reporting and usability Luca Ceresoli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240311-decode_stacktrace-find_module-improvements-v1-3-8bea42b421aa@bootlin.com \
--to=luca.ceresoli@bootlin.com \
--cc=alexis.lothore@bootlin.com \
--cc=koct9i@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=swboyd@chromium.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox