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>
This commit is contained in:
parent
b3593fbe8e
commit
3c14034e3d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue