VirtualBox

Changeset 13100 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Oct 8, 2008 5:33:04 PM (16 years ago)
Author:
vboxsync
Message:

#1865: More PGM changes.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMInternal.h

    r13099 r13100  
    16051605# endif
    16061606# ifdef PGMPOOL_WITH_MONITORING
    1607     /** Profiling the GC PT access handler. */
    1608     STAMPROFILE     StatMonitorGC;
     1607    /** Profiling the RC/R0 access handler. */
     1608    STAMPROFILE     StatMonitorRZ;
    16091609    /** Times we've failed interpreting the instruction. */
    1610     STAMCOUNTER     StatMonitorGCEmulateInstr;
    1611     /** Profiling the pgmPoolFlushPage calls made from the GC PT access handler. */
    1612     STAMPROFILE     StatMonitorGCFlushPage;
     1610    STAMCOUNTER     StatMonitorRZEmulateInstr;
     1611    /** Profiling the pgmPoolFlushPage calls made from the RC/R0 access handler. */
     1612    STAMPROFILE     StatMonitorRZFlushPage;
    16131613    /** Times we've detected fork(). */
    1614     STAMCOUNTER     StatMonitorGCFork;
    1615     /** Profiling the GC access we've handled (except REP STOSD). */
    1616     STAMPROFILE     StatMonitorGCHandled;
     1614    STAMCOUNTER     StatMonitorRZFork;
     1615    /** Profiling the RC/R0 access we've handled (except REP STOSD). */
     1616    STAMPROFILE     StatMonitorRZHandled;
    16171617    /** Times we've failed interpreting a patch code instruction. */
    1618     STAMCOUNTER     StatMonitorGCIntrFailPatch1;
     1618    STAMCOUNTER     StatMonitorRZIntrFailPatch1;
    16191619    /** Times we've failed interpreting a patch code instruction during flushing. */
    1620     STAMCOUNTER     StatMonitorGCIntrFailPatch2;
     1620    STAMCOUNTER     StatMonitorRZIntrFailPatch2;
    16211621    /** The number of times we've seen rep prefixes we can't handle. */
    1622     STAMCOUNTER     StatMonitorGCRepPrefix;
     1622    STAMCOUNTER     StatMonitorRZRepPrefix;
    16231623    /** Profiling the REP STOSD cases we've handled. */
    1624     STAMPROFILE     StatMonitorGCRepStosd;
    1625 
    1626     /** Profiling the HC PT access handler. */
    1627     STAMPROFILE     StatMonitorHC;
     1624    STAMPROFILE     StatMonitorRZRepStosd;
     1625
     1626    /** Profiling the R3 access handler. */
     1627    STAMPROFILE     StatMonitorR3;
    16281628    /** Times we've failed interpreting the instruction. */
    1629     STAMCOUNTER     StatMonitorHCEmulateInstr;
    1630     /** Profiling the pgmPoolFlushPage calls made from the HC PT access handler. */
    1631     STAMPROFILE     StatMonitorHCFlushPage;
     1629    STAMCOUNTER     StatMonitorR3EmulateInstr;
     1630    /** Profiling the pgmPoolFlushPage calls made from the R3 access handler. */
     1631    STAMPROFILE     StatMonitorR3FlushPage;
    16321632    /** Times we've detected fork(). */
    1633     STAMCOUNTER     StatMonitorHCFork;
    1634     /** Profiling the HC access we've handled (except REP STOSD). */
    1635     STAMPROFILE     StatMonitorHCHandled;
     1633    STAMCOUNTER     StatMonitorR3Fork;
     1634    /** Profiling the R3 access we've handled (except REP STOSD). */
     1635    STAMPROFILE     StatMonitorR3Handled;
    16361636    /** The number of times we've seen rep prefixes we can't handle. */
    1637     STAMCOUNTER     StatMonitorHCRepPrefix;
     1637    STAMCOUNTER     StatMonitorR3RepPrefix;
    16381638    /** Profiling the REP STOSD cases we've handled. */
    1639     STAMPROFILE     StatMonitorHCRepStosd;
     1639    STAMPROFILE     StatMonitorR3RepStosd;
    16401640    /** The number of times we're called in an async thread an need to flush. */
    1641     STAMCOUNTER     StatMonitorHCAsync;
     1641    STAMCOUNTER     StatMonitorR3Async;
    16421642    /** The high wather mark for cModifiedPages. */
    16431643    uint16_t        cModifiedPagesHigh;
  • trunk/src/VBox/VMM/PGMPool.cpp

    r13062 r13100  
    343343# endif
    344344# ifdef PGMPOOL_WITH_MONITORING
    345     STAM_REG(pVM, &pPool->StatMonitorGC,                STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/GC",                 STAMUNIT_TICKS_PER_CALL, "Profiling the GC PT access handler.");
    346     STAM_REG(pVM, &pPool->StatMonitorGCEmulateInstr,    STAMTYPE_COUNTER,   "/PGM/Pool/Monitor/GCEmulateInstr",     STAMUNIT_OCCURENCES,     "Times we've failed interpreting the instruction.");
    347     STAM_REG(pVM, &pPool->StatMonitorGCFlushPage,       STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/GCFlushPage",        STAMUNIT_TICKS_PER_CALL, "Profiling the pgmPoolFlushPage calls made from the GC PT access handler.");
    348     STAM_REG(pVM, &pPool->StatMonitorGCFork,            STAMTYPE_COUNTER,   "/PGM/Pool/Monitor/GCFork",             STAMUNIT_OCCURENCES,     "Times we've detected fork().");
    349     STAM_REG(pVM, &pPool->StatMonitorGCHandled,         STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/GCHandled",          STAMUNIT_TICKS_PER_CALL, "Profiling the GC access we've handled (except REP STOSD).");
    350     STAM_REG(pVM, &pPool->StatMonitorGCIntrFailPatch1,  STAMTYPE_COUNTER,   "/PGM/Pool/Monitor/GCIntrFailPatch1",   STAMUNIT_OCCURENCES,     "Times we've failed interpreting a patch code instruction.");
    351     STAM_REG(pVM, &pPool->StatMonitorGCIntrFailPatch2,  STAMTYPE_COUNTER,   "/PGM/Pool/Monitor/GCIntrFailPatch2",   STAMUNIT_OCCURENCES,     "Times we've failed interpreting a patch code instruction during flushing.");
    352     STAM_REG(pVM, &pPool->StatMonitorGCRepPrefix,       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->StatMonitorGCRepStosd,        STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/GCRepStosd",         STAMUNIT_TICKS_PER_CALL, "Profiling the REP STOSD cases we've handled.");
    354     STAM_REG(pVM, &pPool->StatMonitorHC,                STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/HC",                 STAMUNIT_TICKS_PER_CALL, "Profiling the HC PT access handler.");
    355     STAM_REG(pVM, &pPool->StatMonitorHCEmulateInstr,    STAMTYPE_COUNTER,   "/PGM/Pool/Monitor/HCEmulateInstr",     STAMUNIT_OCCURENCES,     "Times we've failed interpreting the instruction.");
    356     STAM_REG(pVM, &pPool->StatMonitorHCFlushPage,       STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/HCFlushPage",        STAMUNIT_TICKS_PER_CALL, "Profiling the pgmPoolFlushPage calls made from the HC PT access handler.");
    357     STAM_REG(pVM, &pPool->StatMonitorHCFork,            STAMTYPE_COUNTER,   "/PGM/Pool/Monitor/HCFork",             STAMUNIT_OCCURENCES,     "Times we've detected fork().");
    358     STAM_REG(pVM, &pPool->StatMonitorHCHandled,         STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/HCHandled",          STAMUNIT_TICKS_PER_CALL, "Profiling the HC access we've handled (except REP STOSD).");
    359     STAM_REG(pVM, &pPool->StatMonitorHCRepPrefix,       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->StatMonitorHCRepStosd,        STAMTYPE_PROFILE,   "/PGM/Pool/Monitor/HCRepStosd",         STAMUNIT_TICKS_PER_CALL, "Profiling the REP STOSD cases we've handled.");
    361     STAM_REG(pVM, &pPool->StatMonitorHCAsync,           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.");
    362362    STAM_REG(pVM, &pPool->cModifiedPages,               STAMTYPE_U16,       "/PGM/Pool/Monitor/cModifiedPages",     STAMUNIT_PAGES,          "The current cModifiedPages value.");
    363363    STAM_REG(pVM, &pPool->cModifiedPagesHigh,           STAMTYPE_U16_RESET, "/PGM/Pool/Monitor/cModifiedPagesHigh", STAMUNIT_PAGES,          "The high watermark for cModifiedPages.");
     
    514514static DECLCALLBACK(int) pgmR3PoolAccessHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser)
    515515{
    516     STAM_PROFILE_START(&pVM->pgm.s.pPoolR3->StatMonitorHC, a);
     516    STAM_PROFILE_START(&pVM->pgm.s.pPoolR3->StatMonitorR3, a);
    517517    PPGMPOOL pPool = pVM->pgm.s.pPoolR3;
    518518    PPGMPOOLPAGE pPage = (PPGMPOOLPAGE)pvUser;
     
    531531        Log(("pgmR3PoolAccessHandler: async thread, requesting EMT to flush the page: %p:{.Core=%RHp, .idx=%d, .GCPhys=%RGp, .enmType=%d}\n",
    532532             pPage, pPage->Core.Key, pPage->idx, pPage->GCPhys, pPage->enmKind));
    533         STAM_COUNTER_INC(&pPool->StatMonitorHCAsync);
     533        STAM_COUNTER_INC(&pPool->StatMonitorR3Async);
    534534        if (!pPage->fReusedFlushPending)
    535535        {
     
    548548            pgmPoolMonitorChainChanging(pPool, pPage, GCPhys, pvPhys, NULL);
    549549        }
    550         STAM_PROFILE_STOP(&pPool->StatMonitorHC, a);
     550        STAM_PROFILE_STOP(&pPool->StatMonitorR3, a);
    551551    }
    552552    else if (    (pPage->fCR3Mix || pPage->cModifications < 96) /* it's cheaper here. */
     
    558558        /** @todo r=bird: making unsafe assumption about not crossing entries here! */
    559559        pgmPoolMonitorChainChanging(pPool, pPage, GCPhys, pvPhys, NULL);
    560         STAM_PROFILE_STOP(&pPool->StatMonitorHC, a);
     560        STAM_PROFILE_STOP(&pPool->StatMonitorR3, a);
    561561    }
    562562    else
    563563    {
    564564        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->StatMonitorHC, &pPool->StatMonitorHCFlushPage, a);
     565        STAM_PROFILE_STOP_EX(&pPool->StatMonitorR3, &pPool->StatMonitorR3FlushPage, a);
    566566    }
    567567
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r13062 r13100  
    721721            )
    722722    {
    723         STAM_COUNTER_INC(&pPool->CTXMID(StatMonitor,Fork));
     723        STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,Fork));
    724724        return true;
    725725    }
     
    840840                     pRegFrame->cs, (RTGCPTR)pRegFrame->eip));
    841841            rc = VINF_SUCCESS;
    842             STAM_COUNTER_INC(&pPool->StatMonitorGCIntrFailPatch2);
     842            STAM_COUNTER_INC(&pPool->StatMonitorRZIntrFailPatch2);
    843843        }
    844844        else
     
    846846        {
    847847            rc = VINF_EM_RAW_EMULATE_INSTR;
    848             STAM_COUNTER_INC(&pPool->CTXMID(StatMonitor,EmulateInstr));
     848            STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,EmulateInstr));
    849849        }
    850850    }
     
    954954                  pRegFrame->cs, (RTGCPTR)pRegFrame->rip, pCpu->pCurInstr->opcode));
    955955        rc = VINF_EM_RAW_EMULATE_INSTR;
    956         STAM_COUNTER_INC(&pPool->CTXMID(StatMonitor,EmulateInstr));
     956        STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,EmulateInstr));
    957957    }
    958958
     
    990990DECLEXPORT(int) pgmPoolAccessHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser)
    991991{
    992     STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pPool)->CTXSUFF(StatMonitor), a);
     992    STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), a);
    993993    PPGMPOOL        pPool = pVM->pgm.s.CTX_SUFF(pPool);
    994994    PPGMPOOLPAGE    pPage = (PPGMPOOLPAGE)pvUser;
     
    10231023        {
    10241024             rc = pgmPoolAccessHandlerSimple(pVM, pPool, pPage, &Cpu, pRegFrame, GCPhysFault, pvFault);
    1025              STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTXSUFF(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);
    10261026             return rc;
    10271027        }
     
    10451045        {
    10461046             rc = pgmPoolAccessHandlerSTOSD(pVM, pPool, pPage, &Cpu, pRegFrame, GCPhysFault, pvFault);
    1047              STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTXSUFF(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);
    10481048             return rc;
    10491049        }
    10501050
    10511051        /* REP prefix, don't bother. */
    1052         STAM_COUNTER_INC(&pPool->CTXMID(StatMonitor,RepPrefix));
     1052        STAM_COUNTER_INC(&pPool->CTX_MID_Z(StatMonitor,RepPrefix));
    10531053        Log4(("pgmPoolAccessHandler: eax=%#x ecx=%#x edi=%#x esi=%#x eip=%VGv opcode=%d prefix=%#x\n",
    10541054              pRegFrame->eax, pRegFrame->ecx, pRegFrame->edi, pRegFrame->esi, pRegFrame->rip, Cpu.pCurInstr->opcode, Cpu.prefix));
     
    10661066    if (rc == VINF_EM_RAW_EMULATE_INSTR && fReused)
    10671067        rc = VINF_SUCCESS;
    1068     STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTXSUFF(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);
    10691069    return rc;
    10701070}
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