Changeset 82378 in vbox
- Timestamp:
- Dec 4, 2019 12:13:45 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135212
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r82313 r82378 57 57 VMMDECL(VBOXSTRICTRC) IOMIOPortRead(PVMCC pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t *pu32Value, size_t cbValue) 58 58 { 59 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortIn); 59 60 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); 60 61 … … 115 116 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo)); 116 117 117 if (rcStrict == VINF_SUCCESS) 118 #ifndef IN_RING3 119 if (rcStrict == VINF_IOM_R3_IOPORT_READ) 120 STAM_COUNTER_INC(&pStats->InRZToR3); 121 else 122 #endif 123 { 118 124 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(In)); 119 #ifndef IN_RING3 120 else if (rcStrict == VINF_IOM_R3_IOPORT_READ) 121 STAM_COUNTER_INC(&pStats->InRZToR3); 122 #endif 123 else if (rcStrict == VERR_IOM_IOPORT_UNUSED) 124 { 125 /* make return value */ 126 rcStrict = VINF_SUCCESS; 127 switch (cbValue) 125 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 126 if (rcStrict == VERR_IOM_IOPORT_UNUSED) 128 127 { 129 case 1: *(uint8_t *)pu32Value = 0xff; break; 130 case 2: *(uint16_t *)pu32Value = 0xffff; break; 131 case 4: *(uint32_t *)pu32Value = UINT32_C(0xffffffff); break; 132 default: 133 AssertMsgFailedReturn(("Invalid I/O port size %d. Port=%d\n", cbValue, Port), VERR_IOM_INVALID_IOPORT_SIZE); 128 /* make return value */ 129 rcStrict = VINF_SUCCESS; 130 switch (cbValue) 131 { 132 case 1: *(uint8_t *)pu32Value = 0xff; break; 133 case 2: *(uint16_t *)pu32Value = 0xffff; break; 134 case 4: *(uint32_t *)pu32Value = UINT32_C(0xffffffff); break; 135 default: 136 AssertMsgFailedReturn(("Invalid I/O port size %d. Port=%d\n", cbValue, Port), VERR_IOM_INVALID_IOPORT_SIZE); 137 } 134 138 } 135 139 } 136 140 Log3(("IOMIOPortRead: Port=%RTiop *pu32=%08RX32 cb=%d rc=%Rrc\n", Port, *pu32Value, cbValue, VBOXSTRICTRC_VAL(rcStrict))); 141 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 137 142 } 138 143 else … … 179 184 void *pvDst, uint32_t *pcTransfers, unsigned cb) 180 185 { 186 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortInS); 181 187 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); 182 188 … … 279 285 280 286 #ifdef VBOX_WITH_STATISTICS 281 if (rcStrict == VINF_SUCCESS && pStats) 287 # ifndef IN_RING3 288 if (rcStrict == VINF_IOM_R3_IOPORT_READ) 289 STAM_COUNTER_INC(&pStats->InRZToR3); 290 else 291 # endif 292 { 282 293 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(In)); 283 # ifndef IN_RING3 284 else if (rcStrict == VINF_IOM_R3_IOPORT_READ && pStats) 285 STAM_COUNTER_INC(&pStats->InRZToR3); 286 # endif 294 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 295 } 287 296 #endif 288 297 Log3(("IOMIOPortReadStr: uPort=%RTiop pvDst=%p pcTransfer=%p:{%#x->%#x} cb=%d rc=%Rrc\n", … … 349 358 VMMDECL(VBOXSTRICTRC) IOMIOPortWrite(PVMCC pVM, PVMCPU pVCpu, RTIOPORT Port, uint32_t u32Value, size_t cbValue) 350 359 { 360 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortOut); 351 361 #ifndef IN_RING3 352 362 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); … … 408 418 409 419 #ifdef VBOX_WITH_STATISTICS 410 if (rcStrict == VINF_SUCCESS) 420 # ifndef IN_RING3 421 if (rcStrict != VINF_IOM_R3_IOPORT_WRITE) 422 # endif 423 { 411 424 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(Out)); 425 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 426 } 412 427 #endif 413 428 Log3(("IOMIOPortWrite: Port=%RTiop u32=%08RX32 cb=%d rc=%Rrc\n", Port, u32Value, cbValue, VBOXSTRICTRC_VAL(rcStrict))); … … 454 469 uint32_t *pcTransfers, unsigned cb) 455 470 { 471 STAM_COUNTER_INC(&pVM->iom.s.StatIoPortOutS); 456 472 Assert(pVCpu->iom.s.PendingIOPortWrite.cbValue == 0); 457 473 Assert(cb == 1 || cb == 2 || cb == 4); … … 549 565 550 566 #ifdef VBOX_WITH_STATISTICS 551 if (rcStrict == VINF_SUCCESS) 567 # ifndef IN_RING3 568 if (rcStrict == VINF_IOM_R3_IOPORT_WRITE) 569 STAM_COUNTER_INC(&pStats->OutRZToR3); 570 else 571 # endif 572 { 552 573 STAM_COUNTER_INC(&pStats->CTX_SUFF_Z(Out)); 553 # ifndef IN_RING3 554 else if (rcStrict == VINF_IOM_R3_IOPORT_WRITE) 555 STAM_COUNTER_INC(&pStats->OutRZToR3); 556 # endif 574 STAM_COUNTER_INC(&iomIoPortGetStats(pVM, pRegEntry, 0)->Total); 575 } 557 576 #endif 558 577 Log3(("IOMIOPortWriteStr: uPort=%RTiop pvSrc=%p pcTransfer=%p:{%#x->%#x} cb=%d rcStrict=%Rrc\n", -
trunk/src/VBox/VMM/VMMR3/IOM.cpp
r82313 r82378 176 176 */ 177 177 STAM_REG(pVM, &pVM->iom.s.StatIoPortCommits, STAMTYPE_COUNTER, "/IOM/IoPortCommits", STAMUNIT_OCCURENCES, "Number of ring-3 I/O port commits."); 178 STAM_REG(pVM, &pVM->iom.s.StatIoPortIn, STAMTYPE_PROFILE, "/IOM/IoPortIN", STAMUNIT_OCCURENCES, "Number of IN instructions (attempts)"); 179 STAM_REG(pVM, &pVM->iom.s.StatIoPortInS, STAMTYPE_PROFILE, "/IOM/IoPortINS", STAMUNIT_OCCURENCES, "Number of INS instructions (attempts)"); 180 STAM_REG(pVM, &pVM->iom.s.StatIoPortOutS, STAMTYPE_PROFILE, "/IOM/IoPortOUT", STAMUNIT_OCCURENCES, "Number of OUT instructions (attempts)"); 181 STAM_REG(pVM, &pVM->iom.s.StatIoPortOutS, STAMTYPE_PROFILE, "/IOM/IoPortOUTS", STAMUNIT_OCCURENCES, "Number of OUTS instructions (attempts)"); 178 182 179 183 STAM_REL_REG(pVM, &pVM->iom.s.StatMMIOStaleMappings, STAMTYPE_PROFILE, "/IOM/MMIOStaleMappings", STAMUNIT_TICKS_PER_CALL, "Number of times iomMmioHandlerNew got a call for a remapped range at the old mapping."); -
trunk/src/VBox/VMM/VMMR3/IOMR3IoPort.cpp
r82311 r82378 58 58 size_t cchPrefix; 59 59 if (uFirstPort < uEndPort - 1) 60 cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/ NewPorts/%04x-%04x", uFirstPort, uEndPort - 1);60 cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/IoPorts/%04x-%04x", uFirstPort, uEndPort - 1); 61 61 else 62 cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/ NewPorts/%04x", uPort);62 cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/IoPorts/%04x", uPort); 63 63 const char *pszDesc = pRegEntry->pszDesc; 64 64 char *pszFreeDesc = NULL; 65 65 if (pRegEntry->pDevIns && pRegEntry->pDevIns->iInstance > 0 && pszDesc) 66 66 pszDesc = pszFreeDesc = RTStrAPrintf2("%u / %s", pRegEntry->pDevIns->iInstance, pszDesc); 67 int rc = STAMR3Register(pVM, &p RegEntry->idxSelf, STAMTYPE_U16, STAMVISIBILITY_ALWAYS, szName,67 int rc = STAMR3Register(pVM, &pStats->Total, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, szName, 68 68 STAMUNIT_NONE, pRegEntry->pszDesc); 69 69 AssertRC(rc); … … 132 132 size_t cchPrefix; 133 133 if (pRegEntry->cPorts > 1) 134 cchPrefix = RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/ NewPorts/%04x-%04x", uPort, uPort + pRegEntry->cPorts - 1);134 cchPrefix = RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/IoPorts/%04x-%04x", uPort, uPort + pRegEntry->cPorts - 1); 135 135 else 136 cchPrefix = RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/ NewPorts/%04x", uPort);136 cchPrefix = RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/IoPorts/%04x", uPort); 137 137 STAMR3DeregisterByPrefix(pVM->pUVM, szPrefix); 138 138 } -
trunk/src/VBox/VMM/include/IOMInternal.h
r82313 r82378 148 148 typedef struct IOMIOPORTSTATSENTRY 149 149 { 150 /** All accesses (only updated for the first port in a range). */ 151 STAMCOUNTER Total; 152 150 153 /** Number of INs to this port from R3. */ 151 154 STAMCOUNTER InR3; … … 447 450 #endif 448 451 449 #if 0 /* unused */450 452 /** @name I/O Port statistics. 451 453 * @{ */ 452 STAMCOUNTER StatI nstIn;453 STAMCOUNTER StatI nstOut;454 STAMCOUNTER StatI nstIns;455 STAMCOUNTER StatI nstOuts;454 STAMCOUNTER StatIoPortIn; 455 STAMCOUNTER StatIoPortOut; 456 STAMCOUNTER StatIoPortInS; 457 STAMCOUNTER StatIoPortOutS; 456 458 /** @} */ 457 #endif458 459 459 460 /** @name MMIO statistics.
Note:
See TracChangeset
for help on using the changeset viewer.