]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - tools/testing/selftests/rcutorture/bin/kvm.sh
rcutorture: Add kernel-version argument
[mirror_ubuntu-hirsute-kernel.git] / tools / testing / selftests / rcutorture / bin / kvm.sh
CommitLineData
c87b9c60
PM
1#!/bin/bash
2#
3# Run a series of 14 tests under KVM. These are not particularly
4# well-selected or well-tuned, but are the current set. Run from the
5# top level of the source tree.
6#
7# Edit the definitions below to set the locations of the various directories,
8# as well as the test duration.
9#
10# Usage: sh kvm.sh [ options ]
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25#
26# Copyright (C) IBM Corporation, 2011
27#
28# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
29
30scriptname=$0
31
32dur=30
33KVM=`pwd`/tools/testing/selftests/rcutorture; export KVM
34builddir=${KVM}/b1
35resdir=""
36configs=" sysidleY.2013.06.19a \
37 sysidleN.2013.06.19a \
38 P1-S-T-NH-SD-SMP-HP \
39 P2-2-t-nh-sd-SMP-hp \
40 P3-3-T-nh-SD-SMP-hp \
41 P4-A-t-NH-sd-SMP-HP \
42 P5-U-T-NH-sd-SMP-hp \
43 P6---t-nh-SD-smp-hp \
44 N1-S-T-NH-SD-SMP-HP \
45 N2-2-t-nh-sd-SMP-hp \
46 N3-3-T-nh-SD-SMP-hp \
47 N4-A-t-NH-sd-SMP-HP \
48 N5-U-T-NH-sd-SMP-hp \
49 PT1-nh \
50 PT2-NH \
51 NT1-nh \
52 NT3-NH"
847bfd25 53ds=`date +%Y.%m.%d-%H:%M:%S`
bb918535 54kversion=""
c87b9c60
PM
55
56usage () {
57 echo "Usage: $scriptname optional arguments:"
58 echo " --builddir absolute-pathname"
59 echo " --configs \"config-file list\""
847bfd25 60 echo " --datestamp string"
c87b9c60 61 echo " --duration minutes"
bb918535 62 echo " --kversion vN.NN"
c87b9c60
PM
63 echo " --rcu-kvm absolute-pathname"
64 echo " --results absolute-pathname"
65 echo " --relbuilddir relative-pathname"
66 exit 1
67}
68
69# checkarg --argname argtype $# arg mustmatch cannotmatch
70checkarg () {
71 if test $3 -le 1
72 then
73 echo $1 needs argument $2 matching \"$5\"
74 usage
75 fi
76 if echo "$4" | grep -q -e "$5"
77 then
78 :
79 else
80 echo $1 $2 \"$4\" must match \"$5\"
81 usage
82 fi
83 if echo "$4" | grep -q -e "$6"
84 then
85 echo $1 $2 \"$4\" must not match \"$6\"
86 usage
87 fi
88}
89
90while test $# -gt 0
91do
92 echo ":$1:"
93 case "$1" in
94 --builddir)
95 checkarg --builddir "(absolute pathname)" "$#" "$2" '^/' error
96 builddir=$2
97 gotbuilddir=1
98 shift
99 ;;
100 --configs)
101 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
102 configs="$2"
103 shift
104 ;;
847bfd25
PM
105 --datestamp)
106 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
107 ds=$2
108 shift
109 ;;
c87b9c60
PM
110 --duration)
111 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' error
112 dur=$2
113 shift
114 ;;
bb918535
PM
115 --kversion)
116 checkarg --kversion "(kernel version)" $# "$2" '^v[0-9.]*$' error
117 kversion=$2
118 shift
119 ;;
c87b9c60
PM
120 --rcu-kvm)
121 checkarg --rcu-kvm "(absolute pathname)" "$#" "$2" '^/' error
122 KVM=$2; export KVM
123 if -z "$gotbuilddir"
124 then
125 builddir=${KVM}/b1
126 fi
127 if -n "$gotrelbuilddir"
128 then
129 builddir=${KVM}/${relbuilddir}
130 fi
131 shift
132 ;;
133 --relbuilddir)
134 checkarg --relbuilddir "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
135 relbuilddir=$2
136 gotrelbuilddir=1
137 builddir=${KVM}/${relbuilddir}
138 shift
139 ;;
140 --results)
141 checkarg --results "(absolute pathname)" "$#" "$2" '^/' error
142 resdir=$2
143 shift
144 ;;
145 *)
146 usage
147 ;;
148 esac
149 shift
150done
151
152echo "builddir=$builddir"
153echo "dur=$dur"
154echo "KVM=$KVM"
155echo "resdir=$resdir"
156
157PATH=${KVM}/bin:$PATH; export PATH
158CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
159
160if test -z "$resdir"
161then
162 resdir=$KVM/res
163 mkdir $resdir || :
c87b9c60 164else
847bfd25 165 mkdir -p "$resdir" || :
c87b9c60 166fi
847bfd25
PM
167mkdir $resdir/$ds
168echo Datestamp: $ds
169
c87b9c60
PM
170pwd > $resdir/$ds/testid.txt
171if test -d .git
172then
173 git status >> $resdir/$ds/testid.txt
174 git rev-parse HEAD >> $resdir/$ds/testid.txt
175fi
176builddir=$KVM/b1
177mkdir $builddir || :
178
179for CF in $configs
180do
181 rd=$resdir/$ds/$CF
182 mkdir $rd || :
183 echo Results directory: $rd
bb918535 184 kvm-test-1-rcu.sh $CONFIGFRAG/$kversion/$CF $builddir $rd $dur "-nographic" "rcutorture.test_no_idle_hz=1 rcutorture.n_barrier_cbs=4 rcutorture.verbose=1"
c87b9c60
PM
185done
186# Tracing: trace_event=rcu:rcu_nocb_grace_period,rcu:rcu_grace_period,rcu:rcu_grace_period_init,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_torture_read,rcu:rcu_invoke_callback,rcu:rcu_fqs,rcu:rcu_dyntick,rcu:rcu_unlock_preempted_task