~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/memory-model/scripts/runlitmus.sh

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/memory-model/scripts/runlitmus.sh (Architecture m68k) and /tools/memory-model/scripts/runlitmus.sh (Architecture i386)


  1 #!/bin/sh                                           1 #!/bin/sh
  2 # SPDX-License-Identifier: GPL-2.0+                 2 # SPDX-License-Identifier: GPL-2.0+
  3 #                                                   3 #
  4 # Without the -hw argument, runs a herd7 test       4 # Without the -hw argument, runs a herd7 test and outputs verification
  5 # results to a file whose name is that of the       5 # results to a file whose name is that of the specified litmus test,
  6 # but with ".out" appended.                         6 # but with ".out" appended.
  7 #                                                   7 #
  8 # If the --hw argument is specified, this scri      8 # If the --hw argument is specified, this script translates the .litmus
  9 # C-language file to the specified type of ass      9 # C-language file to the specified type of assembly and verifies that.
 10 # But in this case, litmus tests using complex     10 # But in this case, litmus tests using complex synchronization (such as
 11 # locking, RCU, and SRCU) are cheerfully ignor     11 # locking, RCU, and SRCU) are cheerfully ignored.
 12 #                                                  12 #
 13 # Either way, return the status of the herd7 c     13 # Either way, return the status of the herd7 command.
 14 #                                                  14 #
 15 # Usage:                                           15 # Usage:
 16 #       runlitmus.sh file.litmus                   16 #       runlitmus.sh file.litmus
 17 #                                                  17 #
 18 # Run this in the directory containing the mem     18 # Run this in the directory containing the memory model, specifying the
 19 # pathname of the litmus test to check.  The c     19 # pathname of the litmus test to check.  The caller is expected to have
 20 # properly set up the LKMM environment variabl     20 # properly set up the LKMM environment variables.
 21 #                                                  21 #
 22 # Copyright IBM Corporation, 2019                  22 # Copyright IBM Corporation, 2019
 23 #                                                  23 #
 24 # Author: Paul E. McKenney <paulmck@linux.ibm.c     24 # Author: Paul E. McKenney <paulmck@linux.ibm.com>
 25                                                    25 
 26 litmus=$1                                          26 litmus=$1
 27 if test -f "$litmus" -a -r "$litmus"               27 if test -f "$litmus" -a -r "$litmus"
 28 then                                               28 then
 29         :                                          29         :
 30 else                                               30 else
 31         echo ' !!! ' error: \"$litmus\" is not     31         echo ' !!! ' error: \"$litmus\" is not a readable file
 32         exit 255                                   32         exit 255
 33 fi                                                 33 fi
 34                                                    34 
 35 if test -z "$LKMM_HW_MAP_FILE" -o ! -e $LKMM_D     35 if test -z "$LKMM_HW_MAP_FILE" -o ! -e $LKMM_DESTDIR/$litmus.out
 36 then                                               36 then
 37         # LKMM run                                 37         # LKMM run
 38         herdoptions=${LKMM_HERD_OPTIONS--conf      38         herdoptions=${LKMM_HERD_OPTIONS--conf linux-kernel.cfg}
 39         echo Herd options: $herdoptions > $LKM     39         echo Herd options: $herdoptions > $LKMM_DESTDIR/$litmus.out
 40         /usr/bin/time $LKMM_TIMEOUT_CMD herd7      40         /usr/bin/time $LKMM_TIMEOUT_CMD herd7 $herdoptions $litmus >> $LKMM_DESTDIR/$litmus.out 2>&1
 41         ret=$?                                     41         ret=$?
 42         if test -z "$LKMM_HW_MAP_FILE"             42         if test -z "$LKMM_HW_MAP_FILE"
 43         then                                       43         then
 44                 exit $ret                          44                 exit $ret
 45         fi                                         45         fi
 46         echo " --- " Automatically generated L     46         echo " --- " Automatically generated LKMM output for '"'--hw $LKMM_HW_MAP_FILE'"' run
 47 fi                                                 47 fi
 48                                                    48 
 49 # Hardware run                                     49 # Hardware run
 50                                                    50 
 51 T=/tmp/checklitmushw.sh.$$                         51 T=/tmp/checklitmushw.sh.$$
 52 trap 'rm -rf $T' 0 2                               52 trap 'rm -rf $T' 0 2
 53 mkdir $T                                           53 mkdir $T
 54                                                    54 
 55 # Generate filenames                               55 # Generate filenames
 56 mapfile="Linux2${LKMM_HW_MAP_FILE}.map"            56 mapfile="Linux2${LKMM_HW_MAP_FILE}.map"
 57 themefile="$T/${LKMM_HW_MAP_FILE}.theme"           57 themefile="$T/${LKMM_HW_MAP_FILE}.theme"
 58 herdoptions="-model $LKMM_HW_CAT_FILE"             58 herdoptions="-model $LKMM_HW_CAT_FILE"
 59 hwlitmus=`echo $litmus | sed -e 's/\.litmus$/.     59 hwlitmus=`echo $litmus | sed -e 's/\.litmus$/.litmus.'${LKMM_HW_MAP_FILE}'/'`
 60 hwlitmusfile=`echo $hwlitmus | sed -e 's,^.*/,     60 hwlitmusfile=`echo $hwlitmus | sed -e 's,^.*/,,'`
 61                                                    61 
 62 # Don't run on litmus tests with complex synch     62 # Don't run on litmus tests with complex synchronization
 63 if ! scripts/simpletest.sh $litmus                 63 if ! scripts/simpletest.sh $litmus
 64 then                                               64 then
 65         echo ' --- ' error: \"$litmus\" contai     65         echo ' --- ' error: \"$litmus\" contains locking, RCU, or SRCU
 66         exit 254                                   66         exit 254
 67 fi                                                 67 fi
 68                                                    68 
 69 # Generate the assembly code and run herd7 on      69 # Generate the assembly code and run herd7 on it.
 70 gen_theme7 -n 10 -map $mapfile -call Linux.cal     70 gen_theme7 -n 10 -map $mapfile -call Linux.call > $themefile
 71 jingle7 -v -theme $themefile $litmus > $LKMM_D     71 jingle7 -v -theme $themefile $litmus > $LKMM_DESTDIR/$hwlitmus 2> $T/$hwlitmusfile.jingle7.out
 72 if grep -q "Generated 0 tests" $T/$hwlitmusfil     72 if grep -q "Generated 0 tests" $T/$hwlitmusfile.jingle7.out
 73 then                                               73 then
 74         echo ' !!! ' jingle7 failed, errors in     74         echo ' !!! ' jingle7 failed, errors in $hwlitmus.err
 75         cp $T/$hwlitmusfile.jingle7.out $LKMM_     75         cp $T/$hwlitmusfile.jingle7.out $LKMM_DESTDIR/$hwlitmus.err
 76         exit 253                                   76         exit 253
 77 fi                                                 77 fi
 78 /usr/bin/time $LKMM_TIMEOUT_CMD herd7 -unroll      78 /usr/bin/time $LKMM_TIMEOUT_CMD herd7 -unroll 0 $LKMM_DESTDIR/$hwlitmus > $LKMM_DESTDIR/$hwlitmus.out 2>&1
 79                                                    79 
 80 exit $?                                            80 exit $?
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php