VirtualBox

Changeset 91264 in vbox for trunk/src


Ignore:
Timestamp:
Sep 15, 2021 7:35:24 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146923
Message:

VMM/EM: Copied the two stats we still use from EMSTATS and into the EMCPU structure, avoiding the hyper heap and pointers. bugref:10093

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r90346 r91264  
    229229         */
    230230#ifdef VBOX_WITH_STATISTICS
    231         PEMSTATS pStats;
    232         rc = MMHyperAlloc(pVM, sizeof(*pStats), 0, MM_TAG_EM, (void **)&pStats);
    233         if (RT_FAILURE(rc))
    234             return rc;
    235 
    236         pVCpu->em.s.pStatsR3 = pStats;
    237         pVCpu->em.s.pStatsR0 = MMHyperR3ToR0(pVM, pStats);
    238 
    239 # if 1 /* rawmode only? */
    240         EM_REG_COUNTER_USED(&pStats->StatIoRestarted,       "/EM/CPU%u/R3/PrivInst/IoRestarted",        "I/O instructions restarted in ring-3.");
    241         EM_REG_COUNTER_USED(&pStats->StatIoIem,             "/EM/CPU%u/R3/PrivInst/IoIem",              "I/O instructions end to IEM in ring-3.");
    242         EM_REG_COUNTER_USED(&pStats->StatCli,               "/EM/CPU%u/R3/PrivInst/Cli",                "Number of cli instructions.");
    243         EM_REG_COUNTER_USED(&pStats->StatSti,               "/EM/CPU%u/R3/PrivInst/Sti",                "Number of sli instructions.");
    244         EM_REG_COUNTER_USED(&pStats->StatHlt,               "/EM/CPU%u/R3/PrivInst/Hlt",                "Number of hlt instructions not handled in GC because of PATM.");
    245         EM_REG_COUNTER_USED(&pStats->StatInvlpg,            "/EM/CPU%u/R3/PrivInst/Invlpg",             "Number of invlpg instructions.");
    246         EM_REG_COUNTER_USED(&pStats->StatMisc,              "/EM/CPU%u/R3/PrivInst/Misc",               "Number of misc. instructions.");
    247         EM_REG_COUNTER_USED(&pStats->StatMovWriteCR[0],     "/EM/CPU%u/R3/PrivInst/Mov CR0, X",         "Number of mov CR0 write instructions.");
    248         EM_REG_COUNTER_USED(&pStats->StatMovWriteCR[1],     "/EM/CPU%u/R3/PrivInst/Mov CR1, X",         "Number of mov CR1 write instructions.");
    249         EM_REG_COUNTER_USED(&pStats->StatMovWriteCR[2],     "/EM/CPU%u/R3/PrivInst/Mov CR2, X",         "Number of mov CR2 write instructions.");
    250         EM_REG_COUNTER_USED(&pStats->StatMovWriteCR[3],     "/EM/CPU%u/R3/PrivInst/Mov CR3, X",         "Number of mov CR3 write instructions.");
    251         EM_REG_COUNTER_USED(&pStats->StatMovWriteCR[4],     "/EM/CPU%u/R3/PrivInst/Mov CR4, X",         "Number of mov CR4 write instructions.");
    252         EM_REG_COUNTER_USED(&pStats->StatMovReadCR[0],      "/EM/CPU%u/R3/PrivInst/Mov X, CR0",         "Number of mov CR0 read instructions.");
    253         EM_REG_COUNTER_USED(&pStats->StatMovReadCR[1],      "/EM/CPU%u/R3/PrivInst/Mov X, CR1",         "Number of mov CR1 read instructions.");
    254         EM_REG_COUNTER_USED(&pStats->StatMovReadCR[2],      "/EM/CPU%u/R3/PrivInst/Mov X, CR2",         "Number of mov CR2 read instructions.");
    255         EM_REG_COUNTER_USED(&pStats->StatMovReadCR[3],      "/EM/CPU%u/R3/PrivInst/Mov X, CR3",         "Number of mov CR3 read instructions.");
    256         EM_REG_COUNTER_USED(&pStats->StatMovReadCR[4],      "/EM/CPU%u/R3/PrivInst/Mov X, CR4",         "Number of mov CR4 read instructions.");
    257         EM_REG_COUNTER_USED(&pStats->StatMovDRx,            "/EM/CPU%u/R3/PrivInst/MovDRx",             "Number of mov DRx instructions.");
    258         EM_REG_COUNTER_USED(&pStats->StatIret,              "/EM/CPU%u/R3/PrivInst/Iret",               "Number of iret instructions.");
    259         EM_REG_COUNTER_USED(&pStats->StatMovLgdt,           "/EM/CPU%u/R3/PrivInst/Lgdt",               "Number of lgdt instructions.");
    260         EM_REG_COUNTER_USED(&pStats->StatMovLidt,           "/EM/CPU%u/R3/PrivInst/Lidt",               "Number of lidt instructions.");
    261         EM_REG_COUNTER_USED(&pStats->StatMovLldt,           "/EM/CPU%u/R3/PrivInst/Lldt",               "Number of lldt instructions.");
    262         EM_REG_COUNTER_USED(&pStats->StatSysEnter,          "/EM/CPU%u/R3/PrivInst/Sysenter",           "Number of sysenter instructions.");
    263         EM_REG_COUNTER_USED(&pStats->StatSysExit,           "/EM/CPU%u/R3/PrivInst/Sysexit",            "Number of sysexit instructions.");
    264         EM_REG_COUNTER_USED(&pStats->StatSysCall,           "/EM/CPU%u/R3/PrivInst/Syscall",            "Number of syscall instructions.");
    265         EM_REG_COUNTER_USED(&pStats->StatSysRet,            "/EM/CPU%u/R3/PrivInst/Sysret",             "Number of sysret instructions.");
    266         EM_REG_COUNTER(&pVCpu->em.s.StatTotalClis,          "/EM/CPU%u/Cli/Total",                      "Total number of cli instructions executed.");
    267 #endif
    268         pVCpu->em.s.pCliStatTree = 0;
     231        EM_REG_COUNTER_USED(&pVCpu->em.s.StatIoRestarted,   "/EM/CPU%u/R3/PrivInst/IoRestarted",        "I/O instructions restarted in ring-3.");
     232        EM_REG_COUNTER_USED(&pVCpu->em.s.StatIoIem,         "/EM/CPU%u/R3/PrivInst/IoIem",              "I/O instructions end to IEM in ring-3.");
    269233
    270234        /* these should be considered for release statistics. */
     
    508472            AssertRCReturn(rc, rc);
    509473        }
    510 
    511         Assert(!pVCpu->em.s.pCliStatTree);
    512474    }
    513475    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR3/EMHM.cpp

    r82968 r91264  
    254254        rcStrict = EMHistoryExec(pVCpu, &pVCpu->em.s.aExitRecords[idxContinueExitRec], 0);
    255255        LogFlow(("emR3HmExecuteIOInstruction: %Rrc (EMHistoryExec)\n", VBOXSTRICTRC_VAL(rcStrict)));
    256         STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->StatIoRestarted);
    257     }
    258 
    259     STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->StatIoIem);
     256        STAM_COUNTER_INC(&pVCpu->em.s.StatIoRestarted);
     257    }
     258
     259    STAM_COUNTER_INC(&pVCpu->em.s.StatIoIem);
    260260    STAM_PROFILE_STOP(&pVCpu->em.s.StatIOEmu, a);
    261261    return VBOXSTRICTRC_TODO(rcStrict);
  • trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp

    r82968 r91264  
    251251        rcStrict = IEMExecOne(pVCpu);
    252252        LogFlow(("emR3NemExecuteIOInstruction: %Rrc (IEMExecOne)\n", VBOXSTRICTRC_VAL(rcStrict)));
    253         STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->StatIoIem);
     253        STAM_COUNTER_INC(&pVCpu->em.s.StatIoIem);
    254254    }
    255255    else
     
    258258        rcStrict = EMHistoryExec(pVCpu, &pVCpu->em.s.aExitRecords[idxContinueExitRec], 0);
    259259        LogFlow(("emR3NemExecuteIOInstruction: %Rrc (EMHistoryExec)\n", VBOXSTRICTRC_VAL(rcStrict)));
    260         STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->StatIoRestarted);
     260        STAM_COUNTER_INC(&pVCpu->em.s.StatIoRestarted);
    261261    }
    262262
  • trunk/src/VBox/VMM/include/EMInternal.h

    r89993 r91264  
    7878AssertCompileMemberAlignment(CLISTAT, Counter, 8);
    7979#endif
    80 
    81 
    82 /**
    83  * Excessive (used to be) EM statistics.
    84  */
    85 typedef struct EMSTATS
    86 {
    87 #if 1 /* rawmode only? */
    88     /** @name Privileged Instructions Ending Up In HC.
    89      * @{ */
    90     STAMCOUNTER             StatIoRestarted;
    91     STAMCOUNTER             StatIoIem;
    92     STAMCOUNTER             StatCli;
    93     STAMCOUNTER             StatSti;
    94     STAMCOUNTER             StatInvlpg;
    95     STAMCOUNTER             StatHlt;
    96     STAMCOUNTER             StatMovReadCR[DISCREG_CR4 + 1];
    97     STAMCOUNTER             StatMovWriteCR[DISCREG_CR4 + 1];
    98     STAMCOUNTER             StatMovDRx;
    99     STAMCOUNTER             StatIret;
    100     STAMCOUNTER             StatMovLgdt;
    101     STAMCOUNTER             StatMovLldt;
    102     STAMCOUNTER             StatMovLidt;
    103     STAMCOUNTER             StatMisc;
    104     STAMCOUNTER             StatSysEnter;
    105     STAMCOUNTER             StatSysExit;
    106     STAMCOUNTER             StatSysCall;
    107     STAMCOUNTER             StatSysRet;
    108     /** @} */
    109 #endif
    110 } EMSTATS;
    111 /** Pointer to the excessive EM statistics. */
    112 typedef EMSTATS *PEMSTATS;
    11380
    11481
     
    261228    /** R3: Profiling of emR3RawExecuteIOInstruction. */
    262229    STAMPROFILE             StatIOEmu;
     230    STAMCOUNTER             StatIoRestarted;
     231    STAMCOUNTER             StatIoIem;
    263232    /** R3: Profiling of emR3RawPrivileged. */
    264233    STAMPROFILE             StatPrivEmu;
     
    268237    STAMCOUNTER             StatNEMExecuteCalled;
    269238
    270     /** More statistics (R3). */
    271     R3PTRTYPE(PEMSTATS)     pStatsR3;
    272     /** More statistics (R0). */
    273     R0PTRTYPE(PEMSTATS)     pStatsR0;
    274 
    275     /** Tree for keeping track of cli occurrences (debug only). */
    276     R3PTRTYPE(PAVLGCPTRNODECORE) pCliStatTree;
    277     STAMCOUNTER             StatTotalClis;
    278     /** Align the next member at a 16-byte boundrary. */
    279     uint64_t                au64Padding2[1];
     239    /** Align the next member at a 32-byte boundrary. */
     240    uint64_t                au64Padding2[1+2];
    280241
    281242    /** Exit history table (6KB). */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette