VirtualBox

Ignore:
Timestamp:
Jul 20, 2021 8:38:59 PM (3 years ago)
Author:
vboxsync
Message:

VMMDev: More heap usage statistics. bugref:9379

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp

    r90265 r90266  
    355355            LogFunc(("Heap budget overrun: sizeof(*pCmdCached)=%#zx aHgcmAcc[%zu].cbHeapBudget=%#RX64 - enmCmdType=%d\n",
    356356                     sizeof(*pCmdCached), idxHeapAcc, pThisCC->aHgcmAcc[idxHeapAcc].cbHeapBudget, enmCmdType));
     357        STAM_REL_COUNTER_INC(&pThisCC->aHgcmAcc[idxHeapAcc].StatBudgetOverruns);
    357358        return NULL;
    358359    }
     
    397398        return pCmd;
    398399    }
     400    STAM_REL_COUNTER_INC(&pThisCC->aHgcmAcc[idxHeapAcc].StatBudgetOverruns);
    399401    LogFunc(("Heap budget overrun: cbCmd=%#x aHgcmAcc[%zu].cbHeapBudget=%#RX64 - enmCmdType=%d\n",
    400402             cbCmd, idxHeapAcc, pThisCC->aHgcmAcc[idxHeapAcc].cbHeapBudget, enmCmdType));
     
    516518    uintptr_t idx = pCmd->idxHeapAcc;
    517519    AssertStmt(idx < RT_ELEMENTS(pThisCC->aHgcmAcc), idx %= RT_ELEMENTS(pThisCC->aHgcmAcc));
    518     STAM_REL_COUNTER_ADD(&pThisCC->aHgcmAcc[idx].cbHeapTotal, pCmd->cbHeapCost);
    519     STAM_REL_COUNTER_INC(&pThisCC->aHgcmAcc[idx].cTotalMessages);
     520    STAM_REL_PROFILE_ADD_PERIOD(&pThisCC->aHgcmAcc[idx].StateMsgHeapUsage, pCmd->cbHeapCost);
    520521
    521522    /* Automatically enable HGCM events, if there are HGCM commands. */
     
    940941static void *vmmdevR3HgcmCallMemAllocEx(PVMMDEVCC pThisCC, PVBOXHGCMCMD pCmd, size_t cbRequested, bool fZero)
    941942{
     943    uintptr_t idx = pCmd->idxHeapAcc;
     944    AssertStmt(idx < RT_ELEMENTS(pThisCC->aHgcmAcc), idx %= RT_ELEMENTS(pThisCC->aHgcmAcc));
     945
    942946    /* Check against max heap costs for this request. */
    943947    Assert(pCmd->cbHeapCost <= VMMDEV_MAX_HGCM_DATA_SIZE);
     
    945949    {
    946950        /* Check heap budget (we're under lock). */
    947         uintptr_t idx = pCmd->idxHeapAcc;
    948         AssertStmt(idx < RT_ELEMENTS(pThisCC->aHgcmAcc), idx %= RT_ELEMENTS(pThisCC->aHgcmAcc));
    949951        if (cbRequested <= pThisCC->aHgcmAcc[idx].cbHeapBudget)
    950952        {
     
    968970        LogFunc(("Request too big: cbRequested=%#zx cbHeapCost=%#x - enmCmdType=%d\n",
    969971                 cbRequested, pCmd->cbHeapCost, pCmd->enmCmdType));
     972    STAM_REL_COUNTER_INC(&pThisCC->aHgcmAcc[idx].StatBudgetOverruns);
    970973    return NULL;
    971974}
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