tools/memory-model: Update parseargs.sh for hardware verification
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 19 Mar 2019 22:59:26 +0000 (15:59 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 24 Mar 2023 17:24:13 +0000 (10:24 -0700)
This commit adds a --hw argument to parseargs.sh to specify the CPU
family for a hardware verification.  For example, "--hw AArch64" will
specify that a C-language litmus test is to be translated to ARMv8 and
the result verified.  This will set the LKMM_HW_MAP_FILE environment
variable accordingly.  If there is no --hw argument, this environment
variable will be set to the empty string.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/memory-model/scripts/parseargs.sh

index afe7bd2..5f016fc 100755 (executable)
@@ -27,6 +27,7 @@ initparam () {
 
 initparam LKMM_DESTDIR "."
 initparam LKMM_HERD_OPTIONS "-conf linux-kernel.cfg"
+initparam LKMM_HW_MAP_FILE ""
 initparam LKMM_JOBS `getconf _NPROCESSORS_ONLN`
 initparam LKMM_PROCS "3"
 initparam LKMM_TIMEOUT "1m"
@@ -37,10 +38,11 @@ usagehelp () {
        echo "Usage $scriptname [ arguments ]"
        echo "      --destdir path (place for .litmus.out, default by .litmus)"
        echo "      --herdopts -conf linux-kernel.cfg ..."
+       echo "      --hw AArch64"
        echo "      --jobs N (number of jobs, default one per CPU)"
        echo "      --procs N (litmus tests with at most this many processes)"
        echo "      --timeout N (herd7 timeout (e.g., 10s, 1m, 2hr, 1d, '')"
-       echo "Defaults: --destdir '$LKMM_DESTDIR_DEF' --herdopts '$LKMM_HERD_OPTIONS_DEF' --jobs '$LKMM_JOBS_DEF' --procs '$LKMM_PROCS_DEF' --timeout '$LKMM_TIMEOUT_DEF'"
+       echo "Defaults: --destdir '$LKMM_DESTDIR_DEF' --herdopts '$LKMM_HERD_OPTIONS_DEF' --hw '$LKMM_HW_MAP_FILE' --jobs '$LKMM_JOBS_DEF' --procs '$LKMM_PROCS_DEF' --timeout '$LKMM_TIMEOUT_DEF'"
        exit 1
 }
 
@@ -95,6 +97,11 @@ do
                LKMM_HERD_OPTIONS="$2"
                shift
                ;;
+       --hw)
+               checkarg --hw "(.map file architecture name)" "$#" "$2" '^[A-Za-z0-9_-]\+' '^--'
+               LKMM_HW_MAP_FILE="$2"
+               shift
+               ;;
        -j[1-9]*)
                njobs="`echo $1 | sed -e 's/^-j//'`"
                trailchars="`echo $njobs | sed -e 's/[0-9]\+\(.*\)$/\1/'`"