- Timestamp:
- Dec 12, 2016 5:50:01 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r64680 r64841 426 426 SUPSEMEVENT hEvtProcess; 427 427 428 /** Release statistics: number of DMA commands. */429 STAMCOUNTER StatDMA;430 /** Release statistics: number of bytes written. */431 STAMCOUNTER StatBytesWritten;432 /** Release statistics: number of bytes read. */433 STAMCOUNTER StatBytesRead;434 /** Release statistics: Number of I/O requests processed per second. */435 STAMCOUNTER StatIORequestsPerSecond;436 #ifdef VBOX_WITH_STATISTICS437 /** Statistics: Time to complete one request. */438 STAMPROFILE StatProfileProcessTime;439 /** Statistics: Amount of time to read/write data. */440 STAMPROFILE StatProfileReadWrite;441 #endif /* VBOX_WITH_STATISTICS */442 443 428 /** The serial numnber to use for IDENTIFY DEVICE commands. */ 444 429 char szSerialNumber[AHCI_SERIAL_NUMBER_LENGTH+1]; /** < one extra byte for termination */ … … 456 441 typedef AHCIPort *PAHCIPort; 457 442 458 AssertCompileMemberAlignment(AHCIPort, StatDMA, 8);459 443 AssertCompileSizeAlignment(AHCIPort, 8); 460 444 … … 3708 3692 { 3709 3693 if (pAhciReq->enmType == PDMMEDIAEXIOREQTYPE_READ) 3710 {3711 STAM_REL_COUNTER_ADD(&pAhciPort->StatBytesRead, pAhciReq->cbTransfer);3712 3694 pAhciPort->Led.Actual.s.fReading = 0; 3713 }3714 3695 else if (pAhciReq->enmType == PDMMEDIAEXIOREQTYPE_WRITE) 3715 {3716 STAM_REL_COUNTER_ADD(&pAhciPort->StatBytesWritten, pAhciReq->cbTransfer);3717 3696 pAhciPort->Led.Actual.s.fWriting = 0; 3718 }3719 3697 else if (pAhciReq->enmType == PDMMEDIAEXIOREQTYPE_DISCARD) 3720 3698 pAhciPort->Led.Actual.s.fWriting = 0; … … 6032 6010 /* Initialize static members on every port. */ 6033 6011 for (i = 0; i < AHCI_MAX_NR_PORTS_IMPL; i++) 6034 { 6035 PAHCIPort pAhciPort = &pThis->ahciPort[i]; 6036 6037 PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatDMA, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 6038 "Number of DMA transfers.", "/Devices/SATA%d/Port%d/DMA", iInstance, i); 6039 PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatBytesRead, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_BYTES, 6040 "Amount of data read.", "/Devices/SATA%d/Port%d/ReadBytes", iInstance, i); 6041 PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatBytesWritten, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_BYTES, 6042 "Amount of data written.", "/Devices/SATA%d/Port%d/WrittenBytes", iInstance, i); 6043 PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatIORequestsPerSecond, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 6044 "Number of processed I/O requests per second.", "/Devices/SATA%d/Port%d/IORequestsPerSecond", iInstance, i); 6045 #ifdef VBOX_WITH_STATISTICS 6046 PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatProfileProcessTime, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL, 6047 "Amount of time to process one request.", "/Devices/SATA%d/Port%d/ProfileProcessTime", iInstance, i); 6048 PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatProfileReadWrite, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL, 6049 "Amount of time for the read/write operation to complete.", "/Devices/SATA%d/Port%d/ProfileReadWrite", iInstance, i); 6050 #endif 6051 6052 ahciPortHwReset(pAhciPort); 6053 } 6012 ahciPortHwReset(&pThis->ahciPort[i]); 6054 6013 6055 6014 /* Attach drivers to every available port. */ -
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r64660 r64841 133 133 * any of the dummy functions. */ 134 134 bool volatile fDummySignal; 135 /** Release statistics: number of bytes written. */ 136 STAMCOUNTER StatBytesWritten; 137 /** Release statistics: number of bytes read. */ 138 STAMCOUNTER StatBytesRead; 139 /** Release statistics: Current I/O depth. */ 135 /** Current I/O depth. */ 140 136 volatile uint32_t StatIoDepth; 141 137 /** Errors printed in the release log. */ … … 358 354 pThis->pLed->Asserted.s.fReading = pThis->pLed->Actual.s.fReading = 1; 359 355 rc = pThis->pDrvMediaEx->pfnIoReqRead(pThis->pDrvMediaEx, hIoReq, uOffset, cbTransfer); 360 STAM_REL_COUNTER_ADD(&pThis->StatBytesRead, cbTransfer);361 356 } 362 357 else … … 364 359 pThis->pLed->Asserted.s.fWriting = pThis->pLed->Actual.s.fWriting = 1; 365 360 rc = pThis->pDrvMediaEx->pfnIoReqWrite(pThis->pDrvMediaEx, hIoReq, uOffset, cbTransfer); 366 STAM_REL_COUNTER_ADD(&pThis->StatBytesWritten, cbTransfer);367 361 } 368 362 … … 1254 1248 pThis->hVScsiLun = NULL; 1255 1249 } 1256 1257 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatBytesRead);1258 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatBytesWritten);1259 PDMDrvHlpSTAMDeregister(pDrvIns, (void *)&pThis->StatIoDepth);1260 1250 } 1261 1251 … … 1437 1427 } 1438 1428 } 1439 1440 const char *pszCtrl = NULL;1441 uint32_t iCtrlInstance = 0;1442 uint32_t iCtrlLun = 0;1443 1444 rc = pThis->pDevMediaPort->pfnQueryDeviceLocation(pThis->pDevMediaPort, &pszCtrl, &iCtrlInstance, &iCtrlLun);1445 if (RT_SUCCESS(rc))1446 {1447 const char *pszCtrlId = strcmp(pszCtrl, "Msd") == 0 ? "USB"1448 : strcmp(pszCtrl, "lsilogicsas") == 0 ? "SAS"1449 : "SCSI";1450 /* Register statistics counter. */1451 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesRead, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,1452 "Amount of data read.", "/Devices/%s%u/%u/ReadBytes", pszCtrlId, iCtrlInstance, iCtrlLun);1453 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesWritten, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,1454 "Amount of data written.", "/Devices/%s%u/%u/WrittenBytes", pszCtrlId, iCtrlInstance, iCtrlLun);1455 PDMDrvHlpSTAMRegisterF(pDrvIns, (void *)&pThis->StatIoDepth, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,1456 "Number of active tasks.", "/Devices/%s%u/%u/IoDepth", pszCtrlId, iCtrlInstance, iCtrlLun);1457 }1458 1459 pThis->StatIoDepth = 0;1460 1429 1461 1430 uint32_t fFeatures = 0; -
trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp
r64761 r64841 284 284 */ 285 285 CHECK_MEMBER_ALIGNMENT(AHCI, lock, 8); 286 CHECK_MEMBER_ALIGNMENT(AHCI Port, StatDMA, 8);286 CHECK_MEMBER_ALIGNMENT(AHCI, ahciPort[0], 8); 287 287 288 288 CHECK_MEMBER_ALIGNMENT(APICDEV, pDevInsR0, 8); -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r64808 r64841 1324 1324 GEN_CHECK_OFF(AHCIPort, pTaskErr); 1325 1325 GEN_CHECK_OFF(AHCIPort, hEvtProcess); 1326 GEN_CHECK_OFF(AHCIPort, StatDMA);1327 GEN_CHECK_OFF(AHCIPort, StatBytesWritten);1328 GEN_CHECK_OFF(AHCIPort, StatBytesRead);1329 GEN_CHECK_OFF(AHCIPort, StatIORequestsPerSecond);1330 #ifdef VBOX_WITH_STATISTICS1331 GEN_CHECK_OFF(AHCIPort, StatProfileProcessTime);1332 GEN_CHECK_OFF(AHCIPort, StatProfileReadWrite);1333 #endif1334 1326 GEN_CHECK_OFF(AHCIPort, szSerialNumber); 1335 1327 GEN_CHECK_OFF(AHCIPort, szSerialNumber[AHCI_SERIAL_NUMBER_LENGTH]); /* One additional byte for the termination.*/
Note:
See TracChangeset
for help on using the changeset viewer.