tools/rcutorture: Make identify_qemu_vcpus() independant of local language
Subsystems (3)
Frederic Weisbecker
maintainerPATCH 1/1 tools/rcutorture: Make identify_qemu_vcpus() independant of local language
The implementation expects lscpu to have a "CPU: " line, for example:
CPU(s): 8
But some local language settings may advocate for their own version:
Processeur(s) : 8
As a result the function may return an empty string and rcutorture would dump the following warning (still with the local taste):
kvm-test-1-run.sh: ligne 138 : test: : nombre entier attendu comme expression
Just use a command whose output every language agree with.
--- tools/testing/selftests/rcutorture/bin/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rcutorture/bin/functions.sh +1 -1
@@ -232,7 +232,7 @@ identify_qemu_args () { # Returns the number of virtual CPUs available to the aggregate of the # guest OSes. identify_qemu_vcpus () { - lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://' -e 's/[ ]*//g' + getconf _NPROCESSORS_ONLN } # print_bug
Signature · 1 line
2.25.1
Paul E. McKenney
maintainerQuoted 15 lines · Frederic Weisbecker
The implementation expects
lscputo have a "CPU: " line, for example:CPU(s): 8But some local language settings may advocate for their own version:
Processeur(s) : 8As a result the function may return an empty string and rcutorture would dump the following warning (still with the local taste):
kvm-test-1-run.sh: ligne 138 : test: : nombre entier attendu comme expressionJust use a command whose output every language agree with.
Quoted 7 lines
Signed-off-by Frederic Weisbecker <[email protected]>Cc Paul E. McKenney <[email protected]>Cc Josh Triplett <[email protected]>Cc Steven Rostedt <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Lai Jiangshan <[email protected]>
Queued for review and testing, thank you! As usual, I could not resist the urge to edit a bit, so please let me know if I messed anything up.
If there are too many of these, it might be easier for kvm.sh to switch itself to EN-US mode, but this change both simplified the code and helped defend the purity of the French language, so steady as she goes! ;-)
Thanx, Paul
------------------------------------------------------------------------
commit 655f941b96cbfc6f8869142ece092d8617425948
Author: Frederic Weisbecker <[email protected]> Date: Thu Nov 19 01:30:24 2020 +0100
tools/rcutorture: Make identify_qemu_vcpus() independent of local language
The rcutorture scripts' identify_qemu_vcpus() function expects lscpu to have a "CPU: " line, for example:
CPU(s): 8
But different local language settings can give different results:
Processeur(s) : 8
As a result, identify_qemu_vcpus() may return an empty string, resulting in the following warning (with the same local language settings):
kvm-test-1-run.sh: ligne 138 : test: : nombre entier attendu comme expression
This commit therefore changes identify_qemu_vcpus() to use getconf, which produces local-language-independend output.
tools/testing/selftests/rcutorture/bin/functions.sh +1 -1
@@ -232,7 +232,7 @@ identify_qemu_args () { # Returns the number of virtual CPUs available to the aggregate of the # guest OSes. identify_qemu_vcpus () { - lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://' -e 's/[ ]*//g' + getconf _NPROCESSORS_ONLN } # print_bug
Frederic Weisbecker
maintainerQuoted 24 lines · Paul E. McKenney
Quoted 15 lines · Frederic Weisbecker
The implementation expects
lscputo have a "CPU: " line, for example:CPU(s): 8But some local language settings may advocate for their own version:
Processeur(s) : 8As a result the function may return an empty string and rcutorture would dump the following warning (still with the local taste):
kvm-test-1-run.sh: ligne 138 : test: : nombre entier attendu comme expressionJust use a command whose output every language agree with.
Quoted 7 lines
Signed-off-by Frederic Weisbecker <[email protected]>Cc Paul E. McKenney <[email protected]>Cc Josh Triplett <[email protected]>Cc Steven Rostedt <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Lai Jiangshan <[email protected]>
Quoted 6 lines
Queued for review and testing, thank you! As usual, I could not resist the urge to edit a bit, so please let me know if I messed anything up.
If there are too many of these, it might be easier for
kvm.shto switch itself to EN-US mode, but this change both simplified the code and helped defend the purity of the French language, so steady as she goes! ;-)
We aligned the stars!
Quoted 23 lines
commit
655f941b96cbfc6f8869142ece092d8617425948Author: Frederic Weisbecker <[email protected]> Date: Thu Nov 19 01:30:24 2020 +0100
tools/rcutorture: Makeidentify_qemu_vcpus()independent of local languageThe rcutorture scripts'
identify_qemu_vcpus()function expectslscputo have a "CPU: " line, for example:CPU(s): 8
But different local language settings can give different results:
Processeur(s) : 8
As a result,
identify_qemu_vcpus()may return an empty string, resulting in the following warning (with the same local language settings):
kvm-test-1-run.sh: ligne 138 : test: : nombre entier attendu comme expressionThis commit therefore changes
identify_qemu_vcpus()to use getconf, which produces local-language-independend output.
Quoted 7 lines
Signed-off-by Frederic Weisbecker <[email protected]>Cc Paul E. McKenney <[email protected]>Cc Josh Triplett <[email protected]>Cc Steven Rostedt <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Lai Jiangshan <[email protected]>
Even better, Thanks!