VirtualBox

Changeset 13586 in vbox


Ignore:
Timestamp:
Oct 27, 2008 4:33:51 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38493
Message:

TM: extended the statistics to get an idea about the normal catchup rate.

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

Legend:

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

    r13572 r13586  
    538538    STAM_REG(pVM, &pVM->tm.s.StatTimerCallbackSetFF,STAMTYPE_COUNTER,       "/TM/CallbackSetFF",    STAMUNIT_OCCURENCES,        "The number of times the timer callback set FF.");
    539539
    540     STAM_REG(pVM, &pVM->tm.s.StatTSCNotFixed,       STAMTYPE_COUNTER,       "/TM/TSC/Intercept/NotFixed",         STAMUNIT_OCCURENCES,        "The number of times TMCpuTickCanUseRealTSC forced rdtsc intercept.");
    541     STAM_REG(pVM, &pVM->tm.s.StatTSCNotTicking,     STAMTYPE_COUNTER,       "/TM/TSC/Intercept/NotTicking",       STAMUNIT_OCCURENCES,        "The number of times TMCpuTickCanUseRealTSC forced rdtsc intercept.");
    542     STAM_REG(pVM, &pVM->tm.s.StatTSCCatchup,        STAMTYPE_COUNTER,       "/TM/TSC/Intercept/Catchup",          STAMUNIT_OCCURENCES,        "The number of times TMCpuTickCanUseRealTSC forced rdtsc intercept.");
    543     STAM_REG(pVM, &pVM->tm.s.StatTSCWarp,           STAMTYPE_COUNTER,       "/TM/TSC/Intercept/Warp",             STAMUNIT_OCCURENCES,        "The number of times TMCpuTickCanUseRealTSC forced rdtsc intercept.");
    544     STAM_REG(pVM, &pVM->tm.s.StatTSCSyncNotTicking, STAMTYPE_COUNTER,       "/TM/TSC/Intercept/SyncNotTicking",       STAMUNIT_OCCURENCES,        "The number of times TMCpuTickCanUseRealTSC forced rdtsc intercept.");
     540    STAM_REG(pVM, &pVM->tm.s.StatTSCCatchupLE010,   STAMTYPE_COUNTER,       "/TM/TSC/Intercept/CatchupLE010",     STAMUNIT_OCCURENCES,        "In catch-up mode, 10% or lower.");
     541    STAM_REG(pVM, &pVM->tm.s.StatTSCCatchupLE025,   STAMTYPE_COUNTER,       "/TM/TSC/Intercept/CatchupLE025",     STAMUNIT_OCCURENCES,        "In catch-up mode, 25%-11%.");
     542    STAM_REG(pVM, &pVM->tm.s.StatTSCCatchupLE100,   STAMTYPE_COUNTER,       "/TM/TSC/Intercept/CatchupLE100",     STAMUNIT_OCCURENCES,        "In catch-up mode, 100%-26%.");
     543    STAM_REG(pVM, &pVM->tm.s.StatTSCCatchupOther,   STAMTYPE_COUNTER,       "/TM/TSC/Intercept/CatchupOther",     STAMUNIT_OCCURENCES,        "In catch-up mode, > 100%.");
     544    STAM_REG(pVM, &pVM->tm.s.StatTSCNotFixed,       STAMTYPE_COUNTER,       "/TM/TSC/Intercept/NotFixed",         STAMUNIT_OCCURENCES,        "TSC is not fixed, it may run at variable speed.");
     545    STAM_REG(pVM, &pVM->tm.s.StatTSCNotTicking,     STAMTYPE_COUNTER,       "/TM/TSC/Intercept/NotTicking",       STAMUNIT_OCCURENCES,        "TSC is not ticking.");
     546    STAM_REG(pVM, &pVM->tm.s.StatTSCSyncNotTicking, STAMTYPE_COUNTER,       "/TM/TSC/Intercept/SyncNotTicking",   STAMUNIT_OCCURENCES,        "VirtualSync isn't ticking.");
     547    STAM_REG(pVM, &pVM->tm.s.StatTSCWarp,           STAMTYPE_COUNTER,       "/TM/TSC/Intercept/Warp",             STAMUNIT_OCCURENCES,        "Warpdrive is active.");
    545548
    546549
  • trunk/src/VBox/VMM/TMInternal.h

    r13572 r13586  
    488488    STAMCOUNTER                 StatTimerCallbackSetFF;
    489489
    490 
     490    /** @name Reasons for refusing TSC offsetting in TMCpuTickCanUseRealTSC.
     491     * @{ */
    491492    STAMCOUNTER                 StatTSCNotFixed;
    492493    STAMCOUNTER                 StatTSCNotTicking;
    493     STAMCOUNTER                 StatTSCCatchup;
     494    STAMCOUNTER                 StatTSCCatchupLE010;
     495    STAMCOUNTER                 StatTSCCatchupLE025;
     496    STAMCOUNTER                 StatTSCCatchupLE100;
     497    STAMCOUNTER                 StatTSCCatchupOther;
    494498    STAMCOUNTER                 StatTSCWarp;
    495499    STAMCOUNTER                 StatTSCSyncNotTicking;
     500    /** @} */
    496501} TM;
    497502/** Pointer to TM VM instance data. */
  • trunk/src/VBox/VMM/VMMAll/TMAllCpu.cpp

    r13572 r13586  
    148148     *          c) we're not using warp drive (accelerated virtual guest time).
    149149     */
    150 #ifdef VBOX_WITH_STATISTICS
    151     if (!pVM->tm.s.fMaybeUseOffsettedHostTSC)
    152        STAM_COUNTER_INC(&pVM->tm.s.StatTSCNotFixed);
    153     else
    154     if (!pVM->tm.s.fTSCTicking)
    155        STAM_COUNTER_INC(&pVM->tm.s.StatTSCNotTicking);
    156     else
    157     if (!pVM->tm.s.fTSCUseRealTSC)
    158     {
    159         if (pVM->tm.s.fVirtualSyncCatchUp)
    160            STAM_COUNTER_INC(&pVM->tm.s.StatTSCCatchup);
    161         else
    162         if (!pVM->tm.s.fVirtualSyncTicking)
    163            STAM_COUNTER_INC(&pVM->tm.s.StatTSCSyncNotTicking);
    164         else
    165         if (!pVM->tm.s.fVirtualWarpDrive)
    166            STAM_COUNTER_INC(&pVM->tm.s.StatTSCWarp);
    167     }
    168 #endif
    169 
    170150    if (    pVM->tm.s.fMaybeUseOffsettedHostTSC
    171151        &&  RT_LIKELY(pVM->tm.s.fTSCTicking)
     
    200180                *poffRealTSC = 0;
    201181        }
     182        /** @todo count this? */
    202183        return true;
    203184    }
    204185
     186#ifdef VBOX_WITH_STATISTICS
     187    /* Sample the reason for refusing. */
     188    if (!pVM->tm.s.fMaybeUseOffsettedHostTSC)
     189       STAM_COUNTER_INC(&pVM->tm.s.StatTSCNotFixed);
     190    else if (!pVM->tm.s.fTSCTicking)
     191       STAM_COUNTER_INC(&pVM->tm.s.StatTSCNotTicking);
     192    else if (!pVM->tm.s.fTSCUseRealTSC)
     193    {
     194        if (pVM->tm.s.fVirtualSyncCatchUp)
     195        {
     196           if (pVM->tm.s.u32VirtualSyncCatchUpPercentage <= 10)
     197               STAM_COUNTER_INC(&pVM->tm.s.StatTSCCatchupLE010);
     198           else if (pVM->tm.s.u32VirtualSyncCatchUpPercentage <= 25)
     199               STAM_COUNTER_INC(&pVM->tm.s.StatTSCCatchupLE025);
     200           else if (pVM->tm.s.u32VirtualSyncCatchUpPercentage <= 100)
     201               STAM_COUNTER_INC(&pVM->tm.s.StatTSCCatchupLE100);
     202           else
     203               STAM_COUNTER_INC(&pVM->tm.s.StatTSCCatchupOther);
     204        }
     205        else if (!pVM->tm.s.fVirtualSyncTicking)
     206           STAM_COUNTER_INC(&pVM->tm.s.StatTSCSyncNotTicking);
     207        else if (pVM->tm.s.fVirtualWarpDrive)
     208           STAM_COUNTER_INC(&pVM->tm.s.StatTSCWarp);
     209    }
     210#endif
    205211    return false;
    206212}
Note: See TracChangeset for help on using the changeset viewer.

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