VirtualBox

Changeset 20678 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 18, 2009 9:22:30 AM (16 years ago)
Author:
vboxsync
Message:

TM: Count calls to TMCpuTickSet and take the VM handle as an argument.

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

Legend:

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

    r20374 r20678  
    602602    STAM_REG(pVM, &pVM->tm.s.StatTSCSyncNotTicking,                   STAMTYPE_COUNTER, "/TM/TSC/Intercept/SyncNotTicking",    STAMUNIT_OCCURENCES, "VirtualSync isn't ticking.");
    603603    STAM_REG(pVM, &pVM->tm.s.StatTSCWarp,                             STAMTYPE_COUNTER, "/TM/TSC/Intercept/Warp",              STAMUNIT_OCCURENCES, "Warpdrive is active.");
     604    STAM_REG(pVM, &pVM->tm.s.StatTSCSet,                              STAMTYPE_COUNTER, "/TM/TSC/Sets",                        STAMUNIT_OCCURENCES, "Calls to TMCpuTickSet.");
    604605
    605606    STAM_REG(pVM, &pVM->tm.s.StatVirtualSyncCatchup,              STAMTYPE_PROFILE_ADV, "/TM/VirtualSync/CatchUp",    STAMUNIT_TICKS_PER_OCCURENCE, "Counting and measuring the times spent catching up.");
  • trunk/src/VBox/VMM/TMInternal.h

    r20374 r20678  
    508508    STAMCOUNTER                 StatTimerCallbackSetFF;
    509509
     510    /** Calls to TMCpuTickSet. */
     511    STAMCOUNTER                 StatTSCSet;
     512
    510513    /** @name Reasons for refusing TSC offsetting in TMCpuTickCanUseRealTSC.
    511514     * @{ */
  • trunk/src/VBox/VMM/VMMAll/TMAllCpu.cpp

    r20675 r20678  
    245245 *
    246246 * @returns VBox status code.
    247  * @param   pVCpu       The VMCPU to operate on.
     247 * @param   pVM         The VM handle.
     248 * @param   pVCpu       The virtual CPU to operate on.
    248249 * @param   u64Tick     The new timestamp value.
    249  */
    250 VMMDECL(int) TMCpuTickSet(PVMCPU pVCpu, uint64_t u64Tick)
    251 {
     250 *
     251 * @thread  EMT which TSC is to be set.
     252 */
     253VMMDECL(int) TMCpuTickSet(PVM pVM, PVMCPU pVCpu, uint64_t u64Tick)
     254{
     255    VMCPU_ASSERT_EMT(pVCpu);
     256    STAM_COUNTER_INC(&pVM->tm.s.StatTSCSet);
     257
    252258    /*
    253259     * This is easier to do when the TSC is paused since resume will
    254260     * do all the calcuations for us.
    255261     */
    256     PVM     pVM         = pVCpu->CTX_SUFF(pVM);
    257262    bool    fTSCTicking = pVCpu->tm.s.fTSCTicking;
    258263    if (fTSCTicking)
    259264        tmCpuTickPause(pVM, pVCpu);
     265
    260266    pVCpu->tm.s.u64TSC = u64Tick;
     267    /** @todo Try help synchronizing it better among the virtual CPUs? */
    261268
    262269    if (fTSCTicking)
    263270        tmCpuTickResume(pVM, pVCpu);
    264     /** @todo Try help synchronizing it better among the virtual CPUs? */
    265271    return VINF_SUCCESS;
    266272}
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