VirtualBox

Ignore:
Timestamp:
Jun 16, 2018 4:55:15 PM (7 years ago)
Author:
vboxsync
Message:

EM: More statistics for the history execution and probing. bugref:9044

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r72580 r72582  
    419419            break;
    420420
    421         /* Only status codes that EMHandleRCTmpl.h will resume EMHistoryExec with. */
     421        /*
     422         * Only status codes that EMHandleRCTmpl.h will resume EMHistoryExec with.
     423         */
    422424        case VINF_IOM_R3_IOPORT_READ:           /* -> emR3ExecuteIOInstruction */
    423425        case VINF_IOM_R3_IOPORT_WRITE:          /* -> emR3ExecuteIOInstruction */
     
    465467        case EMEXITACTION_EXEC_WITH_MAX:
    466468        {
     469            STAM_REL_PROFILE_START(&pVCpu->em.s.StatHistoryExec, a);
    467470            LogFlow(("EMHistoryExec/EXEC_WITH_MAX: %RX64, max %u\n", pExitRec->uFlatPC, pExitRec->cMaxInstructionsWithoutExit));
    468471            VBOXSTRICTRC rcStrict = IEMExecForExits(pVCpu, fWillExit,
     
    474477                     VBOXSTRICTRC_VAL(rcStrict), ExecStats.cExits, ExecStats.cMaxExitDistance, ExecStats.cInstructions));
    475478            emHistoryExecSetContinueExitRecIdx(pVCpu, rcStrict, pExitRec);
     479            if (ExecStats.cExits > 1)
     480                STAM_REL_COUNTER_ADD(&pVCpu->em.s.StatHistoryExecSavedExits, ExecStats.cExits - 1);
     481            STAM_REL_COUNTER_ADD(&pVCpu->em.s.StatHistoryExecInstructions, ExecStats.cInstructions);
     482            STAM_REL_PROFILE_STOP(&pVCpu->em.s.StatHistoryExec, a);
    476483            return rcStrict;
    477484        }
     
    482489        case EMEXITACTION_EXEC_PROBE:
    483490        {
     491            STAM_REL_PROFILE_START(&pVCpu->em.s.StatHistoryProbe, b);
    484492            LogFlow(("EMHistoryExec/EXEC_PROBE: %RX64\n", pExitRec->uFlatPC));
    485493            PEMEXITREC   pExitRecUnconst = (PEMEXITREC)pExitRec;
     
    498506                pExitRecUnconst->enmAction = EMEXITACTION_EXEC_WITH_MAX;
    499507                LogFlow(("EMHistoryExec/EXEC_PROBE: -> EXEC_WITH_MAX %u\n", ExecStats.cMaxExitDistance));
     508                STAM_REL_COUNTER_INC(&pVCpu->em.s.StatHistoryProbedExecWithMax);
    500509            }
    501510#ifndef IN_RING3
    502511            else if (pVCpu->em.s.idxContinueExitRec != UINT16_MAX)
     512            {
     513                STAM_REL_COUNTER_INC(&pVCpu->em.s.StatHistoryProbedToRing3);
    503514                LogFlow(("EMHistoryExec/EXEC_PROBE: -> ring-3\n"));
     515            }
    504516#endif
    505517            else
     
    508520                pVCpu->em.s.idxContinueExitRec = UINT16_MAX;
    509521                LogFlow(("EMHistoryExec/EXEC_PROBE: -> PROBED\n"));
     522                STAM_REL_COUNTER_INC(&pVCpu->em.s.StatHistoryProbedNormal);
    510523            }
     524            STAM_REL_COUNTER_ADD(&pVCpu->em.s.StatHistoryProbeInstructions, ExecStats.cInstructions);
     525            STAM_REL_PROFILE_STOP(&pVCpu->em.s.StatHistoryProbe, b);
    511526            return rcStrict;
    512527        }
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