VirtualBox

Changeset 43835 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Nov 8, 2012 6:43:02 AM (12 years ago)
Author:
vboxsync
Message:

Main/Metrics: Fix for UFS (#6345)

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

Legend:

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

    r43831 r43835  
    7979    void updateFilesystemMap(void);
    8080    RTCString physToInstName(const char *pcszPhysName);
     81    RTCString pathToInstName(const char *pcszDevPathName);
    8182
    8283    kstat_ctl_t *mKC;
     
    539540}
    540541
     542RTCString CollectorSolaris::pathToInstName(const char *pcszDevPathName)
     543{
     544    char szLink[RTPATH_MAX];
     545    if (readlink(pcszDevPathName, szLink, sizeof(szLink)) != -1)
     546    {
     547        char *pszStart, *pszEnd;
     548        pszStart = strstr(szLink, "/devices/");
     549        pszEnd = strrchr(szLink, ':');
     550        if (pszStart && pszEnd)
     551        {
     552            pszStart += 8; // Skip "/devices"
     553            *pszEnd = '\0'; // Trim partition
     554            return physToInstName(pszStart);
     555        }
     556    }
     557
     558    return RTCString(pcszDevPathName);
     559}
     560
    541561int CollectorSolaris::getDiskListByFs(const char *name, DiskList& list)
    542562{
     
    546566
    547567    RTCString strName = it->second.substr(0, it->second.find("/"));
    548     if (mZpoolOpen && mZpoolClose && mZpoolGetConfig)
     568    if (mZpoolOpen && mZpoolClose && mZpoolGetConfig && !strName.isEmpty())
    549569    {
    550570        zpool_handle_t *zh = mZpoolOpen(mZfsLib, strName.c_str());
     
    591611    }
    592612    else
    593         list.push_back(RTCString(name));
     613        list.push_back(pathToInstName(it->second.c_str()));
    594614    return VINF_SUCCESS;
    595615}
  • trunk/src/VBox/Main/testcase/tstCollector.cpp

    r43831 r43835  
    246246    if (RT_FAILURE(rc))
    247247    {
    248         RTPrintf("tstCollector: getRawHostNetworkLoad() -> %Rrc\n", rc);
     248        RTPrintf("tstCollector: getRawHostDiskLoad() -> %Rrc\n", rc);
    249249        return 1;
    250250    }
     
    261261    if (RT_FAILURE(rc))
    262262    {
    263         RTPrintf("tstCollector: getRawHostNetworkLoad() -> %Rrc\n", rc);
     263        RTPrintf("tstCollector: getRawHostDiskLoad() -> %Rrc\n", rc);
    264264        return 1;
    265265    }
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