[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1384562141-32446-28-git-send-email-paulmck@linux.vnet.ibm.com>
Date: Fri, 15 Nov 2013 16:35:41 -0800
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: mingo@...nel.org, laijs@...fujitsu.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
peterz@...radead.org, rostedt@...dmis.org, dhowells@...hat.com,
edumazet@...gle.com, darren@...art.com, fweisbec@...il.com,
sbw@....edu, "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Greg KH <gregkh@...uxfoundation.org>
Subject: [PATCH tip/core/rcu 28/28] rcutorture: Move checkarg to functions.sh
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Greg KH <gregkh@...uxfoundation.org>
---
.../testing/selftests/rcutorture/bin/functions.sh | 24 +++++++++++++++++++++
tools/testing/selftests/rcutorture/bin/kvm.sh | 25 +++-------------------
2 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index 963b6f04d4ef..3052f1bea6bf 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -28,6 +28,30 @@ bootparam_hotplug_cpu () {
echo "$1" | grep -q "rcutorture\.onoff_"
}
+# checkarg --argname argtype $# arg mustmatch cannotmatch
+#
+# Checks the specified argument "arg" against the mustmatch and cannotmatch
+# patterns.
+checkarg () {
+ if test $3 -le 1
+ then
+ echo $1 needs argument $2 matching \"$5\"
+ usage
+ fi
+ if echo "$4" | grep -q -e "$5"
+ then
+ :
+ else
+ echo $1 $2 \"$4\" must match \"$5\"
+ usage
+ fi
+ if echo "$4" | grep -q -e "$6"
+ then
+ echo $1 $2 \"$4\" must not match \"$6\"
+ usage
+ fi
+}
+
# configfrag_boot_params bootparam-string config-fragment-file
#
# Adds boot parameters from the .boot file, if any.
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 0783ec9c583e..7ba375ebe396 100644
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -32,6 +32,7 @@ args="$*"
dur=30
KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
+PATH=${KVM}/bin:$PATH; export PATH
builddir="${KVM}/b1"
RCU_INITRD="$KVM/initrd"; export RCU_INITRD
RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
@@ -40,6 +41,8 @@ configs=""
ds=`date +%Y.%m.%d-%H:%M:%S`
kversion=""
+. functions.sh
+
usage () {
echo "Usage: $scriptname optional arguments:"
echo " --bootargs kernel-boot-arguments"
@@ -60,27 +63,6 @@ usage () {
exit 1
}
-# checkarg --argname argtype $# arg mustmatch cannotmatch
-checkarg () {
- if test $3 -le 1
- then
- echo $1 needs argument $2 matching \"$5\"
- usage
- fi
- if echo "$4" | grep -q -e "$5"
- then
- :
- else
- echo $1 $2 \"$4\" must match \"$5\"
- usage
- fi
- if echo "$4" | grep -q -e "$6"
- then
- echo $1 $2 \"$4\" must not match \"$6\"
- usage
- fi
-}
-
while test $# -gt 0
do
case "$1" in
@@ -164,7 +146,6 @@ do
shift
done
-PATH=${KVM}/bin:$PATH; export PATH
CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists