cleanup: add correct error messages to lttng-get-syscall-inout.sh
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 8 May 2024 19:46:23 +0000 (15:46 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 6 Jun 2024 20:32:58 +0000 (16:32 -0400)
The script argument parsing was modified in
commit 6ae73da43362 ("Fix syscall generator scripts") without adjusting
the error messages and comments.

Report the proper errors for the current arguments.

Change-Id: I86f4d16ffede1a6a48bc6ab5fe1e678ef340585b
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tools/syscalls/lttng-get-syscall-inout.sh

index 1cf963944655e3a9b99f77551dd5a22f9712c22d..e4c55e9dfabcba6b6657247d800d4c0af669d208 100755 (executable)
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
 
 # example usage:
-# lttng-get-syscall-inout.sh table-syscall-inout.txt select 1
+# lttng-get-syscall-inout.sh arm-64 select 5 1
 
 ARCH_NAME=$1
 SYSCALL_NAME=$2
@@ -14,18 +14,23 @@ GENERIC_INOUT_DESCRIPTION_FILE="$(dirname "$0")/table-syscall-inout.txt"
 # Delete temp file on exit
 trap 'rm -f "$TMPFILE"' EXIT
 
-if [ "${GENERIC_INOUT_DESCRIPTION_FILE}" = "" ]; then
-       echo "Error: Please specify input file name as first argument" >&2
+if [ "${ARCH_NAME}" = "" ]; then
+       echo "Error: Please specify the arch name as first argument" >&2
        exit 1
 fi
 
 if [ "${SYSCALL_NAME}" = "" ]; then
-       echo "Error: Please specify system call name as second argument" >&2
+       echo "Error: Please specify the system call name as second argument" >&2
+       exit 1
+fi
+
+if [[ "${NB_ARGS}" = "" ]]; then
+       echo "Error: Please specify a number of arguments as third argument" >&2
        exit 1
 fi
 
 if [[ "${ARG_NR}" = "" || ${ARG_NR} == 0 ]]; then
-       echo "Error: Please specify argument number larger than 0 as third argument" >&2
+       echo "Error: Please specify an argument number larger than 0 as fourth argument" >&2
        exit 1
 fi
 
This page took 0.027044 seconds and 4 git commands to generate.