VirtualBox

Changeset 28038 in vbox


Ignore:
Timestamp:
Apr 7, 2010 10:09:36 AM (15 years ago)
Author:
vboxsync
Message:

Wrong units

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/GuestImpl.cpp

    r28036 r28038  
    272272    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    273273
    274     *aCpuUser = mCurrentGuestStat[GUESTSTATTYPE_CPUUSER];
    275     *aCpuKernel = mCurrentGuestStat[GUESTSTATTYPE_CPUKERNEL];
    276     *aCpuIdle = mCurrentGuestStat[GUESTSTATTYPE_CPUIDLE];
    277     *aMemTotal = mCurrentGuestStat[GUESTSTATTYPE_MEMTOTAL];
    278     *aMemFree = mCurrentGuestStat[GUESTSTATTYPE_MEMFREE];
    279     *aMemBalloon = mCurrentGuestStat[GUESTSTATTYPE_MEMBALLOON];
    280     *aMemCache = mCurrentGuestStat[GUESTSTATTYPE_MEMCACHE];
    281     *aPageTotal = mCurrentGuestStat[GUESTSTATTYPE_PAGETOTAL];
     274    *aCpuUser = mCurrentGuestStat[GUESTSTATTYPE_CPUUSER] / (_4K/_1K);   /* page (4K) -> 1 KB units */
     275    *aCpuKernel = mCurrentGuestStat[GUESTSTATTYPE_CPUKERNEL] / (_4K/_1K);
     276    *aCpuIdle = mCurrentGuestStat[GUESTSTATTYPE_CPUIDLE] / (_4K/_1K);
     277    *aMemTotal = mCurrentGuestStat[GUESTSTATTYPE_MEMTOTAL] / (_4K/_1K);
     278    *aMemFree = mCurrentGuestStat[GUESTSTATTYPE_MEMFREE] / (_4K/_1K);
     279    *aMemBalloon = mCurrentGuestStat[GUESTSTATTYPE_MEMBALLOON] / (_4K/_1K);
     280    *aMemCache = mCurrentGuestStat[GUESTSTATTYPE_MEMCACHE] / (_4K/_1K);
     281    *aPageTotal = mCurrentGuestStat[GUESTSTATTYPE_PAGETOTAL] / (_4K/_1K);
    282282
    283283    Console::SafeVMPtr pVM (mParent);
  • trunk/src/VBox/Main/Performance.cpp

    r28036 r28038  
    433433
    434434    mGuestHAL->getGuestMemLoad(&ulMemTotal, &ulMemFree, &ulMemBalloon, &ulMemCache, &ulPageTotal);
    435     mTotal->put(ulMemTotal * (_1M / _1K));      /* MB -> KB */
    436     mFree->put(ulMemFree * (_1M / _1K));
    437     mBallooned->put(ulMemBalloon * (_1M / _1K));
    438     mCache->put(ulMemCache * (_1M / _1K));
    439     mPagedTotal->put(ulPageTotal * (_1M / _1K));
     435    mTotal->put(ulMemTotal);
     436    mFree->put(ulMemFree);
     437    mBallooned->put(ulMemBalloon);
     438    mCache->put(ulMemCache);
     439    mPagedTotal->put(ulPageTotal);
    440440}
    441441
  • trunk/src/VBox/Main/include/Performance.h

    r28036 r28038  
    207207        }
    208208
    209         /** Return guest memory information in MB. */
     209        /** Return guest memory information in KB. */
    210210        void getGuestMemLoad(ULONG *pulMemTotal, ULONG *pulMemFree, ULONG *pulMemBalloon, ULONG *pulMemCache, ULONG *pulPageTotal)
    211211        {
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