Skip to contentSkip to conversation

scripts/decode_stacktrace.sh update usage to show vmlinux is mandatory

PATCH In review Jinchao Wang 2 participants 3 messages Jan 12 – Jan 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/decode_stacktrace.sh update usage to show vmlinux is mandatory

The script currently errors out if vmlinux is not provided, but the usage string implies it is optional. Remove the square brackets to correctly indicate that <vmlinux> is a required argument.

---
 scripts/decode_stacktrace.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/decode_stacktrace.sh +1 -1
index 8d01b741de62..83478a42d749 100755
@@ -6,7 +6,7 @@
 usage() {
 	echo "Usage:"
 	echo "	$0 -r <release>"
-	echo "	$0 [<vmlinux> [<base_path>|auto [<modules_path>]]]"
+	echo "	$0 <vmlinux> [<base_path>|auto [<modules_path>]]"
 	echo "	$0 -h"
 }
 
Signature · 1 line
2.43.0
#1 lore raw

Hello Jinchao,

Quoted 5 lines · Jinchao Wang

The script currently errors out if vmlinux is not provided, but the usage string implies it is optional. Remove the square brackets to correctly indicate that <vmlinux> is a required argument.

Thanks for your patch, but it is not correct.

The vmlinux argument is optional when debuginfod info is found:

# Can we use debuginfod-find?
if type debuginfod-find >/dev/null 2>&1 ; then
debuginfod=${1-only}
fi

if [[ $vmlinux == "" && -z $debuginfod ]] ; then
echo "ERROR! vmlinux image must be specified" >&2 usage
exit 1
fi

(https://elixir.bootlin.com/linux/v6.19-rc4/source/scripts/decode_stacktrace.sh#L65-L74)

However I realize improving the error message might make sense, something like:

echo "ERROR! vmlinux image must be specified or debuginfo must be accessible" >&2

Best regards,
Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#2 lore raw
Quoted 24 lines · Luca Ceresoli

Hello Jinchao,

Quoted 5 lines · Jinchao Wang

The script currently errors out if vmlinux is not provided, but the usage string implies it is optional. Remove the square brackets to correctly indicate that <vmlinux> is a required argument.

Thanks for your patch, but it is not correct.

The vmlinux argument is optional when debuginfod info is found:

# Can we use debuginfod-find?
if type debuginfod-find >/dev/null 2>&1 ; then
debuginfod=${1-only}
fi

if [[ $vmlinux == "" && -z $debuginfod ]] ; then
echo "ERROR! vmlinux image must be specified" >&2 usage
exit 1
fi

Quoted 6 lines

(https://elixir.bootlin.com/linux/v6.19-rc4/source/scripts/decode_stacktrace.sh#L65-L74)

However I realize improving the error message might make sense, something like:

echo "ERROR! vmlinux image must be specified or debuginfo must be accessible" >&2

Thanks for the feedback. That sounds reasonable to me.

Quoted 8 lines

Best regards,
Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com