Blame SOURCES/rt-tests-Fix-parsing-of-affinity-when-there-is-a-spa.patch

b69aad
From 4fac6f28af3aec1c88f19bf96ef73541c1ae5858 Mon Sep 17 00:00:00 2001
b69aad
From: John Kacur <jkacur@redhat.com>
b69aad
Date: Fri, 28 Jan 2022 12:50:22 -0500
b69aad
Subject: [PATCH 1/2] rt-tests: Fix parsing of affinity when there is a space.
b69aad
b69aad
Make sure that -a all and -a '+' are passed to parse_cpumask().
b69aad
Currently this doesn't work correctly if there is a space after -a and the
b69aad
string.
b69aad
b69aad
While we are at it, fix the message in oslat which calls
b69aad
numa_parse_cpustring_all directly to say that.
b69aad
b69aad
Signed-off-by: John Kacur <jkacur@redhat.com>
b69aad
---
b69aad
 src/cyclictest/cyclictest.c | 4 +++-
b69aad
 src/oslat/oslat.c           | 2 +-
b69aad
 src/signaltest/signaltest.c | 4 +++-
b69aad
 3 files changed, 7 insertions(+), 3 deletions(-)
b69aad
b69aad
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
b69aad
index 490aedb54c03..c9ed9e08f6e1 100644
b69aad
--- a/src/cyclictest/cyclictest.c
b69aad
+++ b/src/cyclictest/cyclictest.c
b69aad
@@ -1035,7 +1035,9 @@ static void process_options(int argc, char *argv[], int max_cpus)
b69aad
 			} else if (optind < argc &&
b69aad
 				   (atoi(argv[optind]) ||
b69aad
 				    argv[optind][0] == '0' ||
b69aad
-				    argv[optind][0] == '!')) {
b69aad
+				    argv[optind][0] == '!' ||
b69aad
+				    argv[optind][0] == '+' ||
b69aad
+				    argv[optind][0] == 'a')) {
b69aad
 				parse_cpumask(argv[optind], max_cpus, &affinity_mask);
b69aad
 				setaffinity = AFFINITY_SPECIFIED;
b69aad
 			} else {
b69aad
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
b69aad
index 50ddc81463ea..aa0e9a79e3b4 100644
b69aad
--- a/src/oslat/oslat.c
b69aad
+++ b/src/oslat/oslat.c
b69aad
@@ -850,7 +850,7 @@ int main(int argc, char *argv[])
b69aad
 
b69aad
 	cpu_set = numa_parse_cpustring_all(g.cpu_list);
b69aad
 	if (!cpu_set)
b69aad
-		fatal("oslat: parse_cpumask failed.\n");
b69aad
+		fatal("oslat: numa_parse_cpustring_all failed.\n");
b69aad
 	n_cores = numa_bitmask_weight(cpu_set);
b69aad
 
b69aad
 	TEST(threads = calloc(1, n_cores * sizeof(threads[0])));
b69aad
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
b69aad
index 4d89a1aba9d9..1cf03931b5bf 100644
b69aad
--- a/src/signaltest/signaltest.c
b69aad
+++ b/src/signaltest/signaltest.c
b69aad
@@ -261,7 +261,9 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus)
b69aad
 			} else if (optind < argc &&
b69aad
 				   (atoi(argv[optind]) ||
b69aad
 				    argv[optind][0] == '0' ||
b69aad
-				    argv[optind][0] == '!')) {
b69aad
+				    argv[optind][0] == '!' ||
b69aad
+				    argv[optind][0] == '+' ||
b69aad
+				    argv[optind][0] == 'a')) {
b69aad
 				parse_cpumask(argv[optind], max_cpus, &affinity_mask);
b69aad
 				setaffinity = AFFINITY_SPECIFIED;
b69aad
 			} else {
b69aad
-- 
b69aad
2.34.1
b69aad