VirtualBox

Changeset 25415 in vbox


Ignore:
Timestamp:
Dec 15, 2009 5:04:40 PM (15 years ago)
Author:
vboxsync
Message:

Main/PerformanceSolaris: #4555 - account ZFS cache size while collecting RAM usage metrics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/solaris/PerformanceSolaris.cpp

    r14948 r25415  
    5353    kstat_ctl_t *mKC;
    5454    kstat_t     *mSysPages;
     55    kstat_t     *mZFSCache;
    5556};
    5657
     
    6364
    6465
    65 CollectorSolaris::CollectorSolaris() : mKC(0), mSysPages(0)
     66CollectorSolaris::CollectorSolaris()
     67    : mKC(0),
     68      mSysPages(0),
     69      mZFSCache(0)
    6670{
    6771    if ((mKC = kstat_open()) == 0)
     
    7579        Log(("kstat_lookup(system_pages) -> %d\n", errno));
    7680        return;
     81    }
     82
     83    if ((mZFSCache = kstat_lookup(mKC, "zfs", 0, "arcstats")) == 0)
     84    {
     85        Log(("kstat_lookup(system_pages) -> %d\n", errno));
    7786    }
    7887}
     
    180189    }
    181190    *available = kn->value.ul * (PAGE_SIZE/1024);
     191
     192    // Optional don't fail if kstat is missing; as ZFS kstats are not be available for SunOS < 5.10 U8
     193    if (kstat_read(mKC, mZFSCache, 0) != -1)
     194    {
     195        if (mZFSCache)
     196        {
     197            if ((kn = (kstat_named_t *)kstat_data_lookup(mZFSCache, "size")))
     198                *available += (kn->value.ul / 1024);
     199            else
     200                Log(("kstat_data_lookup(size) -> %d\n", errno));
     201        }
     202        else
     203            Log(("mZFSCache missing.\n"));
     204    }
     205
    182206    if ((kn = (kstat_named_t *)kstat_data_lookup(mSysPages, "physmem")) == 0)
    183207    {
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