linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] rt-tests: queuelat: Fix some warnings in determine_maximum_mpps.sh
@ 2019-11-25 14:16 John Kacur
  2019-11-25 14:16 ` [PATCH 2/8] rt-tests: ssdd: Add short and long functions as well as help John Kacur
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: John Kacur @ 2019-11-25 14:16 UTC (permalink / raw)
  To: rt-users; +Cc: Clark Williams, John Kacur

Coverity advises to quote some values to prevent word splitting and to
export variables separately after declaraing them to avoid masking
errors.

Fix these warnings

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/queuelat/determine_maximum_mpps.sh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/queuelat/determine_maximum_mpps.sh b/src/queuelat/determine_maximum_mpps.sh
index cd45454720f7..3acd6ba2e362 100755
--- a/src/queuelat/determine_maximum_mpps.sh
+++ b/src/queuelat/determine_maximum_mpps.sh
@@ -18,7 +18,7 @@ for mpps in `seq 3 3 50`; do
 	echo testing $mpps Mpps
 
 	OUTFILE=`mktemp`
-	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE
 
 	exceeded=`grep exceeded $OUTFILE`
 	if [ ! -z "$exceeded" ]; then
@@ -34,7 +34,7 @@ for mpps in `seq $first_mpps -1 3`; do
 	echo testing $mpps Mpps
 
 	OUTFILE=`mktemp`
-	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE
 
 	exceeded=`grep exceeded $OUTFILE`
 	if [ -z "$exceeded" ]; then
@@ -51,7 +51,7 @@ for mpps in `seq $second_mpps 0.3 $first_mpps`; do
 	echo testing $mpps Mpps
 
 	OUTFILE=`mktemp`
-	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE
 
 	exceeded=`grep exceeded $OUTFILE`
 	if [ ! -z "$exceeded" ]; then
@@ -68,7 +68,7 @@ for mpps in `seq $third_mpps -0.1 3`; do
 	echo testing $mpps Mpps
 
 	OUTFILE=`mktemp`
-	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE
 
 	exceeded=`grep exceeded $OUTFILE`
 	if [ -z "$exceeded" ]; then
@@ -87,13 +87,14 @@ while [ $queuelat_failure == 1 ]; do
 	echo "$mpps Mpps"
 
 	for i in `seq 1 10`; do 
-		$PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
+		$PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE
 		exceeded=`grep exceeded $OUTFILE`
 
 		if [ ! -z "$exceeded" ]; then
 			echo "mpps failure (run $i) $mpps"
 			export queuelat_failure=1
-			export mpps=`echo $mpps - 0.1 | bc`
+			mpps=`echo $mpps - 0.1 | bc`
+			export mpps
 			break
 		fi
 		echo "run $i success"
@@ -109,7 +110,7 @@ while [ $queuelat_failure == 1 ]; do
 	echo -n "Starting 10 minutes run with "
 	echo "$mpps Mpps"
 
-	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p $mpps -t 600 > $OUTFILE
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p "$mpps" -t 600 > $OUTFILE
 	exceeded=`grep exceeded $OUTFILE`
 
 	if [ ! -z "$exceeded" ]; then
-- 
2.20.1


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

end of thread, other threads:[~2019-11-25 14:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 14:16 [PATCH 1/8] rt-tests: queuelat: Fix some warnings in determine_maximum_mpps.sh John Kacur
2019-11-25 14:16 ` [PATCH 2/8] rt-tests: ssdd: Add short and long functions as well as help John Kacur
2019-11-25 14:16 ` [PATCH 5/8] rt-tests: cyclictest: Get a snapshot of cyclictest without interuppting it John Kacur
2019-11-25 14:16 ` [PATCH 6/8] cyclictest: Sync manpage with the help option John Kacur
2019-11-25 14:16 ` [PATCH 7/8] svsematest: Add -S, --smp option to manpage John Kacur
2019-11-25 14:16 ` [PATCH 8/8] rt-tests: Add SPDX tags John Kacur
2019-11-25 14:33   ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).