Skip to content

Commit 7e10835

Browse files
lucaceresoliakpm00
authored andcommitted
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 <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Cc: Alexis Lothoré (eBPF Foundation) <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Thomas Petazzoni <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent a6d05e8 commit 7e10835

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/decode_stacktrace.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ usage() {
77
echo "Usage:"
88
echo " $0 -r <release>"
99
echo " $0 [<vmlinux> [<base_path>|auto [<modules_path>]]]"
10+
echo " $0 -h"
1011
}
1112

1213
# Try to find a Rust demangler
@@ -33,7 +34,10 @@ READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX}
3334
ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
3435
NM=${UTIL_PREFIX}nm${UTIL_SUFFIX}
3536

36-
if [[ $1 == "-r" ]] ; then
37+
if [[ $1 == "-h" ]] ; then
38+
usage
39+
exit 0
40+
elif [[ $1 == "-r" ]] ; then
3741
vmlinux=""
3842
basepath="auto"
3943
modpath=""

0 commit comments

Comments
 (0)