[PATCH 4/4] rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OPT_SYSTEM means use sys_nanosleep and sys_setitimer
if you try to combine it with OPT_POSIX_TIMERS, it breaks.

cyclictest becomes unkillable with ctrl-C and only the first thread is
updated.

Fix this by issuing a warning if the user tries to combine the two
options and then use clock_nanosleep.

Reported-by: Tom Rix <trix@xxxxxxxxxx>
Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
 src/cyclictest/cyclictest.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 542e85c27a25..90449d465398 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1353,6 +1353,13 @@ static void process_options (int argc, char *argv[], int max_cpus)
 		}
 	}
 
+	if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) {
+		warn("The system option requires clock_nanosleep\n");
+		warn("and is not compatible with posix_timers\n");
+		warn("Using clock_nanosleep\n");
+		use_nanosleep = MODE_CLOCK_NANOSLEEP;
+	}
+
 	/* if smp wasn't requested, test for numa automatically */
 	if (!smp) {
 #ifdef NUMA
-- 
2.20.1




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux