summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@am.sony.com>2012-05-01 19:45:44 -0700
committerClark Williams <williams@redhat.com>2012-05-03 16:17:38 -0500
commit3c14034e3dfd23aea9e830e7aa7be5f1acaa8410 (patch)
tree5b8f6b3d1728be46c7a6a8af57875761fc291ecf
parentb3593fbe8e18bb441a37d869282574784aa49e0b (diff)
downloadrt-tests-3c14034e3dfd23aea9e830e7aa7be5f1acaa8410.tar.gz
rt-tests: cyclictest warn of interaction between '-a', '--smp', and '--numa'
The '-a' option is always ignored if --smp or --numa is specified. Fix the warning message to not depend on --smp or --numa occuring first. Signed-off-by: Frank Rowand <frank.rowand@am.sony.com> Tested-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r--src/cyclictest/cyclictest.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 92df82b..f2566cc 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -957,10 +957,11 @@ static char *policyname(int policy)
static void process_options (int argc, char *argv[])
{
int error = 0;
+ int option_affinity = 0;
int max_cpus = sysconf(_SC_NPROCESSORS_CONF);
for (;;) {
- int option_index = 0;
+ int option_index = 0;
/** Options for getopt */
static struct option long_options[] = {
{"affinity", optional_argument, NULL, 'a'},
@@ -1008,10 +1009,9 @@ static void process_options (int argc, char *argv[])
break;
switch (c) {
case 'a':
- if (smp) {
- warn("-a ignored due to --smp\n");
+ option_affinity = 1;
+ if (smp || numa)
break;
- }
if (optarg != NULL) {
affinity = atoi(optarg);
setaffinity = AFFINITY_SPECIFIED;
@@ -1121,6 +1121,14 @@ static void process_options (int argc, char *argv[])
}
}
+ if (option_affinity) {
+ if (smp) {
+ warn("-a ignored due to --smp\n");
+ } else if (numa) {
+ warn("-a ignored due to --numa\n");
+ }
+ }
+
if (setaffinity == AFFINITY_SPECIFIED) {
if (affinity < 0)
error = 1;