[PATCH 1/2] queuelat: Assume queuelat and queuelat scripts are in the path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Assume queuelat and queuelat scripts are in the path. Don't hardcode
their location.

Write the temporary data to /usr/tmp/outfile

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
 src/queuelat/determine_maximum_mpps.sh | 35 +++++++++++++-------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/queuelat/determine_maximum_mpps.sh b/src/queuelat/determine_maximum_mpps.sh
index cf7a8cab9cc4..cd45454720f7 100755
--- a/src/queuelat/determine_maximum_mpps.sh
+++ b/src/queuelat/determine_maximum_mpps.sh
@@ -8,6 +8,7 @@
 PREAMBLE="taskset -c 2 chrt -f 1"
 MAXLAT="20000"
 CYCLES_PER_PACKET="300"
+OUTFILE=/usr/tmp/outfile
 
 echo "Determining maximum mpps the machine can handle"
 echo "Will take a few minutes to determine mpps value"
@@ -16,10 +17,10 @@ echo "And 10 minutes run to confirm the final mpps value is stable"
 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
+	OUTFILE=`mktemp`
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
 
-	exceeded=`grep exceeded $outfile`
+	exceeded=`grep exceeded $OUTFILE`
 	if [ ! -z "$exceeded" ]; then
 		echo mpps failed: $mpps
 		break;
@@ -32,10 +33,10 @@ first_mpps=$(($mpps - 1))
 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
+	OUTFILE=`mktemp`
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
 
-	exceeded=`grep exceeded $outfile`
+	exceeded=`grep exceeded $OUTFILE`
 	if [ -z "$exceeded" ]; then
 		echo mpps success $mpps
 		break;
@@ -49,10 +50,10 @@ echo second loop mpps: $mpps
 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
+	OUTFILE=`mktemp`
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
 
-	exceeded=`grep exceeded $outfile`
+	exceeded=`grep exceeded $OUTFILE`
 	if [ ! -z "$exceeded" ]; then
 		echo mpps failure $mpps
 		break;
@@ -66,10 +67,10 @@ third_mpps=`echo "$mpps -0.1" | bc`
 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
+	OUTFILE=`mktemp`
+	$PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
 
-	exceeded=`grep exceeded $outfile`
+	exceeded=`grep exceeded $OUTFILE`
 	if [ -z "$exceeded" ]; then
 		echo mpps success $mpps
 		break;
@@ -86,8 +87,8 @@ 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
-		exceeded=`grep exceeded $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"
@@ -108,8 +109,8 @@ 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
-	exceeded=`grep exceeded $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
 		echo "mpps failure (run $i) $mpps"
@@ -124,5 +125,3 @@ echo Final mpps is: $mpps
 
 unset queuelat_failure
 unset mpps
-
-
-- 
2.20.1




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux