Changeset 31606 in vbox for trunk/src/VBox
- Timestamp:
- Aug 12, 2010 3:22:39 PM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r31603 r31606 633 633 # ifdef DEBUG_sandervl 634 634 static DECLCALLBACK(int) pgmR3CmdCountPhysWrites(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 635 static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser); 635 636 # endif 636 637 static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); … … 2141 2142 if (pVM->pgm.s.fRamPreAlloc) 2142 2143 rc = pgmR3PhysRamPreAllocate(pVM); 2144 2145 #ifdef DEBUG_sandervl 2146 rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, pgmR3PhysWriteCountTMCallback, NULL, "Physical page write counting timer", &pVM->pgm.s.pPhysWritesCountTimer); 2147 AssertRC(rc); 2148 #endif 2143 2149 2144 2150 LogRel(("PGMR3InitFinalize: 4 MB PSE mask %RGp\n", pVM->pgm.s.GCPhys4MBPSEMask)); … … 4308 4314 } 4309 4315 4316 # ifdef DEBUG_sandervl 4310 4317 /** 4311 4318 * Internal timer callback function. … … 4315 4322 * @param pvUser User argument specified upon timer creation. 4316 4323 */ 4317 DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser) 4318 { 4319 uint32_t uInterval = (uint32_t)(uintptr_t)pvUser; 4320 4324 static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser) 4325 { 4321 4326 if (pVM->pgm.s.fCountingPhysWrites) 4322 4327 { … … 4324 4329 4325 4330 /* Program next invocation. */ 4326 int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, uInterval);4331 int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, pVM->pgm.s.u32PhysWriteCountTimerInterval); 4327 4332 AssertRC(rc); 4328 4333 } 4329 4334 } 4330 4335 4331 # ifdef DEBUG_sandervl4332 4336 /** 4333 4337 * The '.pgmcountphyswrites' command. … … 4358 4362 4359 4363 TMTimerStop(pVM->pgm.s.pPhysWritesCountTimer); 4360 TMR3TimerDestroy(pVM->pgm.s.pPhysWritesCountTimer);4361 pVM->pgm.s.pPhysWritesCountTimer = NULL;4362 4364 pVM->pgm.s.fCountingPhysWrites = false; 4363 4365 return VINF_SUCCESS; … … 4371 4373 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 2nd argument '%d', must be between 10 and 1000 ms.\n", paArgs[1].u.u64Number); 4372 4374 4373 int rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, pgmR3PhysWriteCountTMCallback, (void *)(uint32_t)paArgs[1].u.u64Number, "Physical page write counting timer", &pVM->pgm.s.pPhysWritesCountTimer); 4374 if (RT_FAILURE(rc)) 4375 return rc; 4376 4375 pVM->pgm.s.u32PhysWriteCountTimerInterval = paArgs[1].u.u64Number; 4377 4376 pVM->pgm.s.fCountingPhysWrites = true; 4378 rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, paArgs[1].u.u64Number);4377 int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, paArgs[1].u.u64Number); 4379 4378 AssertRC(rc); 4380 4379 return VINF_SUCCESS; -
trunk/src/VBox/VMM/PGMInternal.h
r31600 r31606 3141 3141 /** @} */ 3142 3142 3143 #ifdef VBOX_STRICT3143 #ifdef DEBUG_sandervl 3144 3144 PTMTIMERR3 pPhysWritesCountTimer; 3145 uint32_t u32PhysWriteCountTimerInterval; 3145 3146 bool fCountingPhysWrites; 3146 uint8_t u8Alignment[ 7];3147 uint8_t u8Alignment[3]; 3147 3148 3148 3149 STAMCOUNTER StatR3FTPhysPageWrite; /**< R3: The number of times a physical page was written to (FT stats) */
Note:
See TracChangeset
for help on using the changeset viewer.