Changeset 70778 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jan 28, 2018 10:09:24 PM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
r69111 r70778 30 30 #include <iprt/path.h> 31 31 #include <iprt/string.h> 32 #include <iprt/trace.h> 32 33 #include <VBox/log.h> 33 34 #include <VBox/vmm/stam.h> … … 67 68 #define PDM_BLK_CACHE_SAVED_STATE_VERSION 1 68 69 70 /* Enable to enable some tracing in the block cache code for investigating issues. */ 71 /*#define VBOX_BLKCACHE_TRACING 1*/ 69 72 70 73 /********************************************************************************************************************************* … … 75 78 uint64_t off, size_t cbData, uint8_t *pbBuffer); 76 79 static bool pdmBlkCacheAddDirtyEntry(PPDMBLKCACHE pBlkCache, PPDMBLKCACHEENTRY pEntry); 80 81 82 /** 83 * Add message to the VM trace buffer. 84 * 85 * @returns nothing. 86 * @param pBlkCache The block cache. 87 * @param pszFmt The format string. 88 * @param ... Additional parameters for the string formatter. 89 */ 90 DECLINLINE(void) pdmBlkCacheR3TraceMsgF(PPDMBLKCACHE pBlkCache, const char *pszFmt, ...) 91 { 92 #if defined(VBOX_BLKCACHE_TRACING) 93 va_list va; 94 va_start(va, pszFmt); 95 RTTraceBufAddMsgV(pBlkCache->pCache->pVM->CTX_SUFF(hTraceBuf), pszFmt, va); 96 va_end(va); 97 #else 98 RT_NOREF2(pBlkCache, pszFmt); 99 #endif 100 } 77 101 78 102 /** … … 492 516 __FUNCTION__, pIoXfer, pIoXfer->enmXferDir)); 493 517 518 ASMAtomicIncU32(&pBlkCache->cIoXfersActive); 519 pdmBlkCacheR3TraceMsgF(pBlkCache, "BlkCache: I/O req %#p (%RTbool , %d) queued (%u now active)", 520 pIoXfer, pIoXfer->fIoCache, pIoXfer->enmXferDir, pBlkCache->cIoXfersActive); 521 494 522 switch (pBlkCache->enmType) 495 523 { … … 528 556 default: 529 557 AssertMsgFailed(("Unknown block cache type!\n")); 558 } 559 560 if (RT_FAILURE(rc)) 561 { 562 pdmBlkCacheR3TraceMsgF(pBlkCache, "BlkCache: Queueing I/O req %#p failed %Rrc", pIoXfer, rc); 563 ASMAtomicDecU32(&pBlkCache->cIoXfersActive); 530 564 } 531 565 … … 1218 1252 { 1219 1253 pBlkCache->fSuspended = false; 1254 pBlkCache->cIoXfersActive = 0; 1220 1255 pBlkCache->pCache = pBlkCacheGlobal; 1221 1256 RTListInit(&pBlkCache->ListDirtyNotCommitted); … … 2676 2711 else 2677 2712 pdmBlkCacheReqUpdate(pBlkCache, hIoXfer->pReq, rcIoXfer, true); 2713 2714 ASMAtomicDecU32(&pBlkCache->cIoXfersActive); 2715 pdmBlkCacheR3TraceMsgF(pBlkCache, "BlkCache: I/O req %#p (%RTbool) completed (%u now active)", 2716 hIoXfer, hIoXfer->fIoCache, pBlkCache->cIoXfersActive); 2678 2717 RTMemFree(hIoXfer); 2679 2718 } -
trunk/src/VBox/VMM/include/PDMBlkCacheInternal.h
r69111 r70778 263 263 /** Flag whether the cache was suspended. */ 264 264 volatile bool fSuspended; 265 /** Number of outstanding I/O transfers. */ 266 volatile uint32_t cIoXfersActive; 265 267 266 268 } PDMBLKCACHE, *PPDMBLKCACHE;
Note:
See TracChangeset
for help on using the changeset viewer.