* [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp
@ 2017-06-13 10:57 Miroslav Lichvar
2017-06-13 22:54 ` John Stultz
0 siblings, 1 reply; 2+ messages in thread
From: Miroslav Lichvar @ 2017-06-13 10:57 UTC (permalink / raw)
To: linux-kernel; +Cc: John Stultz, Prarit Bhargava, Richard Cochran
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp
2017-06-13 10:57 [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp Miroslav Lichvar
@ 2017-06-13 22:54 ` John Stultz
0 siblings, 0 replies; 2+ messages in thread
From: John Stultz @ 2017-06-13 22:54 UTC (permalink / raw)
To: Miroslav Lichvar; +Cc: lkml, Prarit Bhargava, Richard Cochran
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-13 22:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-13 10:57 [PATCH] kselftests: timers: Fix inconsistency-check to not ignore first timestamp Miroslav Lichvar
2017-06-13 22:54 ` John Stultz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®