summaryrefslogtreecommitdiffstats
path: root/scripts/decode_stacktrace.sh
diff options
context:
space:
mode:
authorLuca Ceresoli <luca.ceresoli@bootlin.com>2024-08-23 10:27:44 +0200
committerAndrew Morton <akpm@linux-foundation.org>2024-09-01 20:43:41 -0700
commit7e1083598909f0fda82a0bf8cf788524ce4fccff (patch)
treeca3ca89aad9b50bf94150d84ebee233ca4786a69 /scripts/decode_stacktrace.sh
parenta6d05e826d48cdffe11d9b73cf386840c19129d4 (diff)
downloadlinux-7e1083598909f0fda82a0bf8cf788524ce4fccff.tar.gz
linux-7e1083598909f0fda82a0bf8cf788524ce4fccff.tar.bz2
linux-7e1083598909f0fda82a0bf8cf788524ce4fccff.zip
scripts/decode_stacktrace.sh: add '-h' flag
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. Link: https://lkml.kernel.org/r/20240823-decode_stacktrace-find_module-improvements-v2-3-d7a57d35558b@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Cc: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Sasha Levin <sashal@kernel.org> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts/decode_stacktrace.sh')
-rwxr-xr-xscripts/decode_stacktrace.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
index bac7ea8ee24f..826836d264c6 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
@@ -33,7 +34,10 @@ READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX}
ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
NM=${UTIL_PREFIX}nm${UTIL_SUFFIX}
-if [[ $1 == "-r" ]] ; then
+if [[ $1 == "-h" ]] ; then
+ usage
+ exit 0
+elif [[ $1 == "-r" ]] ; then
vmlinux=""
basepath="auto"
modpath=""