aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/kvm-build.sh
diff options
context:
space:
mode:
authorFrederic Weisbecker <frederic@kernel.org>2021-04-01 15:26:02 +0200
committerPaul E. McKenney <paulmck@kernel.org>2021-05-10 16:05:06 -0700
commitf8c8484dbda78e09912a391a8c87414920bbdfee (patch)
treebb97d4fc437cecbe2a11c7ab5078f599a90e63ba /tools/testing/selftests/rcutorture/bin/kvm-build.sh
parentrcutorture: Judge RCU priority boosting on grace periods, not callbacks (diff)
downloadlinux-dev-f8c8484dbda78e09912a391a8c87414920bbdfee.tar.xz
linux-dev-f8c8484dbda78e09912a391a8c87414920bbdfee.zip
torture: Correctly fetch number of CPUs for non-English languages
Grepping for "CPU" on lscpu output isn't always successful, depending on the local language setting. As a result, the build can be aborted early with: "make: the '-j' option requires a positive integer argument" This commit therefore uses the human-language-independent approach available via the getconf command, both in kvm-build.sh and in kvm-remote.sh. Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin/kvm-build.sh')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-build.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 55f4fc102624..5ad973dca820 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -42,7 +42,7 @@ then
fi
# Tell "make" to use double the number of real CPUs on the build system.
-ncpus="`lscpu | grep '^CPU(' | awk '{ print $2 }'`"
+ncpus="`getconf _NPROCESSORS_ONLN`"
make -j$((2 * ncpus)) $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
retval=$?
if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $resdir/Make.out