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