From: John Stultz <john.stultz(a)linaro.org>
[ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ]
In the past we've warned when ADJ_OFFSET was in progress, usually
caused by ntpd or some other time adjusting daemon running in non
steady sate, which can cause the skew calculations to be
incorrect.
Thus, this patch checks to see if the clock was being adjusted
when we fail so that we don't cause false negatives.
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: Miroslav Lichvar <mlichvar(a)redhat.com>
Cc: Richard Cochran <richardcochran(a)gmail.com>
Cc: Prarit Bhargava <prarit(a)redhat.com>
Cc: Stephen Boyd <sboyd(a)kernel.org>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: linux-kselftest(a)vger.kernel.org
Suggested-by: Miroslav Lichvar <mlichvar(a)redhat.com>
Signed-off-by: John Stultz <john.stultz(a)linaro.org>
---
v2: Widened the checks to look for other clock adjustments that
could happen, as suggested by Miroslav
v3: Fixed up commit message
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
---
tools/testing/selftests/timers/raw_skew.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c
index ca6cd146aafe..dcf73c5dab6e 100644
--- a/tools/testing/selftests/timers/raw_skew.c
+++ b/tools/testing/selftests/timers/raw_skew.c
@@ -134,6 +134,11 @@ int main(int argv, char **argc)
printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000)));
if (llabs(eppm - ppm) > 1000) {
+ if (tx1.offset || tx2.offset ||
+ tx1.freq != tx2.freq || tx1.tick != tx2.tick) {
+ printf(" [SKIP]\n");
+ return ksft_exit_skip("The clock was adjusted externally. Shutdown NTPd or other time sync daemons\n");
+ }
printf(" [FAILED]\n");
return ksft_exit_fail();
}
--
2.17.1
From: John Stultz <john.stultz(a)linaro.org>
[ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ]
In the past we've warned when ADJ_OFFSET was in progress, usually
caused by ntpd or some other time adjusting daemon running in non
steady sate, which can cause the skew calculations to be
incorrect.
Thus, this patch checks to see if the clock was being adjusted
when we fail so that we don't cause false negatives.
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: Miroslav Lichvar <mlichvar(a)redhat.com>
Cc: Richard Cochran <richardcochran(a)gmail.com>
Cc: Prarit Bhargava <prarit(a)redhat.com>
Cc: Stephen Boyd <sboyd(a)kernel.org>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: linux-kselftest(a)vger.kernel.org
Suggested-by: Miroslav Lichvar <mlichvar(a)redhat.com>
Signed-off-by: John Stultz <john.stultz(a)linaro.org>
---
v2: Widened the checks to look for other clock adjustments that
could happen, as suggested by Miroslav
v3: Fixed up commit message
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
---
tools/testing/selftests/timers/raw_skew.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c
index ca6cd146aafe..dcf73c5dab6e 100644
--- a/tools/testing/selftests/timers/raw_skew.c
+++ b/tools/testing/selftests/timers/raw_skew.c
@@ -134,6 +134,11 @@ int main(int argv, char **argc)
printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000)));
if (llabs(eppm - ppm) > 1000) {
+ if (tx1.offset || tx2.offset ||
+ tx1.freq != tx2.freq || tx1.tick != tx2.tick) {
+ printf(" [SKIP]\n");
+ return ksft_exit_skip("The clock was adjusted externally. Shutdown NTPd or other time sync daemons\n");
+ }
printf(" [FAILED]\n");
return ksft_exit_fail();
}
--
2.17.1
ionmap_test compilation failed because there is no dma_buf.h on any of
include paths. Moreover, it's better to use the dma_buf.h file of
kernel under test and not the currently running one.
To fix this, add new target to the Makefile, installing Kernel headers
for user space and direct compiler to look for dma_buf.h file there.
Signed-off-by: Alexey Skidanov <alexey.skidanov(a)intel.com>
---
tools/testing/selftests/android/ion/Makefile | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile
index e036952..a4aac0e 100644
--- a/tools/testing/selftests/android/ion/Makefile
+++ b/tools/testing/selftests/android/ion/Makefile
@@ -1,10 +1,14 @@
-INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/
+INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../uapi/include
CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
-all: $(TEST_GEN_FILES)
+all: usr_headers $(TEST_GEN_FILES)
+
+usr_headers:
+ cd ../../../../../
+ make headers_install INSTALL_HDR_PATH=./uapi
$(TEST_GEN_FILES): ipcsocket.c ionutils.c
--
2.7.4
I run into the following error
testing/selftests/kvm/dirty_log_test.c:285: undefined reference to `pthread_create'
testing/selftests/kvm/dirty_log_test.c:297: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
my gcc version is gcc version 4.8.4
"-pthread" would work everywhere
Signed-off-by: Lei Yang <Lei.Yang(a)windriver.com>
---
tools/testing/selftests/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 03b0f55..48c970c 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -20,7 +20,7 @@ INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
LINUX_TOOL_INCLUDE = $(top_srcdir)tools/include
CFLAGS += -O2 -g -std=gnu99 -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -I..
-LDFLAGS += -lpthread
+LDFLAGS += -pthread
# After inclusion, $(OUTPUT) is defined and
# $(TEST_GEN_PROGS) starts with $(OUTPUT)/
--
1.9.1
Hi,
ION selftest compilation failed with the following error on my machine:
ionmap_test.c:12:27: fatal error: linux/dma-buf.h: No such file or directory
I have resolved it by exporting kernel headers for user space:
make headers_install INSTALL_HDR_PATH=/usr
Probably it should be part of the make file?
Tthanks,
Alexey
Hi Shuah,
I wrote some tests for the new memory.oom.group feature in cgroups 2.
In the process, I discovered a few small bugs in the cgroups tests, which
I have fixed as well in a separate commit.
This is my first ever patch to Linux, so let me know if you see any issues or
improvements that can be made.
Thanks for all your amazing work on Linux!
-Jay