All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rt-tests: Fix parsing of affinity when there is a space.
@ 2022-01-28 18:00 John Kacur
  0 siblings, 0 replies; only message in thread
From: John Kacur @ 2022-01-28 18:00 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, Sebastian Siewior, Marcelo Tosatti, John Kacur

Make sure that -a all and -a '+' are passed to parse_cpumask().
Currently this doesn't work correctly if there is a space after -a and the
string.

While we are at it, fix the message in oslat which calls
numa_parse_cpustring_all directly to say that.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/cyclictest/cyclictest.c | 4 +++-
 src/oslat/oslat.c           | 2 +-
 src/signaltest/signaltest.c | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 490aedb54c03..c9ed9e08f6e1 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1035,7 +1035,9 @@ static void process_options(int argc, char *argv[], int max_cpus)
 			} else if (optind < argc &&
 				   (atoi(argv[optind]) ||
 				    argv[optind][0] == '0' ||
-				    argv[optind][0] == '!')) {
+				    argv[optind][0] == '!' ||
+				    argv[optind][0] == '+' ||
+				    argv[optind][0] == 'a')) {
 				parse_cpumask(argv[optind], max_cpus, &affinity_mask);
 				setaffinity = AFFINITY_SPECIFIED;
 			} else {
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index 50ddc81463ea..aa0e9a79e3b4 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -850,7 +850,7 @@ int main(int argc, char *argv[])
 
 	cpu_set = numa_parse_cpustring_all(g.cpu_list);
 	if (!cpu_set)
-		fatal("oslat: parse_cpumask failed.\n");
+		fatal("oslat: numa_parse_cpustring_all failed.\n");
 	n_cores = numa_bitmask_weight(cpu_set);
 
 	TEST(threads = calloc(1, n_cores * sizeof(threads[0])));
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index 4d89a1aba9d9..1cf03931b5bf 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -261,7 +261,9 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus)
 			} else if (optind < argc &&
 				   (atoi(argv[optind]) ||
 				    argv[optind][0] == '0' ||
-				    argv[optind][0] == '!')) {
+				    argv[optind][0] == '!' ||
+				    argv[optind][0] == '+' ||
+				    argv[optind][0] == 'a')) {
 				parse_cpumask(argv[optind], max_cpus, &affinity_mask);
 				setaffinity = AFFINITY_SPECIFIED;
 			} else {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-28 18:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28 18:00 [PATCH] rt-tests: Fix parsing of affinity when there is a space John Kacur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.