VirtualBox

Changeset 31606 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 12, 2010 3:22:39 PM (14 years ago)
Author:
vboxsync
Message:

Timer init changes

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGM.cpp

    r31603 r31606  
    633633# ifdef DEBUG_sandervl
    634634static DECLCALLBACK(int)  pgmR3CmdCountPhysWrites(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     635static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser);
    635636# endif
    636637static DECLCALLBACK(int)  pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
     
    21412142    if (pVM->pgm.s.fRamPreAlloc)
    21422143        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
    21432149
    21442150    LogRel(("PGMR3InitFinalize: 4 MB PSE mask %RGp\n", pVM->pgm.s.GCPhys4MBPSEMask));
     
    43084314}
    43094315
     4316# ifdef DEBUG_sandervl
    43104317/**
    43114318 * Internal timer callback function.
     
    43154322 * @param   pvUser          User argument specified upon timer creation.
    43164323 */
    4317 DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser)
    4318 {
    4319     uint32_t uInterval = (uint32_t)(uintptr_t)pvUser;
    4320 
     4324static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser)
     4325{
    43214326    if (pVM->pgm.s.fCountingPhysWrites)
    43224327    {
     
    43244329
    43254330        /* Program next invocation. */
    4326         int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, uInterval);
     4331        int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, pVM->pgm.s.u32PhysWriteCountTimerInterval);
    43274332        AssertRC(rc);
    43284333    }
    43294334}
    43304335
    4331 # ifdef DEBUG_sandervl
    43324336/**
    43334337 * The '.pgmcountphyswrites' command.
     
    43584362
    43594363        TMTimerStop(pVM->pgm.s.pPhysWritesCountTimer);
    4360         TMR3TimerDestroy(pVM->pgm.s.pPhysWritesCountTimer);
    4361         pVM->pgm.s.pPhysWritesCountTimer = NULL;
    43624364        pVM->pgm.s.fCountingPhysWrites = false;
    43634365        return VINF_SUCCESS;
     
    43714373        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 2nd argument '%d', must be between 10 and 1000 ms.\n", paArgs[1].u.u64Number);
    43724374
    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;
    43774376    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);
    43794378    AssertRC(rc);
    43804379    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/PGMInternal.h

    r31600 r31606  
    31413141    /** @} */
    31423142
    3143 #ifdef VBOX_STRICT
     3143#ifdef DEBUG_sandervl
    31443144    PTMTIMERR3                      pPhysWritesCountTimer;
     3145    uint32_t                        u32PhysWriteCountTimerInterval;
    31453146    bool                            fCountingPhysWrites;
    3146     uint8_t                         u8Alignment[7];
     3147    uint8_t                         u8Alignment[3];
    31473148
    31483149    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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette