mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] torture: Select line in sed and replace grep
@ 2022-02-22 12:07 Paul Menzel
  2022-02-22 12:07 ` [PATCH 2/2] torture: Make thread detection more robust by using lspcu Paul Menzel
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Menzel @ 2022-02-22 12:07 UTC (permalink / raw)
  To: Paul E. McKenney, Josh Triplett, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan, Shuah Khan
  Cc: Paul Menzel, Zhouyi Zhou, rcu, linux-kselftest, linux-kernel

sed’s switch `-n` (`--silent`) suppresses the automatic printing of
the pattern space, therefore, allowing to replace grep by only
printing the current pattern space using the command `p`.

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
---
 tools/testing/selftests/rcutorture/bin/functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
index c35ba24f994c..5cff520955e6 100644
--- a/tools/testing/selftests/rcutorture/bin/functions.sh
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -301,7 +301,7 @@ specify_qemu_cpus () {
 			echo $2 -smp $3
 			;;
 		qemu-system-ppc64)
-			nt="`lscpu | grep '^NUMA node0' | sed -e 's/^[^,]*,\([0-9]*\),.*$/\1/'`"
+			nt="`lscpu | sed -n -e '/^NUMA node0/s/^[^,]*,\([0-9]*\),.*$/\1/p'`"
 			echo $2 -smp cores=`expr \( $3 + $nt - 1 \) / $nt`,threads=$nt
 			;;
 		esac
-- 
2.35.1


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

end of thread, other threads:[~2022-02-25 20:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 12:07 [PATCH 1/2] torture: Select line in sed and replace grep Paul Menzel
2022-02-22 12:07 ` [PATCH 2/2] torture: Make thread detection more robust by using lspcu Paul Menzel
2022-02-22 17:43   ` Paul E. McKenney
2022-02-24  8:24     ` Paul Menzel
2022-02-24 20:56       ` Paul E. McKenney
2022-02-25  5:49         ` Paul Menzel
2022-02-25 20:45           ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®