]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Enable time step correction log in all builds.
authorJohn Wolfe <jwolfe@vmware.com>
Mon, 7 Feb 2022 17:40:00 +0000 (09:40 -0800)
committerJohn Wolfe <jwolfe@vmware.com>
Mon, 7 Feb 2022 17:40:00 +0000 (09:40 -0800)
Enabled logging of the information in all builds of open-vm-tools.
This is useful for auditing and for debugging.

open-vm-tools/services/plugins/timeSync/timeSync.c

index f2f2c1ed910281519f1c7ff1634022c29db646e8..8c48cbd0dc6bd3aaad862edbeb8662b0ffc04df2 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2008-2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2022 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -410,9 +410,7 @@ TimeSyncStepTime(TimeSyncData *data, int64 adjustment)
    int64 before;
    int64 after;
 
-   if (vmx86_debug) {
-      TimeSync_GetCurrentTime(&before);
-   }
+   TimeSync_GetCurrentTime(&before);
 
    /* Stepping invalidates the current slew, reset to nominal. */
    TimeSyncSetSlewState(data, FALSE);
@@ -421,21 +419,19 @@ TimeSyncStepTime(TimeSyncData *data, int64 adjustment)
       return FALSE;
    }
 
-   /* 
+   /*
     * Tell timetracker to stop trying to catch up, since we have corrected
-    * both the guest OS error and the apparent time error. 
+    * both the guest OS error and the apparent time error.
     */
    bp.in.cx.halfs.low = BDOOR_CMD_STOPCATCHUP;
    Backdoor(&bp);
 
-   if (vmx86_debug) {
-      TimeSync_GetCurrentTime(&after);
-      
-      g_debug("Time changed by %"FMT64"dus from %"FMT64"d.%06"FMT64"d -> "
-              "%"FMT64"d.%06"FMT64"d\n", adjustment,
-              before / US_PER_SEC, before % US_PER_SEC, 
-              after / US_PER_SEC, after % US_PER_SEC);
-   }
+   TimeSync_GetCurrentTime(&after);
+
+   g_debug("Time changed by %"FMT64"dus from %"FMT64"d.%06"FMT64"d -> "
+           "%"FMT64"d.%06"FMT64"d\n", adjustment,
+           before / US_PER_SEC, before % US_PER_SEC,
+           after / US_PER_SEC, after % US_PER_SEC);
 
    return TRUE;
 }