Current code is mixing wall and monotonic clocks and the traces are not
useful since the timestamps are not accurate. This patch fixes it by
using the same time reference for the log as used in the code.

Without this patch, the traces look like this:
compacting database online (1519124364.908 seconds old, 951 transactions)

Signed-off-by: Daniel Alvarez <dalva...@redhat.com>
---
 ovsdb/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ovsdb/file.c b/ovsdb/file.c
index 90c2b9d20..4b7ad52ab 100644
--- a/ovsdb/file.c
+++ b/ovsdb/file.c
@@ -655,7 +655,7 @@ ovsdb_file_compact(struct ovsdb_file *file)
 
     comment = xasprintf("compacting database online "
                         "(%.3f seconds old, %u transactions)",
-                        (time_wall_msec() - file->last_compact) / 1000.0,
+                        (time_msec() - file->last_compact) / 1000.0,
                         file->n_transactions);
     VLOG_INFO("%s: %s", file->file_name, comment);
 
-- 
2.13.5

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to