Changeset 59151 in vbox for trunk/src/VBox
- Timestamp:
- Dec 16, 2015 1:23:21 PM (9 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r58132 r59151 1040 1040 } 1041 1041 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 } 1050 1058 1051 1059 pThis->StatIoDepth = 0; -
trunk/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp
r58815 r59151 127 127 CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties(); 128 128 CStorageControllerVector controllers = m_session.GetMachine().GetStorageControllers(); 129 int iIDECount = 0, iSATACount = 0, iSCSICount = 0 ;129 int iIDECount = 0, iSATACount = 0, iSCSICount = 0, iUSBCount = 0, iSASCount = 0; 130 130 foreach (const CStorageController &controller, controllers) 131 131 { … … 223 223 break; 224 224 } 225 case KStorageBus_USB: 226 { 227 for (ULONG i = 0; i < sp.GetMaxPortCountForStorageBus(KStorageBus_USB); ++i) 228 { 229 for (ULONG j = 0; j < sp.GetMaxDevicesPerPortForStorageBus(KStorageBus_USB); ++j) 230 { 231 /* Names: */ 232 m_names[QString("/Devices/USB%1/%2/ReadBytes").arg(iUSBCount).arg(i)] 233 = tr("Data Read"); 234 m_names[QString("/Devices/USB%1/%2/WrittenBytes").arg(iUSBCount).arg(i)] 235 = tr("Data Written"); 236 237 /* Units: */ 238 m_units[QString("/Devices/USB%1/%2/ReadBytes").arg(iUSBCount).arg(i)] = "B"; 239 m_units[QString("/Devices/USB%1/%2/WrittenBytes").arg(iUSBCount).arg(i)] = "B"; 240 241 /* Belongs to: */ 242 m_links[QString("/Devices/USB%1/%2").arg(iUSBCount).arg(i)] = QStringList() 243 << QString("/Devices/USB%1/%2/ReadBytes").arg(iUSBCount).arg(i) 244 << QString("/Devices/USB%1/%2/WrittenBytes").arg(iUSBCount).arg(i); 245 } 246 } 247 ++iUSBCount; 248 break; 249 } 250 case KStorageBus_SAS: 251 { 252 for (ULONG i = 0; i < sp.GetMaxPortCountForStorageBus(KStorageBus_SAS); ++i) 253 { 254 for (ULONG j = 0; j < sp.GetMaxDevicesPerPortForStorageBus(KStorageBus_SAS); ++j) 255 { 256 /* Names: */ 257 m_names[QString("/Devices/SAS%1/%2/ReadBytes").arg(iSASCount).arg(i)] 258 = tr("Data Read"); 259 m_names[QString("/Devices/SAS%1/%2/WrittenBytes").arg(iSASCount).arg(i)] 260 = tr("Data Written"); 261 262 /* Units: */ 263 m_units[QString("/Devices/SAS%1/%2/ReadBytes").arg(iSASCount).arg(i)] = "B"; 264 m_units[QString("/Devices/SAS%1/%2/WrittenBytes").arg(iSASCount).arg(i)] = "B"; 265 266 /* Belongs to: */ 267 m_links[QString("/Devices/SAS%1/%2").arg(iSASCount).arg(i)] = QStringList() 268 << QString("/Devices/SAS%1/%2/ReadBytes").arg(iSASCount).arg(i) 269 << QString("/Devices/SAS%1/%2/WrittenBytes").arg(iSASCount).arg(i); 270 } 271 } 272 ++iSASCount; 273 break; 274 } 225 275 default: 226 276 break; … … 692 742 /* Enumerate storage-controllers: */ 693 743 CStorageControllerVector controllers = m.GetStorageControllers(); 694 int iIDECount = 0, iSATACount = 0, iSCSICount = 0 ;744 int iIDECount = 0, iSATACount = 0, iSCSICount = 0, iUSBCount = 0, iSASCount = 0; 695 745 foreach (const CStorageController &controller, controllers) 696 746 { … … 741 791 break; 742 792 } 793 case KStorageBus_USB: 794 { 795 /* Append storage-statistics with USB controller statistics: */ 796 strStorageStat += formatStorageElement(strName, iPort, iDevice, 797 QString("/Devices/USB%1/%2") 798 .arg(iUSBCount).arg(iPort)); 799 break; 800 } 801 case KStorageBus_SAS: 802 { 803 /* Append storage-statistics with USB controller statistics: */ 804 strStorageStat += formatStorageElement(strName, iPort, iDevice, 805 QString("/Devices/SAS%1/%2") 806 .arg(iSASCount).arg(iPort)); 807 break; 808 } 743 809 default: 744 810 break; … … 753 819 case KStorageBus_SATA: ++iSATACount; break; 754 820 case KStorageBus_SCSI: ++iSCSICount; break; 821 case KStorageBus_USB: ++iUSBCount; break; 822 case KStorageBus_SAS: ++iSASCount; break; 755 823 default: break; 756 824 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r58815 r59151 131 131 CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties(); 132 132 CStorageControllerVector controllers = m_session.GetMachine().GetStorageControllers(); 133 int iIDECount = 0, iSATACount = 0, iSCSICount = 0 ;133 int iIDECount = 0, iSATACount = 0, iSCSICount = 0, iUSBCount = 0, iSASCount = 0; 134 134 foreach (const CStorageController &controller, controllers) 135 135 { … … 227 227 break; 228 228 } 229 case KStorageBus_USB: 230 { 231 for (ULONG i = 0; i < sp.GetMaxPortCountForStorageBus(KStorageBus_USB); ++i) 232 { 233 for (ULONG j = 0; j < sp.GetMaxDevicesPerPortForStorageBus(KStorageBus_USB); ++j) 234 { 235 /* Names: */ 236 m_names[QString("/Devices/USB%1/%2/ReadBytes").arg(iUSBCount).arg(i)] 237 = tr("Data Read"); 238 m_names[QString("/Devices/USB%1/%2/WrittenBytes").arg(iUSBCount).arg(i)] 239 = tr("Data Written"); 240 241 /* Units: */ 242 m_units[QString("/Devices/USB%1/%2/ReadBytes").arg(iUSBCount).arg(i)] = "B"; 243 m_units[QString("/Devices/USB%1/%2/WrittenBytes").arg(iUSBCount).arg(i)] = "B"; 244 245 /* Belongs to: */ 246 m_links[QString("/Devices/USB%1/%2").arg(iUSBCount).arg(i)] = QStringList() 247 << QString("/Devices/USB%1/%2/ReadBytes").arg(iUSBCount).arg(i) 248 << QString("/Devices/USB%1/%2/WrittenBytes").arg(iUSBCount).arg(i); 249 } 250 } 251 ++iUSBCount; 252 break; 253 } 254 case KStorageBus_SAS: 255 { 256 for (ULONG i = 0; i < sp.GetMaxPortCountForStorageBus(KStorageBus_SAS); ++i) 257 { 258 for (ULONG j = 0; j < sp.GetMaxDevicesPerPortForStorageBus(KStorageBus_SAS); ++j) 259 { 260 /* Names: */ 261 m_names[QString("/Devices/SAS%1/%2/ReadBytes").arg(iSASCount).arg(i)] 262 = tr("Data Read"); 263 m_names[QString("/Devices/SAS%1/%2/WrittenBytes").arg(iSASCount).arg(i)] 264 = tr("Data Written"); 265 266 /* Units: */ 267 m_units[QString("/Devices/SAS%1/%2/ReadBytes").arg(iSASCount).arg(i)] = "B"; 268 m_units[QString("/Devices/SAS%1/%2/WrittenBytes").arg(iSASCount).arg(i)] = "B"; 269 270 /* Belongs to: */ 271 m_links[QString("/Devices/SAS%1/%2").arg(iSASCount).arg(i)] = QStringList() 272 << QString("/Devices/SAS%1/%2/ReadBytes").arg(iSASCount).arg(i) 273 << QString("/Devices/SAS%1/%2/WrittenBytes").arg(iSASCount).arg(i); 274 } 275 } 276 ++iSASCount; 277 break; 278 } 229 279 default: 230 280 break; … … 685 735 /* Enumerate storage-controllers: */ 686 736 CStorageControllerVector controllers = m.GetStorageControllers(); 687 int iIDECount = 0, iSATACount = 0, iSCSICount = 0 ;737 int iIDECount = 0, iSATACount = 0, iSCSICount = 0, iUSBCount = 0, iSASCount = 0; 688 738 foreach (const CStorageController &controller, controllers) 689 739 { … … 734 784 break; 735 785 } 786 case KStorageBus_USB: 787 { 788 /* Append storage-statistics with USB controller statistics: */ 789 strStorageStat += formatStorageElement(strName, iPort, iDevice, 790 QString("/Devices/USB%1/%2") 791 .arg(iUSBCount).arg(iPort)); 792 break; 793 } 794 case KStorageBus_SAS: 795 { 796 /* Append storage-statistics with USB controller statistics: */ 797 strStorageStat += formatStorageElement(strName, iPort, iDevice, 798 QString("/Devices/SAS%1/%2") 799 .arg(iSASCount).arg(iPort)); 800 break; 801 } 736 802 default: 737 803 break; … … 746 812 case KStorageBus_SATA: ++iSATACount; break; 747 813 case KStorageBus_SCSI: ++iSCSICount; break; 814 case KStorageBus_USB: ++iUSBCount; break; 815 case KStorageBus_SAS: ++iSASCount; break; 748 816 default: break; 749 817 }
Note:
See TracChangeset
for help on using the changeset viewer.