linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] rt-tests: Miscellaneous fixes
@ 2020-01-23 20:50 John Kacur
  2020-01-23 20:50 ` [PATCH 1/9] rt-tests: queuelat: Assume queuelat is in the path John Kacur
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

Most of the fixes here are just clean-ups to make sure that online help
or usage message match the man pages according to the current options.

Some fixes to the queuelat scripts determine_maximum_mpps.sh and
get_cpuinfo_mhz.sh are perhaps notable though, as people were having
trouble using them.

getcpuinfo_mhz.sh now only gets one value as was originally intended,
and it gets the highest value available. The fixes to quoting in
determine_maximum_mpps.sh should make the program work correctly now -
and take longer though.

John Kacur (9):
  rt-tests: queuelat: Assume queuelat is in the path
  rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline
  rt-tests: pi_stress: Add short options to usage message
  rt-tests: pi_stress: Sync man page with help
  rt-tests: queuelat: get_cpuinfo_mhz.sh highest value
  rt-tests: determine_maximum_mpps.sh: Fix quoting and other shell issue
  rt-tests: ptsematest: Update man page and add -h option
  rt-tests: queuelat: Fixes to man page and display_help
  rt-tests: svsematest: Display help with an error message for -h

 Makefile                               |  1 +
 src/pi_tests/pi_stress.8               |  9 ++--
 src/pi_tests/pi_stress.c               | 34 ++++++------
 src/ptsematest/ptsematest.8            |  3 ++
 src/ptsematest/ptsematest.c            | 10 ++--
 src/queuelat/determine_maximum_mpps.sh | 75 +++++++++++++-------------
 src/queuelat/get_cpuinfo_mhz.sh        |  5 +-
 src/queuelat/queuelat.8                |  4 +-
 src/queuelat/queuelat.c                | 22 ++++----
 src/sched_deadline/cyclicdeadline.8    | 53 ++++++++++++++++++
 src/svsematest/svsematest.c            |  3 +-
 11 files changed, 141 insertions(+), 78 deletions(-)
 create mode 100644 src/sched_deadline/cyclicdeadline.8

-- 
2.20.1


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

* [PATCH 1/9] rt-tests: queuelat: Assume queuelat is in the path
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-23 20:50 ` [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline John Kacur
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

The script determine_maximum_mpps.sh in queuelat hard codes the path to
queuelat. Assume that it is in the path.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/queuelat/determine_maximum_mpps.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/queuelat/determine_maximum_mpps.sh b/src/queuelat/determine_maximum_mpps.sh
index 52d54c0f9065..f6cf1dea27cf 100755
--- a/src/queuelat/determine_maximum_mpps.sh
+++ b/src/queuelat/determine_maximum_mpps.sh
@@ -90,7 +90,7 @@ 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
-- 
2.20.1


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

* [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
  2020-01-23 20:50 ` [PATCH 1/9] rt-tests: queuelat: Assume queuelat is in the path John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-27 10:44   ` Kurt Kanzenbach
  2020-01-23 20:50 ` [PATCH 3/9] rt-tests: pi_stress: Add short options to usage message John Kacur
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

- Add a simple manpage for cyclicdeadline
- Install it from the Makefile

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 Makefile                            |  1 +
 src/sched_deadline/cyclicdeadline.8 | 53 +++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 src/sched_deadline/cyclicdeadline.8

diff --git a/Makefile b/Makefile
index 552b3fe885cc..e2142ba3f4e9 100644
--- a/Makefile
+++ b/Makefile
@@ -193,6 +193,7 @@ install: all install_hwlatdetect
 	gzip -c src/queuelat/queuelat.8 >"$(DESTDIR)$(mandir)/man8/queuelat.8.gz"
 	gzip -c src/sched_deadline/deadline_test.8 >"$(DESTDIR)$(mandir)/man8/deadline_test.8.gz"
 	gzip -c src/ssdd/ssdd.8 >"$(DESTDIR)$(mandir)/man8/ssdd.8.gz"
+	gzip -c src/sched_deadline/cyclicdeadline.8 >"$(DESTDIR)$(mandir)/man8/cyclicdeadline.8.gz"
 
 .PHONY: install_hwlatdetect
 install_hwlatdetect: hwlatdetect
diff --git a/src/sched_deadline/cyclicdeadline.8 b/src/sched_deadline/cyclicdeadline.8
new file mode 100644
index 000000000000..91766fb391c4
--- /dev/null
+++ b/src/sched_deadline/cyclicdeadline.8
@@ -0,0 +1,53 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.TH CYCLICDEADLINE 8 "January 16, 2020"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+cyclicdeadline \- This program is used to test the deadline scheduler (SCHED_DEADLINE) using a cyclictest style program
+.PP
+.SH SYNOPSIS
+.B cyclicdeadline
+.RI "[-ha] [-c cpulist] [-i interval] [-s step] [-t nr_threads] [-D duration]
+.PP
+.SH DESCRIPTION
+.B cyclicdeadline
+is a cyclictest style program for testing the deadline scheduler
+.PP
+.SH OPTIONS
+.TP
+.B \-h
+Show this help menu
+.TP
+.B \-a
+Use all CPUs
+.TP
+.B \-c cpulist
+Comma / hypen separated list of CPUs to run deadline tasks on
+.TP
+.B \-i interval
+The shortest deadline for the tasks in us. (default 1000us)
+.TP
+.B \-s step
+The amount to increase the deadline for each task in us. (default 500us)
+.TP
+.B \-t nr_threads
+The number of threads to run as deadline (default 1)
+.TP
+.B \-D time
+Specify a length for the test to run
+.br
+Append 'm', 'h', or 'd' to specify minutes, hours, or days
+.SH AUTHOR
+cyclicdeadline was written by Steven Rostedt <rostedt@goodmis.org>
+.PP
+This manual page was written by John Kacur <jkacur@redhat.com>
-- 
2.20.1


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

* [PATCH 3/9] rt-tests: pi_stress: Add short options to usage message
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
  2020-01-23 20:50 ` [PATCH 1/9] rt-tests: queuelat: Assume queuelat is in the path John Kacur
  2020-01-23 20:50 ` [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-23 20:50 ` [PATCH 4/9] rt-tests: pi_stress: Sync man page with help John Kacur
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

Add short options to usage message. Note, the options all ready exist,
they simply were not documented in the usage message.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/pi_tests/pi_stress.c | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index 7fa98dfb9ad4..0ed844c636cd 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -1008,29 +1008,25 @@ void *high_priority(void *arg)
 
 void usage(void)
 {
-	printf("usage: pi_stress <options>\n");
-	printf("    options:\n");
-	printf("\t--verbose\t- lots of output\n");
-	printf("\t--quiet\t\t- suppress running output\n");
-	printf
-	    ("\t--duration=<n>\t- length of the test run in seconds [infinite]\n");
-	printf("\t\t\t  Append 'm', 'h', or 'd' to specify minutes, hours or days.\n");
-	printf("\t--groups=<n>\t- set the number of inversion groups [%d]\n",
+	printf("usage: pi_stress <options>\n\n");
+	printf("-v\t--verbose\t- lots of output\n");
+	printf("-q\t--quiet\t\t- suppress running output\n");
+	printf ("-D TIME\t--duration=TIME\n\t\t\t- length of test run in seconds (default is infinite)\n");
+	printf("\t\t\t  Append 'm', 'h', or 'd'\n\t\t\t  to specify minutes, hours or days.\n");
+	printf("-g\t--groups=<n>\t- set the number of inversion groups [%d]\n",
 	       ngroups);
-	printf
-	    ("\t--inversions=<n>- number of inversions per group [infinite]\n");
-	printf("\t--rr\t\t- use SCHED_RR for test threads [SCHED_FIFO]\n");
-	printf("\t--sched\t\t- scheduling options per thread type:\n");
+	printf ("-i INVERSIONS\t\t--inversions=INVERSIONS\n\t\t\t  number of inversions per group (default is infinite)\n");
+	printf("-r\t--rr\t\t- use SCHED_RR for test threads [SCHED_FIFO]\n");
+	printf("-s SCHED_OPTS\t--sched\t\t- scheduling options per thread type:\n");
 	printf("\t\tid=[high|med|low]\t\t\t- select thread\n");
 	printf("\t\t,policy=[fifo,rr],priority=<n>\t\t- SCHED_FIFO or SCHED_RR\n");
 	printf("\t\t,policy=deadline,runtime=<n>,deadline=<n>,period=<n>\t- SCHED_DEADLINE\n");
-	printf("\t--prompt\t- prompt before starting the test\n");
-	printf
-	    ("\t--uniprocessor\t- force all threads to run on one processor\n");
-	printf("\t--mlockall\t- lock current and future memory\n");
-	printf("\t--debug\t\t- turn on debug prints\n");
-	printf("\t--version\t- print version number on output\n");
-	printf("\t--help\t\t- print this message\n");
+	printf("-p\t--prompt\t- prompt before starting the test\n");
+	printf ("-u\t--uniprocessor\t- force all threads to run on one processor\n");
+	printf("-m\t--mlockall\t- lock current and future memory\n");
+	printf("-d\t--debug\t\t- turn on debug prints\n");
+	printf("-V\t--version\t- print version number on output\n");
+	printf("-h\t--help\t\t- print this message\n");
 }
 
 /* block all signals (called from main) */
-- 
2.20.1


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

* [PATCH 4/9] rt-tests: pi_stress: Sync man page with help
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
                   ` (2 preceding siblings ...)
  2020-01-23 20:50 ` [PATCH 3/9] rt-tests: pi_stress: Add short options to usage message John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-23 20:50 ` [PATCH 5/9] rt-tests: queuelat: get_cpuinfo_mhz.sh highest value John Kacur
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

Sync the man page with help.
Specifically, remove the signal option which is not supported and
document the sched option

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/pi_tests/pi_stress.8 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/pi_tests/pi_stress.8 b/src/pi_tests/pi_stress.8
index 475d3c34f135..5e2af6189ca1 100644
--- a/src/pi_tests/pi_stress.8
+++ b/src/pi_tests/pi_stress.8
@@ -21,7 +21,8 @@ pi_stress \- a stress test for POSIX Priority Inheritance mutexes
 .IR groups
 .RB [ \-d|\-\-debug ]
 .RB [ \-v|\-\-verbose ]
-.RB [ \-s|\-\-signal ]
+.RB [ \-s|\-\-sched
+.IR sched_opts ]
 .RB [ \-r|\-\-rr ]
 .RB [ \-p|\-\-prompt ]
 .RB [ \-m|\-\-mlockall ]
@@ -63,12 +64,12 @@ Specify a length for the test run.
 Append 'm', 'h', or 'd' to specify minutes, hours or days.
 .IP \-v|\-\-verbose
 Run with verbose messages
-.IP \-s|\-\-signal
-Terminate on receipt of SIGTERM (Ctrl-C). Default is to terminate on
-any keypress.
 .IP \-r|\-\-rr
 Run inversion group threads as SCHED_RR (round-robin). The default is
 to run the inversion threads as SCHED_FIFO.
+.IP \-s|\-\-sched
+scheduling options per thread type:
+id=[high|med|low],policy=[fifo,rr],priority=<n>,policy=deadline,runtime=<n>,deadline=<n>,period=<n>
 .IP \-p|\-\-prompt
 Prompt before actually starting the stress test
 .IP \-u|\-\-uniprocessor
-- 
2.20.1


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

* [PATCH 5/9] rt-tests: queuelat: get_cpuinfo_mhz.sh highest value
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
                   ` (3 preceding siblings ...)
  2020-01-23 20:50 ` [PATCH 4/9] rt-tests: pi_stress: Sync man page with help John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-23 20:50 ` [PATCH 6/9] rt-tests: determine_maximum_mpps.sh: Fix quoting and other shell issue John Kacur
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

get_cpuinfo_mhz.sh greps for the Mhz from the /proc/cpuinfo file
It assumes that for multiple cpus the value will be the same, and
intends to return one value using uniq as a filter.

Typically the reported Mhz values can all be slightly different though
It would probably be good enough to simply take the first match as a
heuristic, but to be safe, take the highest number.

Also replace the legacy backticks with the modern $(...) construct, and
quote the $mhz variable.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/queuelat/get_cpuinfo_mhz.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/queuelat/get_cpuinfo_mhz.sh b/src/queuelat/get_cpuinfo_mhz.sh
index eafdd9577424..14a2c12c478f 100755
--- a/src/queuelat/get_cpuinfo_mhz.sh
+++ b/src/queuelat/get_cpuinfo_mhz.sh
@@ -3,6 +3,5 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (C) 2018 Marcelo Tosatti <mtosatti@redhat.com>
 
-mhz=`cat /proc/cpuinfo  | grep "cpu MHz" | uniq | cut -f 3 -d " "`
-echo $mhz
-
+mhz=$(grep "cpu MHz" /proc/cpuinfo | cut -f 3 -d " " | sort -rn | head -n1)
+echo "$mhz"
-- 
2.20.1


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

* [PATCH 6/9] rt-tests: determine_maximum_mpps.sh: Fix quoting and other shell issue
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
                   ` (4 preceding siblings ...)
  2020-01-23 20:50 ` [PATCH 5/9] rt-tests: queuelat: get_cpuinfo_mhz.sh highest value John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-23 20:50 ` [PATCH 7/9] rt-tests: ptsematest: Update man page and add -h option John Kacur
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

Fix a number of issues in the script determine_maximum_mpps.sh such as
1. Convert legacy backticks to $(...) notation
2. Double quote where necessary to prevent globbing
3. Double quote where necessary to prevent word splitting.

Note: these fixes are more than just cosmetic, they are needed for the
script to work correctly.

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

diff --git a/src/queuelat/determine_maximum_mpps.sh b/src/queuelat/determine_maximum_mpps.sh
index f6cf1dea27cf..f785147f1bbd 100755
--- a/src/queuelat/determine_maximum_mpps.sh
+++ b/src/queuelat/determine_maximum_mpps.sh
@@ -17,65 +17,65 @@ echo "Determining maximum mpps the machine can handle"
 echo "Will take a few minutes to determine mpps value"
 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
+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
+		echo mpps failed: "$mpps"
 		break;
 	fi
 	echo success
 done
-echo first loop mpps: $mpps
+echo first loop mpps: "$mpps"
 
 first_mpps=$(($mpps - 1))
-for mpps in `seq $first_mpps -1 3`; do
-	echo testing $mpps Mpps
+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
+		echo mpps success "$mpps"
 		break;
 	fi
 	echo failure
 done
 
-second_mpps=`echo "$mpps + 0.3" | bc`
-echo second loop mpps: $mpps
+second_mpps=$(echo "$mpps + 0.3" | bc)
+echo second loop mpps: "$mpps"
 
-for mpps in `seq $second_mpps 0.3 $first_mpps`; do
-	echo testing $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
+		echo mpps failure "$mpps"
 		break;
 	fi
 	echo success
 done
 
-echo third loop mpps: $mpps
-third_mpps=`echo "$mpps -0.1" | bc`
+echo third loop mpps: "$mpps"
+third_mpps=$(echo "$mpps -0.1" | bc)
 
-for mpps in `seq $third_mpps -0.1 3`; do
-	echo testing $mpps Mpps
+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
+		echo mpps success "$mpps"
 		break;
 	fi
 	echo failure
@@ -89,14 +89,14 @@ while [ $queuelat_failure == 1 ]; do
 	echo -n "Starting 10 runs of 30 seconds with "
 	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`
+	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")
 
 		if [ ! -z "$exceeded" ]; then
 			echo "mpps failure (run $i) $mpps"
 			export queuelat_failure=1
-			mpps=`echo $mpps - 0.1 | bc`
+			mpps=$(echo "$mpps" - 0.1 | bc)
 			export mpps
 			break
 		fi
@@ -113,19 +113,20 @@ 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"
 		export queuelat_failure=1
-		export mpps=`echo $mpps - 0.1 | bc`
+		mpps=$(echo "$mpps" - 0.1 | bc)
+		export mpps
 		continue
 	fi
 	echo "run $i success"
 done
 
-echo Final mpps is: $mpps
+echo Final mpps is: "$mpps"
 
 unset queuelat_failure
 unset mpps
-- 
2.20.1


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

* [PATCH 7/9] rt-tests: ptsematest: Update man page and add -h option
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
                   ` (5 preceding siblings ...)
  2020-01-23 20:50 ` [PATCH 6/9] rt-tests: determine_maximum_mpps.sh: Fix quoting and other shell issue John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-23 20:50 ` [PATCH 8/9] rt-tests: queuelat: Fixes to man page and display_help John Kacur
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

- Update the man page with the -s or --smp option
- Reorder the program help to match the man page
- Make the -h option work correctly

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/ptsematest/ptsematest.8 |  3 +++
 src/ptsematest/ptsematest.c | 10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/ptsematest/ptsematest.8 b/src/ptsematest/ptsematest.8
index 4bb1434babf4..8f76bca4b6a8 100644
--- a/src/ptsematest/ptsematest.8
+++ b/src/ptsematest/ptsematest.8
@@ -35,6 +35,9 @@ Set the number of loops. The default is 0 (endless). This option is useful for a
 .B \-p, \-\-prio=PRIO
 Set the priority of the process.
 .TP
+.B \-s, \-\-smp
+SMP testing: options -a -t and same priority
+.TP
 .B \-t, \-\-threads[=NUM]
 Set the number of test threads (default is 1, if this option is not given). If NUM is specified, create NUM test threads. If NUM is not specified, NUM is set to the number of available CPUs.
 .SH "EXAMPLES"
diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
index 78fa444c5578..485c991ec173 100644
--- a/src/ptsematest/ptsematest.c
+++ b/src/ptsematest/ptsematest.c
@@ -154,10 +154,10 @@ static void display_help(void)
 	"                           with NUM pin all threads to the processor NUM\n"
 	"-b USEC  --breaktrace=USEC send break trace command when latency > USEC\n"
 	"-d DIST  --distance=DIST   distance of thread intervals in us default=500\n"
-	"-i INTV  --interval=INTV   base interval of thread in us default=1000\n"
-	"-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
 	"-D       --duration=TIME   specify a length for the test run.\n"
 	"                           Append 'm', 'h', or 'd' to specify minutes, hours or days.\n"
+	"-i INTV  --interval=INTV   base interval of thread in us default=1000\n"
+	"-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
 	"-p PRIO  --prio=PRIO       priority\n"
 	"-S       --smp             SMP testing: options -a -t and same priority\n"
         "                           of all threads\n"
@@ -202,7 +202,7 @@ static void process_options (int argc, char *argv[])
 			{"help", no_argument, NULL, '?'},
 			{NULL, 0, NULL, 0}
 		};
-		int c = getopt_long (argc, argv, "a::b:d:i:l:D:p:St::",
+		int c = getopt_long (argc, argv, "a::b:d:i:l:D:p:St::h",
 			long_options, &option_index);
 		if (c == -1)
 			break;
@@ -245,6 +245,8 @@ static void process_options (int argc, char *argv[])
 			else
 				num_threads = max_cpus;
 			break;
+		case 'h':
+			display_help();
 		case '?': error = 1; break;
 		}
 	}
@@ -275,7 +277,7 @@ static void process_options (int argc, char *argv[])
 		sameprio = 1;
 
 	if (error)
-		display_help ();
+		display_help();
 }
 
 
-- 
2.20.1


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

* [PATCH 8/9] rt-tests: queuelat: Fixes to man page and display_help
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
                   ` (6 preceding siblings ...)
  2020-01-23 20:50 ` [PATCH 7/9] rt-tests: ptsematest: Update man page and add -h option John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-23 20:50 ` [PATCH 9/9] rt-tests: svsematest: Display help with an error message for -h John Kacur
  2020-01-27 21:44 ` [PATCH 0/9] rt-tests: Miscellaneous fixes Clark Williams
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

- Make sure that help is displayed and not just the message
"Unknown option" when the options are incorrect.
- Add -q to the man page and to the print_help()

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/queuelat/queuelat.8 |  4 +++-
 src/queuelat/queuelat.c | 22 +++++++++++++---------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/queuelat/queuelat.8 b/src/queuelat/queuelat.8
index d68beb98bff7..f67a0bb7556e 100644
--- a/src/queuelat/queuelat.8
+++ b/src/queuelat/queuelat.8
@@ -52,7 +52,9 @@ TSC frequency in MHz.
 .TP
 .B \-t timeout
 Timeout in seconds to quit the program.
-
+.TP
+.B \-q min_queue_len_to_print_trace
+Minimum queue length to print in the trace
 
 .SH AUTHOR
 queuelat was written by Marcelo Tosatti <mtosatti@redhat.com>
diff --git a/src/queuelat/queuelat.c b/src/queuelat/queuelat.c
index 98346f346f82..7e5e35768a8b 100644
--- a/src/queuelat/queuelat.c
+++ b/src/queuelat/queuelat.c
@@ -571,6 +571,7 @@ void print_help(void)
 	printf("-p million-packet-per-sec (million packets per second) (float)\n");
 	printf("-f tsc-freq-mhz (TSC frequency in MHz) (float)\n");
 	printf("-t timeout (timeout, in seconds) (int)\n");
+	printf("-q min_queue_len_to_print_trace (int)\n");
 }
 
 int main(int argc, char **argv)
@@ -616,22 +617,25 @@ int main(int argc, char **argv)
 			return 0;
 		case '?':
 			if (optopt == 'm' || optopt == 'c' || optopt == 'p' ||
-			    optopt == 'f' || optopt == 't' || optopt == 'q')
+			    optopt == 'f' || optopt == 't' || optopt == 'q') {
 				printf ("Option -%c requires an argument.\n", optopt);
-			else if (isprint (optopt))
+			} else if (isprint (optopt)) {
 				printf ("Unknown option `-%c'.\n", optopt);
-			else
-				printf ( "Unknown option character `\\x%x'.\n",
-
-optopt);
+				print_help();
+				return 1;
+			} else {
+				printf ( "Unknown option character `\\x%x'.\n", optopt);
+				print_help();
 				return 1;
-			default:
-				abort ();
+			}
+			break;
+		default:
+			abort ();
 		}
 
 	if (mvalue == NULL || cvalue == NULL || pvalue == NULL ||
 	    fvalue == NULL) {
-		printf("options -m, -c, -p and -f required.\n");
+		printf("options -m, -c, -p and -f are required.\n");
 		printf("usage: %s -m maxlatency -c cycles_per_packet -p mpps(million-packet-per-sec) -f tsc_freq_mhz [-t timeout (in secs)] [-q min_queue_len_to_print_trace]\n", argv[0]);
 		return 1;
 	}
-- 
2.20.1


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

* [PATCH 9/9] rt-tests: svsematest: Display help with an error message for -h
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
                   ` (7 preceding siblings ...)
  2020-01-23 20:50 ` [PATCH 8/9] rt-tests: queuelat: Fixes to man page and display_help John Kacur
@ 2020-01-23 20:50 ` John Kacur
  2020-01-27 21:44 ` [PATCH 0/9] rt-tests: Miscellaneous fixes Clark Williams
  9 siblings, 0 replies; 14+ messages in thread
From: John Kacur @ 2020-01-23 20:50 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

Display help without an error message if the user uses the -h option

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/svsematest/svsematest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
index 7c15393fe1be..023a303fd7df 100644
--- a/src/svsematest/svsematest.c
+++ b/src/svsematest/svsematest.c
@@ -281,7 +281,7 @@ static void process_options (int argc, char *argv[])
 			{"help", no_argument, NULL, '?'},
 			{NULL, 0, NULL, 0}
 		};
