VirtualBox

Changeset 59151 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Dec 16, 2015 1:23:21 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104734
Message:

DrvSCSI,FE/VirtualBox: Display statisctics for SAS and USB storage devices too, fix a related todo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r58132 r59151  
    10401040    }
    10411041
    1042     /* Register statistics counter. */
    1043     /** @todo aeichner: Find a way to put the instance number of the attached
    1044      * controller device when we support more than one controller of the same type.
    1045      * At the moment we have the 0 hardcoded. */
    1046     PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesRead, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
    1047                             "Amount of data read.", "/Devices/SCSI0/%d/ReadBytes", pDrvIns->iInstance);
    1048     PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesWritten, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
    1049                             "Amount of data written.", "/Devices/SCSI0/%d/WrittenBytes", pDrvIns->iInstance);
     1042    const char *pszCtrl = NULL;
     1043    uint32_t iCtrlInstance = 0;
     1044    uint32_t iCtrlLun = 0;
     1045
     1046    rc = pThis->pDevScsiPort->pfnQueryDeviceLocation(pThis->pDevScsiPort, &pszCtrl, &iCtrlInstance, &iCtrlLun);
     1047    if (RT_SUCCESS(rc))
     1048    {
     1049        const char *pszCtrlId =   strcmp(pszCtrl, "Msd") == 0 ? "USB"
     1050                                : strcmp(pszCtrl, "lsilogicsas") == 0 ? "SAS"
     1051                                : "SCSI";
     1052        /* Register statistics counter. */
     1053        PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesRead, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     1054                                "Amount of data read.", "/Devices/%s%u/%d/ReadBytes", pszCtrlId, iCtrlInstance, iCtrlLun);
     1055        PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesWritten, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     1056                                "Amount of data written.", "/Devices/%s%u/%d/WrittenBytes", pszCtrlId, iCtrlInstance, iCtrlLun);
     1057    }
    10501058
    10511059    pThis->StatIoDepth = 0;
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