[PATCH 7/9] rt-tests: ptsematest: Update man page and add -h option

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

 



- 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@xxxxxxxxxx>
---
 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




[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