All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all native language
@ 2021-04-01 13:26 Frederic Weisbecker
  2021-04-01 18:51 ` Paul E. McKenney
  0 siblings, 1 reply; 11+ messages in thread
From: Frederic Weisbecker @ 2021-04-01 13:26 UTC (permalink / raw)
  To: Paul E . McKenney; +Cc: LKML, Frederic Weisbecker

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"

Prefer a more generic solution.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 tools/testing/selftests/rcutorture/bin/kvm-build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-05 15:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 13:26 [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all native language Frederic Weisbecker
2021-04-01 18:51 ` Paul E. McKenney
2021-04-01 20:31   ` Frederic Weisbecker
2021-04-01 20:40     ` Paul E. McKenney
2021-04-01 20:41       ` Frederic Weisbecker
2021-04-01 21:02         ` Paul E. McKenney
2021-04-01 21:08           ` Frederic Weisbecker
2021-04-01 22:33             ` Paul E. McKenney
2021-04-01 22:48               ` Frederic Weisbecker
2021-04-05 14:23               ` Christian Kujau
2021-04-05 15:25                 ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.