[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH xenbus] Log system timers pre- and post-suspend



It's useful to know what difference, if any, in the main system timers
Windows is subject to across a suspend/resume or migrate.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenbus/suspend.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c
index 18cae1b..5667e84 100644
--- a/src/xenbus/suspend.c
+++ b/src/xenbus/suspend.c
@@ -140,6 +140,46 @@ SuspendDeregister(
     __SuspendFree(Callback);
 }
 
+static FORCEINLINE VOID
+__SuspendLogTimers(
+    IN  const CHAR  *Prefix
+    )
+{
+    LARGE_INTEGER   SystemTime;
+    LARGE_INTEGER   TickCount;
+    ULONG           TimeIncrement;
+    LARGE_INTEGER   PerformanceCounter;
+    LARGE_INTEGER   PerformanceFrequency;
+
+    KeQuerySystemTime(&SystemTime);
+
+    TimeIncrement = KeQueryTimeIncrement();
+    KeQueryTickCount(&TickCount);
+
+    PerformanceCounter = KeQueryPerformanceCounter(&PerformanceFrequency);
+
+    LogPrintf(LOG_LEVEL_INFO,
+              "%s: SystemTime = %08x.%08x\n",
+              Prefix,
+              SystemTime.HighPart,
+              SystemTime.LowPart);
+
+    LogPrintf(LOG_LEVEL_INFO,
+              "%s: TickCount = %08x.%08x (TimeIncrement = %08x)\n",
+              Prefix,
+              TickCount.HighPart,
+              TickCount.LowPart,
+              TimeIncrement);
+
+    LogPrintf(LOG_LEVEL_INFO,
+              "%s: PerformanceCounter = %08x.%08x (Frequency = %08x.%08x)\n",
+              Prefix,
+              PerformanceCounter.HighPart,
+              PerformanceCounter.LowPart,
+              PerformanceFrequency.HighPart,
+              PerformanceFrequency.LowPart);
+}
+
 NTSTATUS
 #pragma prefast(suppress:28167) // Function changes IRQL
 SuspendTrigger(
@@ -158,6 +198,8 @@ SuspendTrigger(
     SyncCapture();
     SyncDisableInterrupts();
 
+    __SuspendLogTimers("PRE-SUSPEND");
+
     LogPrintf(LOG_LEVEL_INFO,
               "SUSPEND: SCHEDOP_shutdown:SHUTDOWN_suspend ====>\n");
     status = SchedShutdown(SHUTDOWN_suspend);
@@ -165,6 +207,8 @@ SuspendTrigger(
               "SUSPEND: SCHEDOP_shutdown:SHUTDOWN_suspend <==== (%08x)\n",
               status);
 
+    __SuspendLogTimers("POST-SUSPEND");
+
     if (NT_SUCCESS(status)) {
         PLIST_ENTRY ListEntry;
 
-- 
2.5.3


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.