-		int c = getopt_long (argc, argv, "a::b:d:f::i:l:D:p:St::",
+		int c = getopt_long (argc, argv, "a::b:d:f::i:l:D:p:St::h",
 			long_options, &option_index);
 		if (c == -1)
 			break;
@@ -335,6 +335,7 @@ static void process_options (int argc, char *argv[])
 			else
 				num_threads = max_cpus;
 			break;
+		case 'h': error = 1; break;
 		case '?': error = 1; break;
 		}
 	}
-- 
2.20.1


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

* Re: [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline
  2020-01-23 20:50 ` [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline John Kacur
@ 2020-01-27 10:44   ` Kurt Kanzenbach
  2020-01-27 17:40     ` John Kacur
  0 siblings, 1 reply; 14+ messages in thread
From: Kurt Kanzenbach @ 2020-01-27 10:44 UTC (permalink / raw)
  To: John Kacur; +Cc: Clark Williams, RT

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

Hi John,

On Thu Jan 23 2020, John Kacur wrote:
> - Add a simple manpage for cyclicdeadline
> - Install it from the Makefile
>
> Signed-off-by: John Kacur <jkacur@redhat.com>
> ---
>  Makefile                            |  1 +
>  src/sched_deadline/cyclicdeadline.8 | 53 +++++++++++++++++++++++++++++
>  2 files changed, 54 insertions(+)
>  create mode 100644 src/sched_deadline/cyclicdeadline.8
>
> diff --git a/Makefile b/Makefile
> index 552b3fe885cc..e2142ba3f4e9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -193,6 +193,7 @@ install: all install_hwlatdetect
>  	gzip -c src/queuelat/queuelat.8 >"$(DESTDIR)$(mandir)/man8/queuelat.8.gz"
>  	gzip -c src/sched_deadline/deadline_test.8 >"$(DESTDIR)$(mandir)/man8/deadline_test.8.gz"
>  	gzip -c src/ssdd/ssdd.8 >"$(DESTDIR)$(mandir)/man8/ssdd.8.gz"
> +	gzip -c src/sched_deadline/cyclicdeadline.8 >"$(DESTDIR)$(mandir)/man8/cyclicdeadline.8.gz"

I'm just wondering about this. Why are the man pages compressed in the
Makefile? Actually most package management systems compress the man
pages themselves. Users may want to use bz2 or something else.

In fact, I have a patch on top of rt-tests v1.6 in Gentoo which removes
the compression, because portage complains about it.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline
  2020-01-27 10:44   ` Kurt Kanzenbach
@ 2020-01-27 17:40     ` John Kacur
  2020-01-28  7:13       ` Kurt Kanzenbach
  0 siblings, 1 reply; 14+ messages in thread
From: John Kacur @ 2020-01-27 17:40 UTC (permalink / raw)
  To: Kurt Kanzenbach; +Cc: Clark Williams, RT



On Mon, 27 Jan 2020, Kurt Kanzenbach wrote:

> Hi John,
> 
> On Thu Jan 23 2020, John Kacur wrote:
> > - Add a simple manpage for cyclicdeadline
> > - Install it from the Makefile
> >
> > Signed-off-by: John Kacur <jkacur@redhat.com>
> > ---
> >  Makefile                            |  1 +
> >  src/sched_deadline/cyclicdeadline.8 | 53 +++++++++++++++++++++++++++++
> >  2 files changed, 54 insertions(+)
> >  create mode 100644 src/sched_deadline/cyclicdeadline.8
> >
> > diff --git a/Makefile b/Makefile
> > index 552b3fe885cc..e2142ba3f4e9 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -193,6 +193,7 @@ install: all install_hwlatdetect
> >  	gzip -c src/queuelat/queuelat.8 >"$(DESTDIR)$(mandir)/man8/queuelat.8.gz"
> >  	gzip -c src/sched_deadline/deadline_test.8 >"$(DESTDIR)$(mandir)/man8/deadline_test.8.gz"
> >  	gzip -c src/ssdd/ssdd.8 >"$(DESTDIR)$(mandir)/man8/ssdd.8.gz"
> > +	gzip -c src/sched_deadline/cyclicdeadline.8 >"$(DESTDIR)$(mandir)/man8/cyclicdeadline.8.gz"
> 
> I'm just wondering about this. Why are the man pages compressed in the
> Makefile? Actually most package management systems compress the man
> pages themselves. Users may want to use bz2 or something else.
> 
> In fact, I have a patch on top of rt-tests v1.6 in Gentoo which removes
> the compression, because portage complains about it.
> 
> Thanks,
> Kurt
> 

I think it's because man pages are generally installed as .gz files on 
most distros. Although the Makefile is designed to work well with package 
management systems, it should also work correctly stand alone.

If you want to submit a patch that would optionally use a different kind 
of compression or otherwise handle things without breaking the current 
defaults, I would likely accept it.

John

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

* Re: [PATCH 0/9] rt-tests: Miscellaneous fixes
  2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
                   ` (8 preceding siblings ...)
  2020-01-23 20:50 ` [PATCH 9/9] rt-tests: svsematest: Display help with an error message for -h John Kacur
@ 2020-01-27 21:44 ` Clark Williams
  9 siblings, 0 replies; 14+ messages in thread
From: Clark Williams @ 2020-01-27 21:44 UTC (permalink / raw)
  To: John Kacur; +Cc: RT

John,

Thanks for this! I suspect we now need an 8.3 bz for updating the rt-tests
package to the latest upstream version.

Clark

On Thu, 23 Jan 2020 21:50:20 +0100
John Kacur <jkacur@redhat.com> wrote:

> Most of the fixes here are just clean-ups to make sure that online help
> or usage message match the man pages according to the current options.
> 
> Some fixes to the queuelat scripts determine_maximum_mpps.sh and
> get_cpuinfo_mhz.sh are perhaps notable though, as people were having
> trouble using them.
> 
> getcpuinfo_mhz.sh now only gets one value as was originally intended,
> and it gets the highest value available. The fixes to quoting in
> determine_maximum_mpps.sh should make the program work correctly now -
> and take longer though.
> 
> John Kacur (9):
>   rt-tests: queuelat: Assume queuelat is in the path
>   rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline
>   rt-tests: pi_stress: Add short options to usage message
>   rt-tests: pi_stress: Sync man page with help
>   rt-tests: queuelat: get_cpuinfo_mhz.sh highest value
>   rt-tests: determine_maximum_mpps.sh: Fix quoting and other shell issue
>   rt-tests: ptsematest: Update man page and add -h option
>   rt-tests: queuelat: Fixes to man page and display_help
>   rt-tests: svsematest: Display help with an error message for -h
> 
>  Makefile                               |  1 +
>  src/pi_tests/pi_stress.8               |  9 ++--
>  src/pi_tests/pi_stress.c               | 34 ++++++------
>  src/ptsematest/ptsematest.8            |  3 ++
>  src/ptsematest/ptsematest.c            | 10 ++--
>  src/queuelat/determine_maximum_mpps.sh | 75 +++++++++++++-------------
>  src/queuelat/get_cpuinfo_mhz.sh        |  5 +-
>  src/queuelat/queuelat.8                |  4 +-
>  src/queuelat/queuelat.c                | 22 ++++----
>  src/sched_deadline/cyclicdeadline.8    | 53 ++++++++++++++++++
>  src/svsematest/svsematest.c            |  3 +-
>  11 files changed, 141 insertions(+), 78 deletions(-)
>  create mode 100644 src/sched_deadline/cyclicdeadline.8
> 
> -- 
> 2.20.1
> 


-- 
The United States Coast Guard
Ruining Natural Selection since 1790


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

* Re: [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline
  2020-01-27 17:40     ` John Kacur
@ 2020-01-28  7:13       ` Kurt Kanzenbach
  0 siblings, 0 replies; 14+ messages in thread
From: Kurt Kanzenbach @ 2020-01-28  7:13 UTC (permalink / raw)
  To: John Kacur; +Cc: Clark Williams, RT

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

Hi John,

On Mon Jan 27 2020, John Kacur wrote:
> On Mon, 27 Jan 2020, Kurt Kanzenbach wrote:
>> I'm just wondering about this. Why are the man pages compressed in the
>> Makefile? Actually most package management systems compress the man
>> pages themselves. Users may want to use bz2 or something else.
>> 
>> In fact, I have a patch on top of rt-tests v1.6 in Gentoo which removes
>> the compression, because portage complains about it.
>> 
>> Thanks,
>> Kurt
>> 
>
> I think it's because man pages are generally installed as .gz files on 
> most distros. Although the Makefile is designed to work well with package 
> management systems, it should also work correctly stand alone.
>
> If you want to submit a patch that would optionally use a different kind 
> of compression or otherwise handle things without breaking the current 
> defaults, I would likely accept it.

Sounds good. I'll come up with a patch and keeping the existing defaults.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

end of thread, other threads:[~2020-01-28  7:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 20:50 [PATCH 0/9] rt-tests: Miscellaneous fixes John Kacur
2020-01-23 20:50 ` [PATCH 1/9] rt-tests: queuelat: Assume queuelat is in the path John Kacur
2020-01-23 20:50 ` [PATCH 2/9] rt-tests: cyclicdeadline: Add a simple manpage for cyclicdeadline John Kacur
2020-01-27 10:44   ` Kurt Kanzenbach
2020-01-27 17:40     ` John Kacur
2020-01-28  7:13       ` Kurt Kanzenbach
2020-01-23 20:50 ` [PATCH 3/9] rt-tests: pi_stress: Add short options to usage message John Kacur
2020-01-23 20:50 ` [PATCH 4/9] rt-tests: pi_stress: Sync man page with help John Kacur
2020-01-23 20:50 ` [PATCH 5/9] rt-tests: queuelat: get_cpuinfo_mhz.sh highest value John Kacur
2020-01-23 20:50 ` [PATCH 6/9] rt-tests: determine_maximum_mpps.sh: Fix quoting and other shell issue John Kacur
2020-01-23 20:50 ` [PATCH 7/9] rt-tests: ptsematest: Update man page and add -h option John Kacur
2020-01-23 20:50 ` [PATCH 8/9] rt-tests: queuelat: Fixes to man page and display_help John Kacur
2020-01-23 20:50 ` [PATCH 9/9] rt-tests: svsematest: Display help with an error message for -h John Kacur
2020-01-27 21:44 ` [PATCH 0/9] rt-tests: Miscellaneous fixes Clark Williams

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).