From 7d740f17e572fb2e2675ab71a69608d862a24ec9 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 20 Jun 2014 16:25:01 +0200 Subject: [PATCH] phc2sys: Use CLOCK_MONOTONIC to time pmc updates. After moving the leap second check away from update_pmc(), the time stamp is used only to control the pmc update interval. Switch to CLOCK_MONOTONIC to keep the interval stable when CLOCK_REALTIME is stepped. --- phc2sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index e063372..06fbddb 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -1055,7 +1055,7 @@ static int update_pmc(struct node *node, int subscribe) struct timespec tp; uint64_t ts; - if (clock_gettime(CLOCK_REALTIME, &tp)) { + if (clock_gettime(CLOCK_MONOTONIC, &tp)) { pr_err("failed to read clock: %m"); return -1; }