All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: xenomai@xenomai.org
Cc: Jan Kiszka <jan.kiszka@siemens.com>, Philippe Gerum <rpm@xenomai.org>
Subject: [PATCH 01/12] testsuite/smokey: posix_clock: prevent false positive in time-dependent test
Date: Thu, 24 Jan 2019 16:34:17 +0100	[thread overview]
Message-ID: <20190124153428.21006-2-rpm@xenomai.org> (raw)
In-Reply-To: <20190124153428.21006-1-rpm@xenomai.org>

clock_decrease_after_periodic_timer_first_tick checks that periodic
interval timers based on CLOCK_REALTIME are not (pathologically)
affected by the epoch going backwards.

To this end, we measure the actual time observed between two ticks of
a periodic timer based on CLOCK_REALTIME with a call to
clock_settime() injecting a negative offset in between, equivalent to
five ticks.

Due to processing delays induced by clock_settime() and other latency,
we could observe a duration which exceeds a tick by a few tenths of
microseconds. Since we can't anticipate the amount of latency
involved, let's accept a longer delay of at most two ticks.

This is still correct from the standpoint of the test, which verifies
that no correlation exists between the clock offset injected by
clock_settime() and the delay until the next tick generated by the
affected clock.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
---
 testsuite/smokey/posix-clock/posix-clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/smokey/posix-clock/posix-clock.c b/testsuite/smokey/posix-clock/posix-clock.c
index f672a9d52..3a638d41f 100644
--- a/testsuite/smokey/posix-clock/posix-clock.c
+++ b/testsuite/smokey/posix-clock/posix-clock.c
@@ -417,7 +417,7 @@ static int clock_decrease_after_periodic_timer_first_tick(void)
 
 	diff = now.tv_sec * 1000000000ULL + now.tv_nsec -
 		(timer.it_value.tv_sec * 1000000000ULL + timer.it_value.tv_nsec);
-	if (!smokey_assert(diff < 1000000000))
+	if (!smokey_assert(diff < 2000000000))
 		return -EINVAL;
 	
 	ret = smokey_check_errno(read(t, &ticks, sizeof(ticks)));
-- 
2.17.2



  reply	other threads:[~2019-01-24 15:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 15:34 [PATCH 00/12] Assorted updates: RTnet, GPIO, smokey tests Philippe Gerum
2019-01-24 15:34 ` Philippe Gerum [this message]
2019-01-24 15:34 ` [PATCH 02/12] drivers/gpio: provide optional timestamped readouts Philippe Gerum
2019-01-24 18:17   ` Jan Kiszka
2019-01-25  9:15     ` Philippe Gerum
2019-01-25  9:23       ` Jan Kiszka
2019-01-25  9:31         ` Philippe Gerum
2019-01-25  9:33           ` Jan Kiszka
2019-01-25  9:38             ` Philippe Gerum
2019-01-25  9:48               ` Jan Kiszka
2019-01-25 10:11                 ` Philippe Gerum
2019-01-25 11:32                   ` Jan Kiszka
2019-01-25 11:42                     ` Philippe Gerum
2019-01-25 13:46                       ` Jan Kiszka
2019-01-24 15:34 ` [PATCH 03/12] testsuite/gpiotest: enable timestamping on 'timestamp' argument Philippe Gerum
2019-01-24 15:34 ` [PATCH 04/12] net/stack: allow initializing pre-allocated device structs Philippe Gerum
2019-01-24 15:34 ` [PATCH 05/12] net/stack: fresh rtskb should have ip_summed set to CHECKSUM_NONE Philippe Gerum
2019-01-24 18:21   ` Jan Kiszka
2019-01-25  9:26     ` Philippe Gerum
2019-01-24 15:34 ` [PATCH 06/12] net/rtdev: ensure per-device skbs get mapped at registration Philippe Gerum
2019-01-24 18:24   ` Jan Kiszka
2019-02-06  9:02     ` Philippe Gerum
2019-02-06  9:08       ` Jan Kiszka
2019-02-06  9:47         ` Philippe Gerum
2019-01-24 15:34 ` [PATCH 07/12] net/udp: getfrag: fix frag preparation status Philippe Gerum
2019-01-24 15:34 ` [PATCH 08/12] net/udp: getfrag: remove direct reference to user memory Philippe Gerum
2019-01-24 15:34 ` [PATCH 09/12] testsuite/smokey: net: do not unload pre-loaded modules Philippe Gerum
2019-01-24 15:34 ` [PATCH 10/12] testsuite/smokey: net: do not down a previously running test interface Philippe Gerum
2019-01-24 15:34 ` [PATCH 11/12] net/stack: rtskb: do not run nop locking calls Philippe Gerum
2019-01-24 15:34 ` [PATCH 12/12] testsuite/smokey: net_client: improve stats readability Philippe Gerum
2019-01-24 18:10 ` [PATCH 00/12] Assorted updates: RTnet, GPIO, smokey tests Jan Kiszka
2019-01-25  9:12   ` Philippe Gerum
2019-01-25  9:20     ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190124153428.21006-2-rpm@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.