Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/memory-model: Make scripts take "-j" abbreviation for "--jobs"

The "--jobs" argument to the litmus-test scripts is similar to the "-jN"
argument to "make", so this commit allows the "-jN" form as well. While
in the area, it also prohibits the various forms of "-j0".

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: akiyks@gmail.com
Cc: boqun.feng@gmail.com
Cc: dhowells@redhat.com
Cc: j.alglave@ucl.ac.uk
Cc: linux-arch@vger.kernel.org
Cc: luc.maranget@inria.fr
Cc: npiggin@gmail.com
Cc: parri.andrea@gmail.com
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/20181203230451.28921-3-paulmck@linux.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Paul E. McKenney and committed by
Ingo Molnar
910cc959 b02eb5b0

+12 -2
+12 -2
tools/memory-model/scripts/parseargs.sh
··· 95 95 LKMM_HERD_OPTIONS="$2" 96 96 shift 97 97 ;; 98 - --jobs|--job) 99 - checkarg --jobs "(number)" "$#" "$2" '^[0-9]\+$' '^--' 98 + -j[1-9]*) 99 + njobs="`echo $1 | sed -e 's/^-j//'`" 100 + trailchars="`echo $njobs | sed -e 's/[0-9]\+\(.*\)$/\1/'`" 101 + if test -n "$trailchars" 102 + then 103 + echo $1 trailing characters "'$trailchars'" 104 + usagehelp 105 + fi 106 + LKMM_JOBS="`echo $njobs | sed -e 's/^\([0-9]\+\).*$/\1/'`" 107 + ;; 108 + --jobs|--job|-j) 109 + checkarg --jobs "(number)" "$#" "$2" '^[1-9][0-9]\+$' '^--' 100 110 LKMM_JOBS="$2" 101 111 shift 102 112 ;;