Changeset 13100 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 8, 2008 5:33:04 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r13099 r13100 1605 1605 # endif 1606 1606 # ifdef PGMPOOL_WITH_MONITORING 1607 /** Profiling the GC PTaccess handler. */1608 STAMPROFILE StatMonitor GC;1607 /** Profiling the RC/R0 access handler. */ 1608 STAMPROFILE StatMonitorRZ; 1609 1609 /** Times we've failed interpreting the instruction. */ 1610 STAMCOUNTER StatMonitor GCEmulateInstr;1611 /** Profiling the pgmPoolFlushPage calls made from the GC PTaccess handler. */1612 STAMPROFILE StatMonitor GCFlushPage;1610 STAMCOUNTER StatMonitorRZEmulateInstr; 1611 /** Profiling the pgmPoolFlushPage calls made from the RC/R0 access handler. */ 1612 STAMPROFILE StatMonitorRZFlushPage; 1613 1613 /** Times we've detected fork(). */ 1614 STAMCOUNTER StatMonitor GCFork;1615 /** Profiling the GCaccess we've handled (except REP STOSD). */1616 STAMPROFILE StatMonitor GCHandled;1614 STAMCOUNTER StatMonitorRZFork; 1615 /** Profiling the RC/R0 access we've handled (except REP STOSD). */ 1616 STAMPROFILE StatMonitorRZHandled; 1617 1617 /** Times we've failed interpreting a patch code instruction. */ 1618 STAMCOUNTER StatMonitor GCIntrFailPatch1;1618 STAMCOUNTER StatMonitorRZIntrFailPatch1; 1619 1619 /** Times we've failed interpreting a patch code instruction during flushing. */ 1620 STAMCOUNTER StatMonitor GCIntrFailPatch2;1620 STAMCOUNTER StatMonitorRZIntrFailPatch2; 1621 1621 /** The number of times we've seen rep prefixes we can't handle. */ 1622 STAMCOUNTER StatMonitor GCRepPrefix;1622 STAMCOUNTER StatMonitorRZRepPrefix; 1623 1623 /** Profiling the REP STOSD cases we've handled. */ 1624 STAMPROFILE StatMonitor GCRepStosd;1625 1626 /** Profiling the HC PTaccess handler. */1627 STAMPROFILE StatMonitor HC;1624 STAMPROFILE StatMonitorRZRepStosd; 1625 1626 /** Profiling the R3 access handler. */ 1627 STAMPROFILE StatMonitorR3; 1628 1628 /** Times we've failed interpreting the instruction. */ 1629 STAMCOUNTER StatMonitor HCEmulateInstr;1630 /** Profiling the pgmPoolFlushPage calls made from the HC PTaccess handler. */1631 STAMPROFILE StatMonitor HCFlushPage;1629 STAMCOUNTER StatMonitorR3EmulateInstr; 1630 /** Profiling the pgmPoolFlushPage calls made from the R3 access handler. */ 1631 STAMPROFILE StatMonitorR3FlushPage; 1632 1632 /** Times we've detected fork(). */ 1633 STAMCOUNTER StatMonitor HCFork;1634 /** Profiling the HCaccess we've handled (except REP STOSD). */1635 STAMPROFILE StatMonitor HCHandled;1633 STAMCOUNTER StatMonitorR3Fork; 1634 /** Profiling the R3 access we've handled (except REP STOSD). */ 1635 STAMPROFILE StatMonitorR3Handled; 1636 1636 /** The number of times we've seen rep prefixes we can't handle. */ 1637 STAMCOUNTER StatMonitor HCRepPrefix;1637 STAMCOUNTER StatMonitorR3RepPrefix; 1638 1638 /** Profiling the REP STOSD cases we've handled. */ 1639 STAMPROFILE StatMonitor HCRepStosd;1639 STAMPROFILE StatMonitorR3RepStosd; 1640 1640 /** The number of times we're called in an async thread an need to flush. */ 1641 STAMCOUNTER StatMonitor HCAsync;1641 STAMCOUNTER StatMonitorR3Async; 1642 1642 /** The high wather mark for cModifiedPages. */ 1643 1643 uint16_t cModifiedPagesHigh; -
trunk/src/VBox/VMM/PGMPool.cpp
r13062 r13100 343 343 # endif 344 344 # ifdef PGMPOOL_WITH_MONITORING 345 STAM_REG(pVM, &pPool->StatMonitor GC, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/GC", STAMUNIT_TICKS_PER_CALL, "Profiling the GC PTaccess handler.");346 STAM_REG(pVM, &pPool->StatMonitor GCEmulateInstr, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/GCEmulateInstr",STAMUNIT_OCCURENCES, "Times we've failed interpreting the instruction.");347 STAM_REG(pVM, &pPool->StatMonitor GCFlushPage, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/GCFlushPage", STAMUNIT_TICKS_PER_CALL, "Profiling the pgmPoolFlushPage calls made from the GC PTaccess handler.");348 STAM_REG(pVM, &pPool->StatMonitor GCFork, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/GCFork",STAMUNIT_OCCURENCES, "Times we've detected fork().");349 STAM_REG(pVM, &pPool->StatMonitor GCHandled, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/GCHandled", STAMUNIT_TICKS_PER_CALL, "Profiling the GCaccess we've handled (except REP STOSD).");350 STAM_REG(pVM, &pPool->StatMonitor GCIntrFailPatch1, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/GCIntrFailPatch1",STAMUNIT_OCCURENCES, "Times we've failed interpreting a patch code instruction.");351 STAM_REG(pVM, &pPool->StatMonitor GCIntrFailPatch2, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/GCIntrFailPatch2",STAMUNIT_OCCURENCES, "Times we've failed interpreting a patch code instruction during flushing.");352 STAM_REG(pVM, &pPool->StatMonitor GCRepPrefix, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/GCRepPrefix",STAMUNIT_OCCURENCES, "The number of times we've seen rep prefixes we can't handle.");353 STAM_REG(pVM, &pPool->StatMonitor GCRepStosd, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/GCRepStosd",STAMUNIT_TICKS_PER_CALL, "Profiling the REP STOSD cases we've handled.");354 STAM_REG(pVM, &pPool->StatMonitor HC, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/HC", STAMUNIT_TICKS_PER_CALL, "Profiling the HC PTaccess handler.");355 STAM_REG(pVM, &pPool->StatMonitor HCEmulateInstr, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/HCEmulateInstr",STAMUNIT_OCCURENCES, "Times we've failed interpreting the instruction.");356 STAM_REG(pVM, &pPool->StatMonitor HCFlushPage, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/HCFlushPage", STAMUNIT_TICKS_PER_CALL, "Profiling the pgmPoolFlushPage calls made from the HC PTaccess handler.");357 STAM_REG(pVM, &pPool->StatMonitor HCFork, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/HCFork",STAMUNIT_OCCURENCES, "Times we've detected fork().");358 STAM_REG(pVM, &pPool->StatMonitor HCHandled, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/HCHandled", STAMUNIT_TICKS_PER_CALL, "Profiling the HCaccess we've handled (except REP STOSD).");359 STAM_REG(pVM, &pPool->StatMonitor HCRepPrefix, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/HCRepPrefix",STAMUNIT_OCCURENCES, "The number of times we've seen rep prefixes we can't handle.");360 STAM_REG(pVM, &pPool->StatMonitor HCRepStosd, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/HCRepStosd",STAMUNIT_TICKS_PER_CALL, "Profiling the REP STOSD cases we've handled.");361 STAM_REG(pVM, &pPool->StatMonitor HCAsync, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/HCAsync",STAMUNIT_OCCURENCES, "Times we're called in an async thread and need to flush.");345 STAM_REG(pVM, &pPool->StatMonitorRZ, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/RZ", STAMUNIT_TICKS_PER_CALL, "Profiling the RC/R0 access handler."); 346 STAM_REG(pVM, &pPool->StatMonitorRZEmulateInstr, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/RZ/EmulateInstr", STAMUNIT_OCCURENCES, "Times we've failed interpreting the instruction."); 347 STAM_REG(pVM, &pPool->StatMonitorRZFlushPage, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/RZ/FlushPage", STAMUNIT_TICKS_PER_CALL, "Profiling the pgmPoolFlushPage calls made from the RC/R0 access handler."); 348 STAM_REG(pVM, &pPool->StatMonitorRZFork, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/RZ/Fork", STAMUNIT_OCCURENCES, "Times we've detected fork()."); 349 STAM_REG(pVM, &pPool->StatMonitorRZHandled, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/RZ/Handled", STAMUNIT_TICKS_PER_CALL, "Profiling the RC/R0 access we've handled (except REP STOSD)."); 350 STAM_REG(pVM, &pPool->StatMonitorRZIntrFailPatch1, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/RZ/IntrFailPatch1", STAMUNIT_OCCURENCES, "Times we've failed interpreting a patch code instruction."); 351 STAM_REG(pVM, &pPool->StatMonitorRZIntrFailPatch2, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/RZ/IntrFailPatch2", STAMUNIT_OCCURENCES, "Times we've failed interpreting a patch code instruction during flushing."); 352 STAM_REG(pVM, &pPool->StatMonitorRZRepPrefix, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/RZ/RepPrefix", STAMUNIT_OCCURENCES, "The number of times we've seen rep prefixes we can't handle."); 353 STAM_REG(pVM, &pPool->StatMonitorRZRepStosd, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/RZ/RepStosd", STAMUNIT_TICKS_PER_CALL, "Profiling the REP STOSD cases we've handled."); 354 STAM_REG(pVM, &pPool->StatMonitorR3, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/R3", STAMUNIT_TICKS_PER_CALL, "Profiling the R3 access handler."); 355 STAM_REG(pVM, &pPool->StatMonitorR3EmulateInstr, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/R3/EmulateInstr", STAMUNIT_OCCURENCES, "Times we've failed interpreting the instruction."); 356 STAM_REG(pVM, &pPool->StatMonitorR3FlushPage, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/R3/FlushPage", STAMUNIT_TICKS_PER_CALL, "Profiling the pgmPoolFlushPage calls made from the R3 access handler."); 357 STAM_REG(pVM, &pPool->StatMonitorR3Fork, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/R3/Fork", STAMUNIT_OCCURENCES, "Times we've detected fork()."); 358 STAM_REG(pVM, &pPool->StatMonitorR3Handled, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/R3/Handled", STAMUNIT_TICKS_PER_CALL, "Profiling the R3 access we've handled (except REP STOSD)."); 359 STAM_REG(pVM, &pPool->StatMonitorR3RepPrefix, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/R3/RepPrefix", STAMUNIT_OCCURENCES, "The number of times we've seen rep prefixes we can't handle."); 360 STAM_REG(pVM, &pPool->StatMonitorR3RepStosd, STAMTYPE_PROFILE, "/PGM/Pool/Monitor/R3/RepStosd", STAMUNIT_TICKS_PER_CALL, "Profiling the REP STOSD cases we've handled."); 361 STAM_REG(pVM, &pPool->StatMonitorR3Async, STAMTYPE_COUNTER, "/PGM/Pool/Monitor/R3/Async", STAMUNIT_OCCURENCES, "Times we're called in an async thread and need to flush."); 362 362 STAM_REG(pVM, &pPool->cModifiedPages, STAMTYPE_U16, "/PGM/Pool/Monitor/cModifiedPages", STAMUNIT_PAGES, "The current cModifiedPages value."); 363 363 STAM_REG(pVM, &pPool->cModifiedPagesHigh, STAMTYPE_U16_RESET, "/PGM/Pool/Monitor/cModifiedPagesHigh", STAMUNIT_PAGES, "The high watermark for cModifiedPages."); … … 514 514 static DECLCALLBACK(int) pgmR3PoolAccessHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser) 515 515 { 516 STAM_PROFILE_START(&pVM->pgm.s.pPoolR3->StatMonitor HC, a);516 STAM_PROFILE_START(&pVM->pgm.s.pPoolR3->StatMonitorR3, a); 517 517 PPGMPOOL pPool = pVM->pgm.s.pPoolR3; 518 518 PPGMPOOLPAGE pPage = (PPGMPOOLPAGE)pvUser; … … 531 531 Log(("pgmR3PoolAccessHandler: async thread, requesting EMT to flush the page: %p:{.Core=%RHp, .idx=%d, .GCPhys=%RGp, .enmType=%d}\n", 532 532 pPage, pPage->Core.Key, pPage->idx, pPage->GCPhys, pPage->enmKind)); 533 STAM_COUNTER_INC(&pPool->StatMonitor HCAsync);533 STAM_COUNTER_INC(&pPool->StatMonitorR3Async); 534 534 if (!pPage->fReusedFlushPending) 535 535 { … … 548 548 pgmPoolMonitorChainChanging(pPool, pPage, GCPhys, pvPhys, NULL); 549 549 } 550 STAM_PROFILE_STOP(&pPool->StatMonitor HC, a);550 STAM_PROFILE_STOP(&pPool->StatMonitorR3, a); 551 551 } 552 552 else if ( (pPage->fCR3Mix || pPage->cModifications < 96) /* it's cheaper here. */ … … 558 558 /** @todo r=bird: making unsafe assumption about not crossing entries here! */ 559 559 pgmPoolMonitorChainChanging(pPool, pPage, GCPhys, pvPhys, NULL); 560 STAM_PROFILE_STOP(&pPool->StatMonitor HC, a);560 STAM_PROFILE_STOP(&pPool->StatMonitorR3, a); 561 561 } 562 562 else 563 563 { 564 564 pgmPoolMonitorChainFlush(pPool, pPage); /* ASSUME that VERR_PGM_POOL_CLEARED can be ignored here and that FFs will deal with it in due time. */ 565 STAM_PROFILE_STOP_EX(&pPool->StatMonitor HC, &pPool->StatMonitorHCFlushPage, a);565 STAM_PROFILE_STOP_EX(&pPool->StatMonitorR3, &pPool->StatMonitorR3FlushPage, a); 566 566 } 567 567 -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r13062 r13100 721 721 ) 722 722 { 723 STAM_COUNTER_INC(&pPool->CTX MID(StatMonitor,Fork));723 STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,Fork)); 724 724 return true; 725 725 } … … 840 840 pRegFrame->cs, (RTGCPTR)pRegFrame->eip)); 841 841 rc = VINF_SUCCESS; 842 STAM_COUNTER_INC(&pPool->StatMonitor GCIntrFailPatch2);842 STAM_COUNTER_INC(&pPool->StatMonitorRZIntrFailPatch2); 843 843 } 844 844 else … … 846 846 { 847 847 rc = VINF_EM_RAW_EMULATE_INSTR; 848 STAM_COUNTER_INC(&pPool->CTX MID(StatMonitor,EmulateInstr));848 STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,EmulateInstr)); 849 849 } 850 850 } … … 954 954 pRegFrame->cs, (RTGCPTR)pRegFrame->rip, pCpu->pCurInstr->opcode)); 955 955 rc = VINF_EM_RAW_EMULATE_INSTR; 956 STAM_COUNTER_INC(&pPool->CTX MID(StatMonitor,EmulateInstr));956 STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,EmulateInstr)); 957 957 } 958 958 … … 990 990 DECLEXPORT(int) pgmPoolAccessHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser) 991 991 { 992 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pPool)->CTX SUFF(StatMonitor), a);992 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), a); 993 993 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 994 994 PPGMPOOLPAGE pPage = (PPGMPOOLPAGE)pvUser; … … 1023 1023 { 1024 1024 rc = pgmPoolAccessHandlerSimple(pVM, pPool, pPage, &Cpu, pRegFrame, GCPhysFault, pvFault); 1025 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX SUFF(StatMonitor), &pPool->CTXMID(StatMonitor,Handled), a);1025 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), &pPool->CTX_MID_Z(StatMonitor,Handled), a); 1026 1026 return rc; 1027 1027 } … … 1045 1045 { 1046 1046 rc = pgmPoolAccessHandlerSTOSD(pVM, pPool, pPage, &Cpu, pRegFrame, GCPhysFault, pvFault); 1047 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX SUFF(StatMonitor), &pPool->CTXMID(StatMonitor,RepStosd), a);1047 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), &pPool->CTX_MID_Z(StatMonitor,RepStosd), a); 1048 1048 return rc; 1049 1049 } 1050 1050 1051 1051 /* REP prefix, don't bother. */ 1052 STAM_COUNTER_INC(&pPool->CTX MID(StatMonitor,RepPrefix));1052 STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,RepPrefix)); 1053 1053 Log4(("pgmPoolAccessHandler: eax=%#x ecx=%#x edi=%#x esi=%#x eip=%VGv opcode=%d prefix=%#x\n", 1054 1054 pRegFrame->eax, pRegFrame->ecx, pRegFrame->edi, pRegFrame->esi, pRegFrame->rip, Cpu.pCurInstr->opcode, Cpu.prefix)); … … 1066 1066 if (rc == VINF_EM_RAW_EMULATE_INSTR && fReused) 1067 1067 rc = VINF_SUCCESS; 1068 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX SUFF(StatMonitor), &pPool->CTXMID(StatMonitor,FlushPage), a);1068 STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), &pPool->CTX_MID_Z(StatMonitor,FlushPage), a); 1069 1069 return rc; 1070 1070 }
Note:
See TracChangeset
for help on using the changeset viewer.