Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664744 > unrolled thread

[PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp

Started byMiroslav Lichvar <mlichvar@redhat.com>
First post2017-06-13 13:00 +0200
Last post2017-06-14 01:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp Miroslav Lichvar <mlichvar@redhat.com> - 2017-06-13 13:00 +0200
    Re: [PATCH] kselftests: timers: Fix inconsistency-check to not ignore  first timestamp John Stultz <john.stultz@linaro.org> - 2017-06-14 01:00 +0200

#1664744 — [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp

FromMiroslav Lichvar <mlichvar@redhat.com>
Date2017-06-13 13:00 +0200
Subject[PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp
Message-ID<tRRIe-6VX-3@gated-at.bofh.it>
When the first timestamp in the list of clock readings was later than
the second timestamp and all other timestamps were in order, the
inconsistency was not reported because the index of the out-of-order
timestamp was equal to the default value.

Cc: John Stultz <john.stultz@linaro.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
---
 tools/testing/selftests/timers/inconsistency-check.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/timers/inconsistency-check.c b/tools/testing/selftests/timers/inconsistency-check.c
index caf1bc9..74c60e8 100644
--- a/tools/testing/selftests/timers/inconsistency-check.c
+++ b/tools/testing/selftests/timers/inconsistency-check.c
@@ -118,7 +118,7 @@ int consistency_test(int clock_type, unsigned long seconds)
 	start_str = ctime(&t);
 
 	while (seconds == -1 || now - then < seconds) {
-		inconsistent = 0;
+		inconsistent = -1;
 
 		/* Fill list */
 		for (i = 0; i < CALLS_PER_LOOP; i++)
@@ -130,7 +130,7 @@ int consistency_test(int clock_type, unsigned long seconds)
 				inconsistent = i;
 
 		/* display inconsistency */
-		if (inconsistent) {
+		if (inconsistent >= 0) {
 			unsigned long long delta;
 
 			printf("\%s\n", start_str);
-- 
2.9.3

[toc] | [next] | [standalone]


#1665267 — Re: [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp

FromJohn Stultz <john.stultz@linaro.org>
Date2017-06-14 01:00 +0200
SubjectRe: [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp
Message-ID<tS2X0-5sy-3@gated-at.bofh.it>
In reply to#1664744
On Tue, Jun 13, 2017 at 3:57 AM, Miroslav Lichvar <mlichvar@redhat.com> wrote:
> When the first timestamp in the list of clock readings was later than
> the second timestamp and all other timestamps were in order, the
> inconsistency was not reported because the index of the out-of-order
> timestamp was equal to the default value.
>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Richard Cochran <richardcochran@gmail.com>
> Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>

Queued up in my tree for testing, targeting 4.13.

thanks
-john

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web