Skip to content

Commit 910cc95

Browse files
paulmckingomolnar
authored andcommitted
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>
1 parent b02eb5b commit 910cc95

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎tools/memory-model/scripts/parseargs.sh‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,18 @@ do
9595
LKMM_HERD_OPTIONS="$2"
9696
shift
9797
;;
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]\+$' '^--'
100110
LKMM_JOBS="$2"
101111
shift
102112
;;

0 commit comments

Comments
 (0)