VirtualBox

Changeset 15017 in vbox


Ignore:
Timestamp:
Dec 5, 2008 8:58:38 AM (16 years ago)
Author:
vboxsync
Message:

More detailed statistics for CRx accesses.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCM.cpp

    r14995 r15017  
    187187        HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitCpuid,              "/HWACCM/CPU%d/Exit/Instr/Cpuid");
    188188        HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitRdtsc,              "/HWACCM/CPU%d/Exit/Instr/Rdtsc");
    189         HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitCRxWrite,           "/HWACCM/CPU%d/Exit/Instr/CR/Write");
    190         HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitCRxRead,            "/HWACCM/CPU%d/Exit/Instr/CR/Read");
    191189        HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitDRxWrite,           "/HWACCM/CPU%d/Exit/Instr/DR/Write");
    192190        HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitDRxRead,            "/HWACCM/CPU%d/Exit/Instr/DR/Read");
     
    223221        HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatDRxContextSwitch,       "/HWACCM/CPU%d/Debug/ContextSwitch");
    224222        HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatDRxIOCheck,             "/HWACCM/CPU%d/Debug/IOCheck");
     223
     224        for (int j=0;i<RT_ELEMENTS(pVCpu->hwaccm.s.StatExitCRxWrite);j++)
     225        {
     226            rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.StatExitCRxWrite[j], STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of CRx writes",
     227                                "/HWACCM/CPU%d/Exit/Instr/CR/Write/%", j);
     228            AssertRC(rc);
     229            rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.StatExitCRxRead[j], STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of CRx reads",
     230                                "/HWACCM/CPU%d/Exit/Instr/CR/Read/%", j);
     231            AssertRC(rc);
     232        }
    225233
    226234#undef HWACCM_REG_COUNTER
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r14899 r15017  
    499499    STAMCOUNTER             StatExitCpuid;
    500500    STAMCOUNTER             StatExitRdtsc;
    501     STAMCOUNTER             StatExitCRxWrite;
    502     STAMCOUNTER             StatExitCRxRead;
     501    STAMCOUNTER             StatExitCRxWrite[8];
     502    STAMCOUNTER             StatExitCRxRead[8];
    503503    STAMCOUNTER             StatExitDRxWrite;
    504504    STAMCOUNTER             StatExitDRxRead;
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r14993 r15017  
    16591659
    16601660        Log2(("SVM: %RGv mov cr%d, \n", (RTGCPTR)pCtx->rip, exitCode - SVM_EXIT_WRITE_CR0));
    1661         STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxWrite);
     1661        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxWrite[exitCode - SVM_EXIT_WRITE_CR0]);
    16621662        rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
    16631663
     
    17131713
    17141714        Log2(("SVM: %RGv mov x, cr%d\n", (RTGCPTR)pCtx->rip, exitCode - SVM_EXIT_READ_CR0));
    1715         STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxRead);
     1715        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxRead[exitCode - SVM_EXIT_WRITE_CR0]);
    17161716        rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
    17171717        if (rc == VINF_SUCCESS)
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r14997 r15017  
    26112611        case VMX_EXIT_QUALIFICATION_CRX_ACCESS_WRITE:
    26122612            Log2(("VMX: %RGv mov cr%d, x\n", (RTGCPTR)pCtx->rip, VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification)));
    2613             STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxWrite);
     2613            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxWrite[VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification)]);
    26142614            rc = EMInterpretCRxWrite(pVM, CPUMCTX2CORE(pCtx),
    26152615                                     VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification),
     
    26502650        case VMX_EXIT_QUALIFICATION_CRX_ACCESS_READ:
    26512651            Log2(("VMX: mov x, crx\n"));
    2652             STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxRead);
     2652            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitCRxRead[VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification)]);
    26532653
    26542654            Assert(!pVM->hwaccm.s.fNestedPaging || !CPUMIsGuestInPagedProtectedModeEx(pCtx) || VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != USE_REG_CR3);
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