VirtualBox

Changeset 82380 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 4, 2019 12:41:02 PM (5 years ago)
Author:
vboxsync
Message:

IOM: More stats cleanups (mostly MMIO). bugref:9218

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

Legend:

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

    r82313 r82380  
    652652                                                   RTGCPHYS GCPhysFault, CTX_SUFF(PIOMMMIOENTRY) pRegEntry)
    653653{
    654     STAM_PROFILE_START(&pVM->iom.s.StatRZMMIOHandler, a);
    655654    Log(("iomMmioCommonPfHandler: GCPhysFault=%RGp uErr=%#x rip=%RGv\n", GCPhysFault, uErrorCode, CPUMGetGuestRIP(pVCpu) ));
    656655    RT_NOREF(GCPhysFault, uErrorCode);
     
    693692            }
    694693#ifndef IN_RING3
    695             STAM_PROFILE_STOP(&pVM->iom.s.StatRZMMIOHandler, a);
    696694            return rcStrict;
    697695        }
    698         else
    699             STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIODevLockContention);
     696        STAM_COUNTER_INC(&pVM->iom.s.StatMmioDevLockContentionR0);
    700697    }
    701698    else
     
    709706        {
    710707            STAM_COUNTER_INC(&pStats->WriteRZToR3);
    711             STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIOWritesToR3);
     708            STAM_COUNTER_INC(&pVM->iom.s.StatMmioWritesR0ToR3);
    712709        }
    713710        else
    714711        {
    715712            STAM_COUNTER_INC(&pStats->ReadRZToR3);
    716             STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIOReadsToR3);
     713            STAM_COUNTER_INC(&pVM->iom.s.StatMmioReadsR0ToR3);
    717714        }
    718715    }
     
    721718    RT_NOREF(pVM, pRegEntry);
    722719#endif /* IN_RING3 */
    723 
    724     STAM_PROFILE_STOP(&pVM->iom.s.StatRZMMIOHandler, a);
    725720    return rcStrict;
    726721}
     
    736731                                             RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser)
    737732{
    738     STAM_COUNTER_INC(&pVM->iom.s.StatMmioPfHandlerNew);
     733    STAM_PROFILE_START(&pVM->iom.s.StatMmioPfHandler, Prf);
    739734    LogFlow(("iomMmioPfHandlerNew: GCPhys=%RGp uErr=%#x pvFault=%RGv rip=%RGv\n",
    740735             GCPhysFault, (uint32_t)uErrorCode, pvFault, (RTGCPTR)pCtxCore->rip));
     
    750745# endif
    751746
    752     return iomMmioCommonPfHandlerNew(pVM, pVCpu, (uint32_t)uErrorCode, GCPhysFault, pRegEntry);
     747    VBOXSTRICTRC rcStrict = iomMmioCommonPfHandlerNew(pVM, pVCpu, (uint32_t)uErrorCode, GCPhysFault, pRegEntry);
     748
     749    STAM_PROFILE_STOP(&pVM->iom.s.StatMmioPfHandler, Prf);
     750    return rcStrict;
    753751}
    754752
     
    769767VMM_INT_DECL(VBOXSTRICTRC) IOMR0MmioPhysHandler(PVMCC pVM, PVMCPUCC pVCpu, uint32_t uErrorCode, RTGCPHYS GCPhysFault)
    770768{
    771     STAM_COUNTER_INC(&pVM->iom.s.StatMmioPhysHandlerNew);
     769    STAM_PROFILE_START(&pVM->iom.s.StatMmioPhysHandler, Prf);
    772770
    773771    /*
     
    787785    else if (rcStrict == VERR_SEM_BUSY)
    788786        rcStrict = VINF_IOM_R3_MMIO_READ_WRITE;
     787
     788    STAM_PROFILE_STOP(&pVM->iom.s.StatMmioPhysHandler, Prf);
    789789    return rcStrict;
    790790}
     
    801801{
    802802    STAM_PROFILE_START(UnusedMacroArg, Prf);
    803     STAM_COUNTER_INC(&pVM->iom.s.CTX_SUFF(StatMmioHandlerNew));
     803    STAM_COUNTER_INC(&pVM->iom.s.CTX_SUFF(StatMmioHandler));
    804804    Log4(("iomMmioHandlerNew: GCPhysFault=%RGp cbBuf=%#x enmAccessType=%d enmOrigin=%d pvUser=%p\n", GCPhysFault, cbBuf, enmAccessType, enmOrigin, pvUser));
    805805
     
    867867              pDevIns, pvUser));
    868868        STAM_COUNTER_INC(enmAccessType == PGMACCESSTYPE_READ ? &pStats->ReadRZToR3 : &pStats->WriteRZToR3);
    869         STAM_COUNTER_INC(enmAccessType == PGMACCESSTYPE_READ ? &pVM->iom.s.StatRZMMIOReadsToR3 : &pVM->iom.s.StatRZMMIOWritesToR3);
     869        STAM_COUNTER_INC(enmAccessType == PGMACCESSTYPE_READ ? &pVM->iom.s.StatMmioReadsR0ToR3 : &pVM->iom.s.StatMmioWritesR0ToR3);
    870870        return rcToRing3;
    871871    }
     
    887887    else
    888888    {
    889         STAM_REL_COUNTER_INC(&pVM->iom.s.StatMMIOStaleMappings);
     889        STAM_REL_COUNTER_INC(&pVM->iom.s.StatMmioStaleMappings);
    890890        LogRelMax(64, ("iomMmioHandlerNew: Stale access at %#RGp to range #%#x currently residing at %RGp LB %RGp\n",
    891891                       GCPhysFault, pRegEntry->idxSelf, GCPhysMapping, pRegEntry->cbRegion));
     
    896896#else
    897897        STAM_COUNTER_INC(enmAccessType == PGMACCESSTYPE_READ ? &pStats->ReadRZToR3 : &pStats->WriteRZToR3);
    898         STAM_COUNTER_INC(enmAccessType == PGMACCESSTYPE_READ ? &pVM->iom.s.StatRZMMIOReadsToR3 : &pVM->iom.s.StatRZMMIOWritesToR3);
     898        STAM_COUNTER_INC(enmAccessType == PGMACCESSTYPE_READ ? &pVM->iom.s.StatMmioReadsR0ToR3 : &pVM->iom.s.StatMmioWritesR0ToR3);
    899899        return rcToRing3;
    900900#endif
     
    925925            {
    926926                STAM_COUNTER_INC(&pStats->ReadRZToR3);
    927                 STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIOReadsToR3);
     927                STAM_COUNTER_INC(&pVM->iom.s.StatMmioReadsR0ToR3);
    928928            }
    929929            else
     
    945945            {
    946946                STAM_COUNTER_INC(&pStats->WriteRZToR3);
    947                 STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIOWritesToR3);
     947                STAM_COUNTER_INC(&pVM->iom.s.StatMmioWritesR0ToR3);
    948948            }
    949949            else if (rcStrict == VINF_IOM_R3_MMIO_COMMIT_WRITE)
    950950            {
    951951                STAM_COUNTER_INC(&pStats->CommitRZToR3);
    952                 STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIOCommitsToR3);
     952                STAM_COUNTER_INC(&pVM->iom.s.StatMmioCommitsR0ToR3);
    953953            }
    954954            else
     
    991991        {
    992992            STAM_COUNTER_INC(&pStats->CommitRZToR3);
    993             STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIOCommitsToR3);
     993            STAM_COUNTER_INC(&pVM->iom.s.StatMmioCommitsR0ToR3);
    994994        }
    995995        else
    996996        {
    997997            STAM_COUNTER_INC(&pStats->WriteRZToR3);
    998             STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIOWritesToR3);
    999         }
    1000         STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIODevLockContention);
     998            STAM_COUNTER_INC(&pVM->iom.s.StatMmioWritesR0ToR3);
     999        }
     1000        STAM_COUNTER_INC(&pVM->iom.s.StatMmioDevLockContentionR0);
    10011001    }
    10021002    else if (rcStrict == VINF_IOM_R3_MMIO_READ)
     
    10041004        Assert(enmAccessType == PGMACCESSTYPE_READ);
    10051005        STAM_COUNTER_INC(&pStats->ReadRZToR3);
    1006         STAM_COUNTER_INC(&pVM->iom.s.StatRZMMIODevLockContention);
     1006        STAM_COUNTER_INC(&pVM->iom.s.StatMmioDevLockContentionR0);
    10071007    }
    10081008#endif
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r82378 r82380  
    173173
    174174    /*
    175      * Statistics.
    176      */
    177     STAM_REG(pVM, &pVM->iom.s.StatIoPortCommits,      STAMTYPE_COUNTER, "/IOM/IoPortCommits",                       STAMUNIT_OCCURENCES,     "Number of ring-3 I/O port commits.");
    178     STAM_REG(pVM, &pVM->iom.s.StatIoPortIn,           STAMTYPE_PROFILE, "/IOM/IoPortIN",                            STAMUNIT_OCCURENCES,     "Number of IN instructions (attempts)");
    179     STAM_REG(pVM, &pVM->iom.s.StatIoPortInS,          STAMTYPE_PROFILE, "/IOM/IoPortINS",                           STAMUNIT_OCCURENCES,     "Number of INS instructions (attempts)");
    180     STAM_REG(pVM, &pVM->iom.s.StatIoPortOutS,         STAMTYPE_PROFILE, "/IOM/IoPortOUT",                           STAMUNIT_OCCURENCES,     "Number of OUT instructions (attempts)");
    181     STAM_REG(pVM, &pVM->iom.s.StatIoPortOutS,         STAMTYPE_PROFILE, "/IOM/IoPortOUTS",                          STAMUNIT_OCCURENCES,     "Number of OUTS instructions (attempts)");
    182 
    183     STAM_REL_REG(pVM, &pVM->iom.s.StatMMIOStaleMappings, STAMTYPE_PROFILE, "/IOM/MMIOStaleMappings",                STAMUNIT_TICKS_PER_CALL, "Number of times iomMmioHandlerNew got a call for a remapped range at the old mapping.");
    184     STAM_REG(pVM, &pVM->iom.s.StatRZMMIOHandler,      STAMTYPE_PROFILE, "/IOM/RZ-MMIOHandler",                      STAMUNIT_TICKS_PER_CALL, "Profiling of the iomMmioPfHandler() body, only success calls.");
    185     STAM_REG(pVM, &pVM->iom.s.StatRZMMIOReadsToR3,    STAMTYPE_COUNTER, "/IOM/RZ-MMIOHandler/ReadsToR3",            STAMUNIT_OCCURENCES,     "Number of read deferred to ring-3.");
    186     STAM_REG(pVM, &pVM->iom.s.StatRZMMIOWritesToR3,   STAMTYPE_COUNTER, "/IOM/RZ-MMIOHandler/WritesToR3",           STAMUNIT_OCCURENCES,     "Number of writes deferred to ring-3.");
    187     STAM_REG(pVM, &pVM->iom.s.StatRZMMIOCommitsToR3,  STAMTYPE_COUNTER, "/IOM/RZ-MMIOHandler/CommitsToR3",          STAMUNIT_OCCURENCES,     "Number of commits deferred to ring-3.");
    188     STAM_REG(pVM, &pVM->iom.s.StatRZMMIODevLockContention, STAMTYPE_COUNTER, "/IOM/RZ-MMIOHandler/DevLockContention", STAMUNIT_OCCURENCES,   "Number of device lock contention force return to ring-3.");
    189     STAM_REG(pVM, &pVM->iom.s.StatR3MMIOHandler,      STAMTYPE_COUNTER, "/IOM/R3-MMIOHandler",                      STAMUNIT_OCCURENCES,     "Number of calls to iomMmioHandler.");
    190 
    191     STAM_REG(pVM, &pVM->iom.s.StatMmioHandlerR3,      STAMTYPE_COUNTER, "/IOM/OldMmioHandlerR3",                    STAMUNIT_OCCURENCES,     "Number of calls to old iomMmioHandler from ring-3.");
    192     STAM_REG(pVM, &pVM->iom.s.StatMmioHandlerR0,      STAMTYPE_COUNTER, "/IOM/OldMmioHandlerR0",                    STAMUNIT_OCCURENCES,     "Number of calls to old iomMmioHandler from ring-0.");
    193 
    194     STAM_REG(pVM, &pVM->iom.s.StatMmioHandlerNewR3,   STAMTYPE_COUNTER, "/IOM/MmioHandlerNewR3",                    STAMUNIT_OCCURENCES,     "Number of calls to iomMmioHandlerNew from ring-3.");
    195     STAM_REG(pVM, &pVM->iom.s.StatMmioHandlerNewR0,   STAMTYPE_COUNTER, "/IOM/MmioHandlerNewR0",                    STAMUNIT_OCCURENCES,     "Number of calls to iomMmioHandlerNew from ring-0.");
    196     STAM_REG(pVM, &pVM->iom.s.StatMmioPfHandlerNew,   STAMTYPE_COUNTER, "/IOM/MmioPfHandlerNew",                    STAMUNIT_OCCURENCES,     "Number of calls to iomMmioPfHandlerNew.");
    197     STAM_REG(pVM, &pVM->iom.s.StatMmioPhysHandlerNew, STAMTYPE_COUNTER, "/IOM/MmioPhysHandlerNew",                  STAMUNIT_OCCURENCES,     "Number of calls to IOMR0MmioPhysHandler.");
    198     STAM_REG(pVM, &pVM->iom.s.StatMmioCommitsDirect,  STAMTYPE_COUNTER, "/IOM/MmioCommitsDirect",                   STAMUNIT_OCCURENCES,     "Number of ring-3 MMIO commits direct to handler via handle hint.");
    199     STAM_REG(pVM, &pVM->iom.s.StatMmioCommitsPgm,     STAMTYPE_COUNTER, "/IOM/MmioCommitsPgm",                      STAMUNIT_OCCURENCES,     "Number of ring-3 MMIO commits via PGM.");
     175     * Statistics (names are somewhat contorted to make the registration
     176     * sub-trees appear at the end of each group).
     177     */
     178    STAM_REG(pVM, &pVM->iom.s.StatIoPortCommits,    STAMTYPE_COUNTER, "/IOM/IoPortCommits",     STAMUNIT_OCCURENCES, "Number of ring-3 I/O port commits.");
     179    STAM_REG(pVM, &pVM->iom.s.StatIoPortIn,         STAMTYPE_PROFILE, "/IOM/IoPortIN",          STAMUNIT_OCCURENCES, "Number of IN instructions (attempts)");
     180    STAM_REG(pVM, &pVM->iom.s.StatIoPortInS,        STAMTYPE_PROFILE, "/IOM/IoPortINS",         STAMUNIT_OCCURENCES, "Number of INS instructions (attempts)");
     181    STAM_REG(pVM, &pVM->iom.s.StatIoPortOutS,       STAMTYPE_PROFILE, "/IOM/IoPortOUT",         STAMUNIT_OCCURENCES, "Number of OUT instructions (attempts)");
     182    STAM_REG(pVM, &pVM->iom.s.StatIoPortOutS,       STAMTYPE_PROFILE, "/IOM/IoPortOUTS",        STAMUNIT_OCCURENCES, "Number of OUTS instructions (attempts)");
     183
     184    STAM_REG(pVM, &pVM->iom.s.StatMmioHandlerR3,    STAMTYPE_COUNTER, "/IOM/MmioHandlerR3",     STAMUNIT_OCCURENCES, "Number of calls to iomMmioHandlerNew from ring-3.");
     185    STAM_REG(pVM, &pVM->iom.s.StatMmioHandlerR0,    STAMTYPE_COUNTER, "/IOM/MmioHandlerR0",     STAMUNIT_OCCURENCES, "Number of calls to iomMmioHandlerNew from ring-0.");
     186    STAM_REG(pVM, &pVM->iom.s.StatMmioReadsR0ToR3,  STAMTYPE_COUNTER, "/IOM/MmioR0ToR3Reads",   STAMUNIT_OCCURENCES, "Number of reads deferred to ring-3.");
     187    STAM_REG(pVM, &pVM->iom.s.StatMmioWritesR0ToR3, STAMTYPE_COUNTER, "/IOM/MmioR0ToR3Writes",  STAMUNIT_OCCURENCES, "Number of writes deferred to ring-3.");
     188    STAM_REG(pVM, &pVM->iom.s.StatMmioCommitsR0ToR3,STAMTYPE_COUNTER, "/IOM/MmioR0ToR3Commits", STAMUNIT_OCCURENCES, "Number of commits deferred to ring-3.");
     189    STAM_REG(pVM, &pVM->iom.s.StatMmioPfHandler,    STAMTYPE_PROFILE, "/IOM/MmioPfHandler",     STAMUNIT_OCCURENCES, "Number of calls to iomMmioPfHandlerNew.");
     190    STAM_REG(pVM, &pVM->iom.s.StatMmioPhysHandler,  STAMTYPE_PROFILE, "/IOM/MmioPhysHandler",   STAMUNIT_OCCURENCES, "Number of calls to IOMR0MmioPhysHandler.");
     191    STAM_REG(pVM, &pVM->iom.s.StatMmioCommitsDirect,STAMTYPE_COUNTER, "/IOM/MmioCommitsDirect", STAMUNIT_OCCURENCES, "Number of ring-3 MMIO commits direct to handler via handle hint.");
     192    STAM_REG(pVM, &pVM->iom.s.StatMmioCommitsPgm,   STAMTYPE_COUNTER, "/IOM/MmioCommitsPgm",    STAMUNIT_OCCURENCES, "Number of ring-3 MMIO commits via PGM.");
     193    STAM_REL_REG(pVM, &pVM->iom.s.StatMmioStaleMappings,   STAMTYPE_PROFILE, "/IOM/MmioMappingsStale",              STAMUNIT_TICKS_PER_CALL, "Number of times iomMmioHandlerNew got a call for a remapped range at the old mapping.");
     194    STAM_REG(pVM, &pVM->iom.s.StatMmioDevLockContentionR0, STAMTYPE_COUNTER, "/IOM/MmioDevLockContentionR0",        STAMUNIT_OCCURENCES,     "Number of device lock contention force return to ring-3.");
    200195
    201196    LogFlow(("IOMR3Init: returns VINF_SUCCESS\n"));
  • trunk/src/VBox/VMM/VMMR3/IOMR3Mmio.cpp

    r82313 r82380  
    5252    /* Format the prefix: */
    5353    char                 szName[80];
    54     size_t               cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/NewMmio/%RGp-%RGp",
     54    size_t               cchPrefix = RTStrPrintf(szName, sizeof(szName), "/IOM/MmioRegions/%RGp-%RGp",
    5555                                                 pRegEntry->GCPhysMapping, pRegEntry->GCPhysMapping + pRegEntry->cbRegion - 1);
    5656
     
    106106{
    107107    char szPrefix[80];
    108     RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/NewMmio/%RGp-%RGp", GCPhys, GCPhys + pRegEntry->cbRegion - 1);
     108    RTStrPrintf(szPrefix, sizeof(szPrefix), "/IOM/MmioRegions/%RGp-%RGp", GCPhys, GCPhys + pRegEntry->cbRegion - 1);
    109109    STAMR3DeregisterByPrefix(pVM->pUVM, szPrefix);
    110110}
  • trunk/src/VBox/VMM/include/IOMInternal.h

    r82378 r82380  
    456456    STAMCOUNTER                     StatIoPortInS;
    457457    STAMCOUNTER                     StatIoPortOutS;
     458    STAMCOUNTER                     StatIoPortCommits;
    458459    /** @} */
    459460
    460461    /** @name MMIO statistics.
    461462     * @{ */
    462     STAMCOUNTER                     StatIoPortCommits;
    463 
    464     STAMCOUNTER                     StatMMIOStaleMappings;
    465     STAMPROFILE                     StatRZMMIOHandler;
    466     STAMCOUNTER                     StatRZMMIOReadsToR3;
    467     STAMCOUNTER                     StatRZMMIOWritesToR3;
    468     STAMCOUNTER                     StatRZMMIOCommitsToR3;
    469     STAMCOUNTER                     StatRZMMIODevLockContention;
    470 
    471     STAMCOUNTER                     StatMmioPfHandlerNew;
    472     STAMCOUNTER                     StatMmioPhysHandlerNew;
    473     STAMCOUNTER                     StatMmioHandlerNewR3;
    474     STAMCOUNTER                     StatMmioHandlerNewR0;
     463    STAMPROFILE                     StatMmioPfHandler;
     464    STAMPROFILE                     StatMmioPhysHandler;
     465    STAMCOUNTER                     StatMmioHandlerR3;
     466    STAMCOUNTER                     StatMmioHandlerR0;
     467    STAMCOUNTER                     StatMmioReadsR0ToR3;
     468    STAMCOUNTER                     StatMmioWritesR0ToR3;
     469    STAMCOUNTER                     StatMmioCommitsR0ToR3;
    475470    STAMCOUNTER                     StatMmioCommitsDirect;
    476471    STAMCOUNTER                     StatMmioCommitsPgm;
    477 
    478     STAMCOUNTER                     StatR3MMIOHandler;
    479 
    480     STAMCOUNTER                     StatMmioHandlerR3;
    481     STAMCOUNTER                     StatMmioHandlerR0;
    482 
    483     RTUINT                          cMovsMaxBytes;
    484     RTUINT                          cStosMaxBytes;
     472    STAMCOUNTER                     StatMmioStaleMappings;
     473    STAMCOUNTER                     StatMmioDevLockContentionR0;
    485474    /** @} */
    486475} IOM;
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