Skip to contentSkip to conversation

Minor rt-tests updates

PATCH NAK David Sommerseth 2 participants 11 messages Dec 22, 2009 – Dec 23, 2009

lore
Share & tools
lore
#0 lore raw

cover Minor rt-tests updates

Several minor updates cleaning up arguments and man page.

David Sommerseth (4):
Fixed missing parsing of short arguments in classic_pi Missing parsing of --mlockall in signaltest
Added --help screen info about -M / --refresh-on-max in cyclictest Updated man page to reflect --refresh-on-max argument name change

 src/cyclictest/cyclictest.8 |    2 +-
 src/cyclictest/cyclictest.c |    3 ++-
 src/pi_tests/classic_pi.c   |    2 +-
 src/signaltest/signaltest.c |    1 +
 4 files changed, 5 insertions(+), 3 deletions(-)
#1 lore raw

PATCH 1/4 Fixed missing parsing of short arguments in classic_pi

---
 src/pi_tests/classic_pi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/pi_tests/classic_pi.c +1 -1
index 59e907b..2b8ef3d 100644
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
 	setvbuf (stdout, NULL, _IONBF, 0);
 
 	/* process command line arguments */
-	while ((opt = getopt_long(argc, argv, "+", options, NULL)) != -1) {
+	while ((opt = getopt_long(argc, argv, "vqni:", options, NULL)) != -1) {
 		switch (opt) {
 		case '?':
 			usage();
Signature · 1 line
1.6.2.5
#2 lore raw

Re: [PATCH 1/4] Fixed missing parsing of short arguments in classic_pi

Quoted 20 lines · David Sommerseth
---
 src/pi_tests/classic_pi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/pi_tests/classic_pi.c +1 -1
index 59e907b..2b8ef3d 100644
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
 	setvbuf (stdout, NULL, _IONBF, 0);
 
 	/* process command line arguments */
-	while ((opt = getopt_long(argc, argv, "+", options, NULL)) != -1) {
+	while ((opt = getopt_long(argc, argv, "vqni:", options, NULL)) != -1) {
 		switch (opt) {
 		case '?':
 			usage();
Signature · 1 line
1.6.2.5

David

Thanks - I fixed-up your patch to put back the leading '+' or else you change the behaviour when a non-option is given between two real options.

We have been actively maintaining pi_stress, but classic_stress is a proof of concept, so I don't know how much longer we want to maintain the code here.

I pushed your patch with my modification to
git://git.kernel.org/pub/scm/linux/kernel/git/jkacur/rt-tests.git
branch: rt-tests-dev-new

Clark please pull above.

Quoted 1 line

From 2e2c1eb6ae2147ae68f1af4a0cc90066ad3c4bd0 Mon Sep 17 00:00:00 2001

From: David Sommerseth <[email protected]>
Date: Tue, 22 Dec 2009 16:47:35 +0100
Subject: [PATCH] Fixed missing parsing of short arguments in classic_pi (David)
- Added the '+' back to the arguments (John)

---
 src/pi_tests/classic_pi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/pi_tests/classic_pi.c +1 -1
index 59e907b..91a8d6a 100644
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
 	setvbuf (stdout, NULL, _IONBF, 0);
 
 	/* process command line arguments */
-	while ((opt = getopt_long(argc, argv, "+", options, NULL)) != -1) {
+	while ((opt = getopt_long(argc, argv, "+vqni:", options, NULL)) != -1) {
 		switch (opt) {
 		case '?':
 			usage();
Signature · 1 line
1.6.0.6
#3 lore raw

PATCH 2/4 Missing parsing of --mlockall in signaltest

In reply to David Sommerseth
---
 src/signaltest/signaltest.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
src/signaltest/signaltest.c +1 -0
index b637aae..24ac959 100644
@@ -235,6 +235,7 @@ static void process_options (int argc, char *argv[])
 			{"quiet", no_argument, NULL, 'q'},
 			{"threads", required_argument, NULL, 't'},
 			{"verbose", no_argument, NULL, 'v'},
+			{"mlockall", no_argument, NULL, 'm'},
 			{"help", no_argument, NULL, '?'},
 			{NULL, 0, NULL, 0}
 		};
Signature · 1 line
1.6.2.5
#4 lore raw

Re: [PATCH 2/4] Missing parsing of --mlockall in signaltest

Quoted 21 lines · David Sommerseth
---
 src/signaltest/signaltest.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
src/signaltest/signaltest.c +1 -0
index b637aae..24ac959 100644
@@ -235,6 +235,7 @@ static void process_options (int argc, char *argv[])
 			{"quiet", no_argument, NULL, 'q'},
 			{"threads", required_argument, NULL, 't'},
 			{"verbose", no_argument, NULL, 'v'},
+			{"mlockall", no_argument, NULL, 'm'},
 			{"help", no_argument, NULL, '?'},
 			{NULL, 0, NULL, 0}
 		};
Signature · 1 line
1.6.2.5

Nice catch! I cced Carsten - as this is his code.

Clark I pushed this to
git://git.kernel.org/pub/scm/linux/kernel/git/jkacur/rt-tests.git
branch: rt-tests-dev-new

Please pull from there. (61b1309)

Thanks

#5 lore raw

PATCH 3/4 Added --help screen info about -M / --refresh-on-max in cyclictest

In reply to David Sommerseth

Also renamed --refresh_on_max to --refresh-on-max

---
 src/cyclictest/cyclictest.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
src/cyclictest/cyclictest.c +2 -1
index 223f343..7979a77 100644
@@ -788,6 +788,7 @@ static void display_help(int error)
 	       "-I       --irqsoff         Irqsoff tracing (used with -b)\n"
 	       "-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
 	       "-m       --mlockall        lock current and future memory allocations\n"
+	       "-M       --refresh-on-max  delay updating the screen until a new max latency is hit\n"
 	       "-n       --nanosleep       use clock_nanosleep\n"
 	       "-N       --nsecs           print results in ns instead of us (default us)\n"
 	       "-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED\n"
@@ -910,7 +911,7 @@ static void process_options (int argc, char *argv[])
 			{"irqsoff", no_argument, NULL, 'I'},
 			{"loops", required_argument, NULL, 'l'},
 			{"mlockall", no_argument, NULL, 'm' },
-			{"refresh_on_max", no_argument, NULL, 'M' },
+			{"refresh-on-max", no_argument, NULL, 'M' },
 			{"nanosleep", no_argument, NULL, 'n'},
 			{"nsecs", no_argument, NULL, 'N'},
 			{"oscope", required_argument, NULL, 'o'},
Signature · 1 line
1.6.2.5
#6 lore raw

Re: [PATCH 3/4] Added --help screen info about -M / --refresh-on-max in cyclictest

Quoted 32 lines · David Sommerseth

Also renamed --refresh_on_max to --refresh-on-max

---
 src/cyclictest/cyclictest.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
src/cyclictest/cyclictest.c +2 -1
index 223f343..7979a77 100644
@@ -788,6 +788,7 @@ static void display_help(int error)
 	       "-I       --irqsoff         Irqsoff tracing (used with -b)\n"
 	       "-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
 	       "-m       --mlockall        lock current and future memory allocations\n"
+	       "-M       --refresh-on-max  delay updating the screen until a new max latency is hit\n"
 	       "-n       --nanosleep       use clock_nanosleep\n"
 	       "-N       --nsecs           print results in ns instead of us (default us)\n"
 	       "-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED\n"
@@ -910,7 +911,7 @@ static void process_options (int argc, char *argv[])
 			{"irqsoff", no_argument, NULL, 'I'},
 			{"loops", required_argument, NULL, 'l'},
 			{"mlockall", no_argument, NULL, 'm' },
-			{"refresh_on_max", no_argument, NULL, 'M' },
+			{"refresh-on-max", no_argument, NULL, 'M' },
 			{"nanosleep", no_argument, NULL, 'n'},
 			{"nsecs", no_argument, NULL, 'N'},
 			{"oscope", required_argument, NULL, 'o'},
Signature · 1 line
1.6.2.5

Hmnn, I'm not sure that I want to apply this one.
What is the motifivation for changing the name to refresh-on-max? Right now refresh_on_max matches the global variable.

#7 lore raw

Re: [PATCH 3/4] Added --help screen info about -M / --refresh-on-max in cyclictest

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 31 lines · John Kacur
Quoted 27 lines · David Sommerseth

Also renamed --refresh_on_max to --refresh-on-max

---
 src/cyclictest/cyclictest.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
src/cyclictest/cyclictest.c +2 -1
index 223f343..7979a77 100644
@@ -788,6 +788,7 @@ static void display_help(int error)
 	       "-I       --irqsoff         Irqsoff tracing (used with -b)\n"
 	       "-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
 	       "-m       --mlockall        lock current and future memory allocations\n"
+	       "-M       --refresh-on-max  delay updating the screen until a new max latency is hit\n"
 	       "-n       --nanosleep       use clock_nanosleep\n"
 	       "-N       --nsecs           print results in ns instead of us (default us)\n"
 	       "-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED\n"
@@ -910,7 +911,7 @@ static void process_options (int argc, char *argv[])
 			{"irqsoff", no_argument, NULL, 'I'},
 			{"loops", required_argument, NULL, 'l'},
 			{"mlockall", no_argument, NULL, 'm' },
-			{"refresh_on_max", no_argument, NULL, 'M' },
+			{"refresh-on-max", no_argument, NULL, 'M' },
 			{"nanosleep", no_argument, NULL, 'n'},
 			{"nsecs", no_argument, NULL, 'N'},
Quoted 8 lines
Quoted 5 lines
src/cyclictest/cyclictest.c +0 -0
 			{"oscope", required_argument, NULL, 'o'},
Signature · 1 line
1.6.2.5

Hmnn, I'm not sure that I want to apply this one.
What is the motifivation for changing the name to refresh-on-max? Right now refresh_on_max matches the global variable.

The motivation is only to be consistent with the argument handling in the whole rt-tests suite. The rt-migrate-test uses dash instead of underscore (--run-time, --sleep-time). And considering that this feature is rather new (introduced in commit fc96b72126e79), I just thought it would be better to change this as soon as possible, before it is implemented in too many scripts.

However, this is more a cosmetic change than a feature. I won't climb the barricades fighting for this patch ;-) It's only done to simplify things for users, not needing to remember which arguments uses underscore and which uses dash.

David S.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAksx3l8ACgkQIIWEatLf4Hd/QgCeMFG60Jk+92eilUicDhDPXhhL erkAnjkLH5s9Cd6jDBBH0IY6qS9Zmu69
=xZgN
-----END PGP SIGNATURE-----

#8 lore raw

Re: [PATCH 3/4] Added --help screen info about -M / --refresh-on-max in cyclictest

In reply to David Sommerseth
Quoted 30 lines · David Sommerseth

Also renamed --refresh_on_max to --refresh-on-max

---
 src/cyclictest/cyclictest.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
src/cyclictest/cyclictest.c +2 -1
index 223f343..7979a77 100644
@@ -788,6 +788,7 @@ static void display_help(int error)
 	       "-I       --irqsoff         Irqsoff tracing (used with -b)\n"
 	       "-l LOOPS --loops=LOOPS     number of loops: default=0(endless)\n"
 	       "-m       --mlockall        lock current and future memory allocations\n"
+	       "-M       --refresh-on-max  delay updating the screen until a new max latency is hit\n"
 	       "-n       --nanosleep       use clock_nanosleep\n"
 	       "-N       --nsecs           print results in ns instead of us (default us)\n"
 	       "-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED\n"
@@ -910,7 +911,7 @@ static void process_options (int argc, char *argv[])
 			{"irqsoff", no_argument, NULL, 'I'},
 			{"loops", required_argument, NULL, 'l'},
 			{"mlockall", no_argument, NULL, 'm' },
-			{"refresh_on_max", no_argument, NULL, 'M' },
+			{"refresh-on-max", no_argument, NULL, 'M' },
 			{"nanosleep", no_argument, NULL, 'n'},
 			{"nsecs", no_argument, NULL, 'N'},
 			{"oscope", required_argument, NULL, 'o'},
Signature · 1 line
1.6.2.5

David:

I altered your patch, to keep the missing help info, but without the name change.

Clark: applied and pushed to

git://git.kernel.org/pub/scm/linux/kernel/git/jkacur/rt-tests.git
branch: rt-tests-dev-new
(d3f77dc)

Please pull

John

#9 lore raw

PATCH 4/4 Updated man page to reflect --refresh-on-max agrument name change

In reply to David Sommerseth
---
 src/cyclictest/cyclictest.8 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/cyclictest/cyclictest.8 +1 -1
index c0f3fa8..8bf95e2 100644
@@ -156,7 +156,7 @@ rt-task wakeup tracing (used with \-b)
 set the scheduler policy of the measurement threads 
 where NAME is one of: other, normal, batch, idle, fifo, rr
 .TP
-.B \\-M, \-\-refresh_on_max
+.B \\-M, \-\-refresh-on-max
 delay updating the screen until a new max latency is hit (useful for
 running cyclictest on low-bandwidth connections)
 .\" .SH SEE ALSO
Signature · 1 line
1.6.2.5
#10 lore raw

Re: [PATCH 4/4] Updated man page to reflect --refresh-on-max agrument name change

Quoted 22 lines · David Sommerseth
---
 src/cyclictest/cyclictest.8 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/cyclictest/cyclictest.8 +1 -1
index c0f3fa8..8bf95e2 100644
@@ -156,7 +156,7 @@ rt-task wakeup tracing (used with \-b)
 set the scheduler policy of the measurement threads 
 where NAME is one of: other, normal, batch, idle, fifo, rr
 .TP
-.B \\-M, \-\-refresh_on_max
+.B \\-M, \-\-refresh-on-max
 delay updating the screen until a new max latency is hit (useful for
 running cyclictest on low-bandwidth connections)
 .\" .SH SEE ALSO
Signature · 1 line
1.6.2.5

NAK

The above patch is not needed, because I applied your previous patch but without the name change.

Thanks

John Kacur