From 34f493d553f37f07d3c29f74dc13d7f3aac5051e Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 8 Oct 2016 20:29:16 -0700 Subject: [PATCH] capture: use SpClock for current timestamp It is important that our capture current time matches the same clock we are using for events. Otherwise we could have drift between CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW. --- lib/sp-capture-types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sp-capture-types.h b/lib/sp-capture-types.h index 94ed1ecf..84178bea 100644 --- a/lib/sp-capture-types.h +++ b/lib/sp-capture-types.h @@ -25,6 +25,8 @@ # include #endif +#include "sp-clock.h" + G_BEGIN_DECLS #define SP_CAPTURE_MAGIC (GUINT32_TO_LE(0xFDCA975E)) @@ -38,7 +40,7 @@ G_BEGIN_DECLS # define SP_CAPTURE_ADDRESS_FORMAT "0x%016llx" #endif -#define SP_CAPTURE_CURRENT_TIME (g_get_monotonic_time() * 1000L) +#define SP_CAPTURE_CURRENT_TIME (sp_clock_get_current_time()) #define SP_CAPTURE_COUNTER_INT64 0 #define SP_CAPTURE_COUNTER_DOUBLE 1