VirtualBox

Changeset 90958 in vbox


Ignore:
Timestamp:
Aug 27, 2021 1:55:41 PM (3 years ago)
Author:
vboxsync
Message:

VMM: Log flushing stats. bugref:10086

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

Legend:

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

    r90956 r90958  
    31643164                                                                                            VMMLOGGER_BUFFER_COUNT);
    31653165
     3166                                            STAM_REL_COUNTER_INC(&pShared->StatFlushes);
     3167                                            STAM_REL_COUNTER_INC(&pGVM->vmm.s.StatLogFlusherFlushes);
     3168
    31663169                                            if (pGVM->vmmr0.s.LogFlusher.fThreadWaiting)
    31673170                                            {
     
    31703173                                            }
    31713174                                            else
     3175                                            {
     3176                                                STAM_REL_COUNTER_INC(&pGVM->vmm.s.StatLogFlusherNoWakeUp);
    31723177                                                RTSpinlockRelease(pGVM->vmmr0.s.LogFlusher.hSpinlock);
     3178                                            }
    31733179
    31743180                                            /*
    31753181                                             * Wait for it to complete.
    31763182                                             */
     3183                                            STAM_REL_PROFILE_START(&pShared->StatWait, a);
    31773184                                            VMMR0EmtWaitEventInner(pGVCpu, VMMR0EMTWAIT_F_TRY_SUPPRESS_INTERRUPTED,
    31783185                                                                   pR0Log->hEventFlushWait, RT_INDEFINITE_WAIT);
     3186                                            STAM_REL_PROFILE_STOP(&pShared->StatWait, a);
    31793187                                        }
    31803188                                        else
     
    31933201                                }
    31943202                                else
     3203                                {
     3204                                    STAM_REL_COUNTER_INC(&pShared->StatCannotBlock);
    31953205                                    SUP_DPRINTF(("vmmR0LoggerFlush: VMMR0EmtPrepareToBlock failed! rc=%d\n", rc));
     3206                                }
    31963207                                pR0Log->fFlushing = false;
    31973208                            }
     
    32013212                        else
    32023213                        {
     3214                            STAM_REL_COUNTER_INC(&pShared->StatCannotBlock);
    32033215#if defined(RT_OS_LINUX)
    32043216                            SUP_DPRINTF(("vmmR0LoggerFlush: EMT blocking disabled! (%u bytes)\n", pBufDesc->offBuf));
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r90956 r90958  
    438438    STAM_REG(pVM, &pVM->vmm.s.StatRZCallVMSetRuntimeError,  STAMTYPE_COUNTER, "/VMM/RZCallR3/VMRuntimeError",   STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_VM_SET_RUNTIME_ERROR calls.");
    439439
     440    STAMR3Register(pVM, &pVM->vmm.s.StatLogFlusherFlushes,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, "/VMM/LogFlush/00-Flushes",  STAMUNIT_OCCURENCES, "Total number of buffer flushes");
     441    STAMR3Register(pVM, &pVM->vmm.s.StatLogFlusherNoWakeUp, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, "/VMM/LogFlush/00-NoWakups", STAMUNIT_OCCURENCES, "Times the flusher thread didn't need waking up.");
     442
    440443#ifdef VBOX_WITH_STATISTICS
    441444    for (VMCPUID i = 0; i < pVM->cCpus; i++)
     
    469472
    470473        STAMR3RegisterF(pVM, &pVCpu->cEmtHashCollisions,             STAMTYPE_U8,      STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,  "", "/VMM/EmtHashCollisions/Emt%02u", i);
     474
     475        PVMMR3CPULOGGER pShared = &pVCpu->vmm.s.u.s.Logger;
     476        STAMR3RegisterF(pVM, &pShared->StatFlushes,     STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,     "", "/VMM/LogFlush/CPU%u/Reg", i);
     477        STAMR3RegisterF(pVM, &pShared->StatCannotBlock, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,     "", "/VMM/LogFlush/CPU%u/Reg/CannotBlock", i);
     478        STAMR3RegisterF(pVM, &pShared->StatWait,        STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "", "/VMM/LogFlush/CPU%u/Reg/Wait", i);
     479        STAMR3RegisterF(pVM, &pShared->cbDropped,       STAMTYPE_U32,     STAMVISIBILITY_USED, STAMUNIT_BYTES,          "", "/VMM/LogFlush/CPU%u/Reg/cbDropped", i);
     480        STAMR3RegisterF(pVM, &pShared->cbBuf,           STAMTYPE_U32,     STAMVISIBILITY_USED, STAMUNIT_BYTES,          "", "/VMM/LogFlush/CPU%u/Reg/cbBuf", i);
     481        STAMR3RegisterF(pVM, &pShared->idxBuf,          STAMTYPE_U32,     STAMVISIBILITY_USED, STAMUNIT_BYTES,          "", "/VMM/LogFlush/CPU%u/Reg/idxBuf", i);
     482
     483        pShared = &pVCpu->vmm.s.u.s.RelLogger;
     484        STAMR3RegisterF(pVM, &pShared->StatFlushes,     STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,     "", "/VMM/LogFlush/CPU%u/Rel", i);
     485        STAMR3RegisterF(pVM, &pShared->StatCannotBlock, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,     "", "/VMM/LogFlush/CPU%u/Rel/CannotBlock", i);
     486        STAMR3RegisterF(pVM, &pShared->StatWait,        STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "", "/VMM/LogFlush/CPU%u/Rel/Wait", i);
     487        STAMR3RegisterF(pVM, &pShared->cbDropped,       STAMTYPE_U32,     STAMVISIBILITY_USED, STAMUNIT_BYTES,          "", "/VMM/LogFlush/CPU%u/Rel/cbDropped", i);
     488        STAMR3RegisterF(pVM, &pShared->cbBuf,           STAMTYPE_U32,     STAMVISIBILITY_USED, STAMUNIT_BYTES,          "", "/VMM/LogFlush/CPU%u/Rel/cbBuf", i);
     489        STAMR3RegisterF(pVM, &pShared->idxBuf,          STAMTYPE_U32,     STAMVISIBILITY_USED, STAMUNIT_BYTES,          "", "/VMM/LogFlush/CPU%u/Rel/idxBuf", i);
    471490    }
    472491}
  • trunk/src/VBox/VMM/include/VMMInternal.h

    r90956 r90958  
    121121    /** Number of bytes dropped because the flush context didn't allow waiting.  */
    122122    uint32_t                cbDropped;
     123    STAMCOUNTER             StatFlushes;
     124    STAMCOUNTER             StatCannotBlock;
     125    STAMPROFILE             StatWait;
    123126} VMMR3CPULOGGER;
    124127/** Pointer to r0 logger data shared with ring-3. */
     
    347350    /** Copy of the current work log flusher work item. */
    348351    VMMLOGFLUSHERENTRY volatile LogFlusherItem;
     352    STAMCOUNTER                 StatLogFlusherFlushes;
     353    STAMCOUNTER                 StatLogFlusherNoWakeUp;
    349354    /** @} */
    350355
     
    633638        bool volatile           fThreadRunning;
    634639        bool                    afPadding2[5];
     640        STAMCOUNTER             StatFlushes;
     641        STAMCOUNTER             StatNoWakeUp;
    635642        /** Logger ring buffer.
    636643         * This is for communicating with the log flusher thread.  */
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