aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-10-04 13:15:55 -0700
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-12-03 10:11:15 -0800
commit315c540d46f8f11fe2a84e627d9473e90441ae96 (patch)
tree24544028c66196efce7dcd113a51549c04585fc5 /tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
parentrcutorture: Eliminate --rcu-kvm argument (diff)
downloadlinux-dev-315c540d46f8f11fe2a84e627d9473e90441ae96.tar.xz
linux-dev-315c540d46f8f11fe2a84e627d9473e90441ae96.zip
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-xtools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh27
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`"
# Generate -smp qemu argument.
cpu_count=`configNR_CPUS.sh $config_template`
-ncpus=`grep '^processor' /proc/cpuinfo | wc -l`
-if test $cpu_count -gt $ncpus
+vcpus=`identify_qemu_vcpus`
+if test $cpu_count -gt $vcpus
then
- echo CPU count limited from $cpu_count to $ncpus
+ echo CPU count limited from $cpu_count to $vcpus
touch $resdir/Warnings
- echo CPU count limited from $cpu_count to $ncpus >> $resdir/Warnings
- cpu_count=$ncpus
-fi
-if echo $qemu_args | grep -q -e -smp
-then
- echo CPU count specified by caller
-else
- qemu_args="$qemu_args -smp $cpu_count"
+ echo CPU count limited from $cpu_count to $vcpus >> $resdir/Warnings
+ cpu_count=$vcpus
fi
+qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`"
+
+# Generate architecture-specific and interaction-specific qemu arguments
+qemu_args="$qemu_args `identify_qemu_args "$QEMU" "$builddir/console.log"`"
+
+# Generate qemu -append arguments
+qemu_append="`identify_qemu_append "$QEMU"`"
# Generate CPU-hotplug boot parameters
boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`"
@@ -137,8 +138,8 @@ boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`"
# Pull in Kconfig-fragment boot parameters
boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
-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
-$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" &
+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
+$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" &
qemu_pid=$!
commandcompleted=0
echo Monitoring qemu job at pid $qemu_pid