From a16d513016dad678bb3baa30a967033890bb0c37 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 8 May 2024 15:46:23 -0400 Subject: [PATCH] cleanup: add correct error messages to lttng-get-syscall-inout.sh 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 Signed-off-by: Mathieu Desnoyers --- tools/syscalls/lttng-get-syscall-inout.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/syscalls/lttng-get-syscall-inout.sh b/tools/syscalls/lttng-get-syscall-inout.sh index 1cf96394..e4c55e9d 100755 --- a/tools/syscalls/lttng-get-syscall-inout.sh +++ b/tools/syscalls/lttng-get-syscall-inout.sh @@ -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 -- 2.34.1