Changeset 90266 in vbox for trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
- Timestamp:
- Jul 20, 2021 8:38:59 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
r90265 r90266 355 355 LogFunc(("Heap budget overrun: sizeof(*pCmdCached)=%#zx aHgcmAcc[%zu].cbHeapBudget=%#RX64 - enmCmdType=%d\n", 356 356 sizeof(*pCmdCached), idxHeapAcc, pThisCC->aHgcmAcc[idxHeapAcc].cbHeapBudget, enmCmdType)); 357 STAM_REL_COUNTER_INC(&pThisCC->aHgcmAcc[idxHeapAcc].StatBudgetOverruns); 357 358 return NULL; 358 359 } … … 397 398 return pCmd; 398 399 } 400 STAM_REL_COUNTER_INC(&pThisCC->aHgcmAcc[idxHeapAcc].StatBudgetOverruns); 399 401 LogFunc(("Heap budget overrun: cbCmd=%#x aHgcmAcc[%zu].cbHeapBudget=%#RX64 - enmCmdType=%d\n", 400 402 cbCmd, idxHeapAcc, pThisCC->aHgcmAcc[idxHeapAcc].cbHeapBudget, enmCmdType)); … … 516 518 uintptr_t idx = pCmd->idxHeapAcc; 517 519 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); 520 521 521 522 /* Automatically enable HGCM events, if there are HGCM commands. */ … … 940 941 static void *vmmdevR3HgcmCallMemAllocEx(PVMMDEVCC pThisCC, PVBOXHGCMCMD pCmd, size_t cbRequested, bool fZero) 941 942 { 943 uintptr_t idx = pCmd->idxHeapAcc; 944 AssertStmt(idx < RT_ELEMENTS(pThisCC->aHgcmAcc), idx %= RT_ELEMENTS(pThisCC->aHgcmAcc)); 945 942 946 /* Check against max heap costs for this request. */ 943 947 Assert(pCmd->cbHeapCost <= VMMDEV_MAX_HGCM_DATA_SIZE); … … 945 949 { 946 950 /* 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));949 951 if (cbRequested <= pThisCC->aHgcmAcc[idx].cbHeapBudget) 950 952 { … … 968 970 LogFunc(("Request too big: cbRequested=%#zx cbHeapCost=%#x - enmCmdType=%d\n", 969 971 cbRequested, pCmd->cbHeapCost, pCmd->enmCmdType)); 972 STAM_REL_COUNTER_INC(&pThisCC->aHgcmAcc[idx].StatBudgetOverruns); 970 973 return NULL; 971 974 }
Note:
See TracChangeset
for help on using the changeset viewer.