Miroslav Lichvar
2014-06-20 14:25:01 UTC
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 87c1749..224c03e 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;
}
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 87c1749..224c03e 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;
}
--
1.9.3
1.9.3