VirtualBox

Changeset 80654 in vbox


Ignore:
Timestamp:
Sep 8, 2019 11:51:15 PM (5 years ago)
Author:
vboxsync
Message:

Main/GuestImpl: Start the Guest::i_staticUpdateStats in paused mode so that it matches the default mStatUpdateInterval value (0) and change logic in Guest::setStatisticsUpdateInterval. No need to work STAM and PGM once a second and IPC the results into VBoxSVC. Also fixed missing seconds to nanoseconds conversion in two RTTimerLRChangeInterval calls, resulting in the timer always running at 1 Hz regardless of the update interval set by the API user.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestImpl.h

    r79296 r80654  
    220220
    221221    ULONG                           mMemoryBalloonSize;
    222     ULONG                           mStatUpdateInterval;
     222    ULONG                           mStatUpdateInterval; /**< In seconds. */
    223223    uint64_t                        mNetStatRx;
    224224    uint64_t                        mNetStatTx;
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r79294 r80654  
    108108
    109109    mMagic = GUEST_MAGIC;
    110     int vrc = RTTimerLRCreate(&mStatTimer, 1000 /* ms */,
    111                               &Guest::i_staticUpdateStats, this);
     110    int vrc = RTTimerLRCreateEx(&mStatTimer, RT_NS_1SEC, 0 /*fFlags*/, &Guest::i_staticUpdateStats, this);
    112111    AssertMsgRC(vrc, ("Failed to create guest statistics update timer (%Rrc) - ignored\n", vrc));
    113112
     
    628627
    629628    if (mStatUpdateInterval)
     629    {
    630630        if (aStatisticsUpdateInterval == 0)
    631631            RTTimerLRStop(mStatTimer);
    632632        else
    633             RTTimerLRChangeInterval(mStatTimer, aStatisticsUpdateInterval);
    634     else
    635         if (aStatisticsUpdateInterval != 0)
    636         {
    637             RTTimerLRChangeInterval(mStatTimer, aStatisticsUpdateInterval);
    638             RTTimerLRStart(mStatTimer, 0);
    639         }
     633            RTTimerLRChangeInterval(mStatTimer, aStatisticsUpdateInterval * RT_NS_1SEC_64);
     634    }
     635    else if (aStatisticsUpdateInterval != 0)
     636    {
     637        RTTimerLRChangeInterval(mStatTimer, aStatisticsUpdateInterval * RT_NS_1SEC_64);
     638        RTTimerLRStart(mStatTimer, 0);
     639    }
    640640    mStatUpdateInterval = aStatisticsUpdateInterval;
    641     /* forward the information to the VMM device */
     641
     642    /* Forward the information to the VMM device.
     643       MUST release all locks before calling VMM device as its critsect
     644       has higher lock order than anything in Main. */
    642645    VMMDev *pVMMDev = mParent->i_getVMMDev();
    643     /* MUST release all locks before calling VMM device as its critsect
    644      * has higher lock order than anything in Main. */
    645646    alock.release();
    646647    if (pVMMDev)
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