diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-10-04 16:15:55 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-12-03 13:11:15 -0500 |
commit | 315c540d46f8f11fe2a84e627d9473e90441ae96 (patch) | |
tree | 24544028c66196efce7dcd113a51549c04585fc5 /tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh | |
parent | 2bcdf4e31ae4e215b1e61831d9defa3632cb7bd3 (diff) |
rcutorture: Refactor to enable non-x86 architectures
This commit expands the checks for what architecture is running to generate
additional qemu-system- commands, then uses the resulting qemu-system-
command name to choose different qemu arguments as needed for different
architectures.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh')
-rwxr-xr-x | tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh index 5e2e79b5eaba..9fd546ccb075 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh | |||
@@ -115,20 +115,21 @@ QEMU="`identify_qemu $builddir/vmlinux.o`" | |||
115 | 115 | ||
116 | # Generate -smp qemu argument. | 116 | # Generate -smp qemu argument. |
117 | cpu_count=`configNR_CPUS.sh $config_template` | 117 | cpu_count=`configNR_CPUS.sh $config_template` |
118 | ncpus=`grep '^processor' /proc/cpuinfo | wc -l` | 118 | vcpus=`identify_qemu_vcpus` |
119 | if test $cpu_count -gt $ncpus | 119 | if test $cpu_count -gt $vcpus |
120 | then | 120 | then |
121 | echo CPU count limited from $cpu_count to $ncpus | 121 | echo CPU count limited from $cpu_count to $vcpus |
122 | touch $resdir/Warnings | 122 | touch $resdir/Warnings |
123 | echo CPU count limited from $cpu_count to $ncpus >> $resdir/Warnings | 123 | echo CPU count limited from $cpu_count to $vcpus >> $resdir/Warnings |
124 | cpu_count=$ncpus | 124 | cpu_count=$vcpus |
125 | fi | ||
126 | if echo $qemu_args | grep -q -e -smp | ||
127 | then | ||
128 | echo CPU count specified by caller | ||
129 | else | ||
130 | qemu_args="$qemu_args -smp $cpu_count" | ||
131 | fi | 125 | fi |
126 | qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`" | ||
127 | |||
128 | # Generate architecture-specific and interaction-specific qemu arguments | ||
129 | qemu_args="$qemu_args `identify_qemu_args "$QEMU" "$builddir/console.log"`" | ||
130 | |||
131 | # Generate qemu -append arguments | ||
132 | qemu_append="`identify_qemu_append "$QEMU"`" | ||
132 | 133 | ||
133 | # Generate CPU-hotplug boot parameters | 134 | # Generate CPU-hotplug boot parameters |
134 | boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`" | 135 | boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`" |
@@ -137,8 +138,8 @@ boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`" | |||
137 | # Pull in Kconfig-fragment boot parameters | 138 | # Pull in Kconfig-fragment boot parameters |
138 | boot_args="`configfrag_boot_params "$boot_args" "$config_template"`" | 139 | boot_args="`configfrag_boot_params "$boot_args" "$config_template"`" |
139 | 140 | ||
140 | echo $QEMU -serial file:$builddir/console.log $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"noapic selinux=0 console=ttyS0 initcall_debug debug rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args\" > $resdir/qemu-cmd | 141 | echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args\" > $resdir/qemu-cmd |
141 | $QEMU -name rcu-test -serial file:$builddir/console.log $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "noapic selinux=0 console=ttyS0 initcall_debug debug rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args" & | 142 | $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1 $boot_args" & |
142 | qemu_pid=$! | 143 | qemu_pid=$! |
143 | commandcompleted=0 | 144 | commandcompleted=0 |
144 | echo Monitoring qemu job at pid $qemu_pid | 145 | echo Monitoring qemu job at pid $qemu_pid |