repository: C:/dev/kvm-guest-drivers-windows branch: master commit e80717e6d341ba9657411baf34393363f9ec7f3d Author: Yan Vugenfirer <yvugenfi@xxxxxxxxxx> Date: Wed Jul 13 14:58:21 2011 +0300 [NetKVM] Debug printouts with timestamps to enable debugging of Power managment events (S3, S4) diff --git a/NetKVM/Common/ndis56common.h b/NetKVM/Common/ndis56common.h index f80c287..cfc2c7a 100644 --- a/NetKVM/Common/ndis56common.h +++ b/NetKVM/Common/ndis56common.h @@ -270,6 +270,7 @@ typedef struct _tagPARANDIS_ADAPTER BOOLEAN bDoKickOnNoBuffer; BOOLEAN bSurprizeRemoved; BOOLEAN bUsingMSIX; + UINT uNumberOfHandledRXPacketsInDPC; NDIS_DEVICE_POWER_STATE powerState; LONG dpcReceiveActive; LONG counterDPCInside; diff --git a/NetKVM/wlh/ParaNdis6-Driver.c b/NetKVM/wlh/ParaNdis6-Driver.c index 9e7a06a..1c753d2 100644 --- a/NetKVM/wlh/ParaNdis6-Driver.c +++ b/NetKVM/wlh/ParaNdis6-Driver.c @@ -490,6 +490,7 @@ static NDIS_STATUS ParaNdis6_Restart( NDIS_STATUS status = NDIS_STATUS_SUCCESS; PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)miniportAdapterContext; DEBUG_ENTRY(0); + ParaNdis_DebugHistory(pContext, hopSysResume, NULL, 1, 0, 0); ParaNdis6_SendPauseRestart(pContext, FALSE, NULL); ParaNdis6_ReceivePauseRestart(pContext, FALSE, NULL); @@ -985,11 +986,21 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath { NDIS_STATUS status = NDIS_STATUS_FAILURE; NDIS_MINIPORT_DRIVER_CHARACTERISTICS chars; +#ifdef DEBUG_TIMING + LARGE_INTEGER TickCount; + LARGE_INTEGER SysTime; +#endif DEBUG_TIMING ParaNdis_DebugInitialize(pDriverObject, pRegistryPath); DEBUG_ENTRY(0); _LogOutString(0, __DATE__ " " __TIME__); +#ifdef DEBUG_TIMING + KeQueryTickCount(&TickCount); + NdisGetCurrentSystemTime(&SysTime); + DPrintf(0, ("\n%s>> CPU #%d, perf-counter %I64d, tick count %I64d, NDIS_sys_time %I64d\n", __FUNCTION__, KeGetCurrentProcessorNumber(), KeQueryPerformanceCounter(NULL).QuadPart,TickCount.QuadPart, SysTime.QuadPart)); +#endif + NdisZeroMemory(&chars, sizeof(chars)); chars.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS; diff --git a/NetKVM/wlh/ParaNdis6-Oid.c b/NetKVM/wlh/ParaNdis6-Oid.c index e71e80c..86a2e68 100644 --- a/NetKVM/wlh/ParaNdis6-Oid.c +++ b/NetKVM/wlh/ParaNdis6-Oid.c @@ -441,6 +441,15 @@ static void OnSetPowerWorkItem(PVOID WorkItemContext, NDIS_HANDLE NdisIoWorkIt PARANDIS_ADAPTER *pContext = pwi->pContext; PNDIS_OID_REQUEST pRequest = (PNDIS_OID_REQUEST)pwi->request; NDIS_STATUS status = NDIS_STATUS_SUCCESS; +#ifdef DEBUG_TIMING + LARGE_INTEGER TickCount; + LARGE_INTEGER SysTime; + + KeQueryTickCount(&TickCount); + NdisGetCurrentSystemTime(&SysTime); + DPrintf(0, ("\n%s>> CPU #%d, perf-counter %I64d, tick count %I64d, NDIS_sys_time %I64d\n", __FUNCTION__, KeGetCurrentProcessorNumber(), KeQueryPerformanceCounter(NULL).QuadPart,TickCount.QuadPart, SysTime.QuadPart)); +#endif + if (pwi->state == NetDeviceStateD0) { ParaNdis_PowerOn(pContext); @@ -463,7 +472,17 @@ NDIS_STATUS ParaNdis_OnSetPower(PARANDIS_ADAPTER *pContext, tOidDesc *pOid) { NDIS_STATUS status; NDIS_DEVICE_POWER_STATE newState; +#ifdef DEBUG_TIMING + LARGE_INTEGER TickCount; + LARGE_INTEGER SysTime; + + KeQueryTickCount(&TickCount); + NdisGetCurrentSystemTime(&SysTime); + DPrintf(0, ("\n%s>> CPU #%d, perf-counter %I64d, tick count %I64d, NDIS_sys_time %I64d\n", __FUNCTION__, KeGetCurrentProcessorNumber(), KeQueryPerformanceCounter(NULL).QuadPart,TickCount.QuadPart, SysTime.QuadPart)); +#endif + DEBUG_ENTRY(0); + status = ParaNdis_OidSetCopy(pOid, &newState, sizeof(newState)); if (status == NDIS_STATUS_SUCCESS) { -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html