Changeset 91263 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 15, 2021 7:26:20 PM (3 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r91016 r91263 12412 12412 */ 12413 12413 #ifdef VBOX_WITH_STATISTICS 12414 # define IEMOP_INC_STATS(a_Stats) do { pVCpu->iem.s.CTX_SUFF(pStats)->a_Stats += 1; } while (0) 12414 # ifdef IN_RING3 12415 # define IEMOP_INC_STATS(a_Stats) do { pVCpu->iem.s.StatsR3.a_Stats += 1; } while (0) 12416 # else 12417 # define IEMOP_INC_STATS(a_Stats) do { pVCpu->iem.s.StatsRZ.a_Stats += 1; } while (0) 12418 # endif 12415 12419 #else 12416 12420 # define IEMOP_INC_STATS(a_Stats) do { } while (0) … … 14103 14107 VMMDECL(VBOXSTRICTRC) IEMExecOne(PVMCPUCC pVCpu) 14104 14108 { 14109 AssertCompile(sizeof(pVCpu->iem.s) <= sizeof(pVCpu->iem.padding)); /* (tstVMStruct can't do it's job w/o instruction stats) */ 14105 14110 #ifdef LOG_ENABLED 14106 14111 iemLogCurInstr(pVCpu, true, "IEMExecOne"); -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r82968 r91263 67 67 { 68 68 PVMCPU pVCpu = pVM->apCpusR3[idCpu]; 69 AssertCompile(sizeof(pVCpu->iem.s) <= sizeof(pVCpu->iem.padding)); /* (tstVMStruct can't do it's job w/o instruction stats) */ 69 70 70 71 pVCpu->iem.s.CodeTlb.uTlbRevision = pVCpu->iem.s.DataTlb.uTlbRevision = uInitialTlbRevision; … … 113 114 114 115 #if defined(VBOX_WITH_STATISTICS) && !defined(DOXYGEN_RUNNING) 115 /* Allocate instruction statistics and register them. */ 116 pVCpu->iem.s.pStatsR3 = (PIEMINSTRSTATS)MMR3HeapAllocZ(pVM, MM_TAG_IEM, sizeof(IEMINSTRSTATS)); 117 AssertLogRelReturn(pVCpu->iem.s.pStatsR3, VERR_NO_MEMORY); 118 int rc = MMHyperAlloc(pVM, sizeof(IEMINSTRSTATS), sizeof(uint64_t), MM_TAG_IEM, (void **)&pVCpu->iem.s.pStatsCCR3); 119 AssertLogRelRCReturn(rc, rc); 120 pVCpu->iem.s.pStatsR0 = MMHyperR3ToR0(pVM, pVCpu->iem.s.pStatsCCR3); 116 /* Instruction statistics: */ 121 117 # define IEM_DO_INSTR_STAT(a_Name, a_szDesc) \ 122 STAMR3RegisterF(pVM, &pVCpu->iem.s. pStatsCCR3->a_Name, STAMTYPE_U32_RESET, STAMVISIBILITY_USED, \118 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatsRZ.a_Name, STAMTYPE_U32_RESET, STAMVISIBILITY_USED, \ 123 119 STAMUNIT_COUNT, a_szDesc, "/IEM/CPU%u/instr-RZ/" #a_Name, idCpu); \ 124 STAMR3RegisterF(pVM, &pVCpu->iem.s. pStatsR3->a_Name, STAMTYPE_U32_RESET, STAMVISIBILITY_USED, \120 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatsR3.a_Name, STAMTYPE_U32_RESET, STAMVISIBILITY_USED, \ 125 121 STAMUNIT_COUNT, a_szDesc, "/IEM/CPU%u/instr-R3/" #a_Name, idCpu); 126 122 # include "IEMInstructionStatisticsTmpl.h" … … 193 189 { 194 190 NOREF(pVM); 195 #if defined(VBOX_WITH_STATISTICS) && !defined(DOXYGEN_RUNNING)196 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)197 {198 PVMCPU pVCpu = pVM->apCpusR3[idCpu];199 MMR3HeapFree(pVCpu->iem.s.pStatsR3);200 pVCpu->iem.s.pStatsR3 = NULL;201 }202 #endif203 191 return VINF_SUCCESS; 204 192 } -
trunk/src/VBox/VMM/include/IEMInternal.h
r91016 r91263 612 612 IEMTLB CodeTlb; 613 613 614 /** Pointer to instruction statistics for ring-0 context. */ 615 R0PTRTYPE(PIEMINSTRSTATS) pStatsR0;616 /** Ring-3 pointer to instruction statistics for non-ring-3 code. */617 R3PTRTYPE(PIEMINSTRSTATS) pStatsCCR3;618 /** Pointer to instruction statistics for ring-3 context. */619 R3PTRTYPE(PIEMINSTRSTATS) pStatsR3; 614 #if defined(VBOX_WITH_STATISTICS) && !defined(IN_TSTVMSTRUCT) && !defined(DOXYGEN_RUNNING) 615 /** Instruction statistics for ring-0/raw-mode. */ 616 IEMINSTRSTATS StatsRZ; 617 /** Instruction statistics for ring-3. */ 618 IEMINSTRSTATS StatsR3; 619 #endif 620 620 } IEMCPU; 621 621 AssertCompileMemberOffset(IEMCPU, fCurXcpt, 0x48);
Note:
See TracChangeset
for help on using the changeset viewer.