Changeset 88088 in vbox
- Timestamp:
- Mar 11, 2021 1:05:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/TM.cpp
r88076 r88088 3566 3566 /* Calc & update deltas */ 3567 3567 uint64_t cNsTotalDelta = cNsTotal - pState->cNsPrevTotal; 3568 uint64_t cNsExecutingDelta = cNsExecuting - pState->cNsPrevExecuting; 3569 uint64_t cNsHaltedDelta = cNsHalted - pState->cNsPrevHalted; 3570 3571 if (cNsExecutingDelta + cNsHaltedDelta <= cNsTotalDelta) 3572 { /* likely */ } 3573 else 3574 { 3575 /* Just adjust the executing and halted values down to match the total delta. */ 3576 uint64_t const cNsExecAndHalted = cNsExecutingDelta + cNsHaltedDelta; 3577 uint64_t const cNsAdjust = cNsExecAndHalted - cNsTotalDelta + cNsTotalDelta / 64; 3578 cNsExecutingDelta -= (cNsAdjust * cNsExecutingDelta + cNsExecAndHalted - 1) / cNsExecAndHalted; 3579 cNsHaltedDelta -= (cNsAdjust * cNsHaltedDelta + cNsExecAndHalted - 1) / cNsExecAndHalted; 3580 Assert(cNsExecutingDelta + cNsHaltedDelta <= cNsTotalDelta); 3581 } 3582 3583 pState->cNsPrevExecuting = cNsExecuting; 3584 pState->cNsPrevHalted = cNsHalted; 3568 3585 pState->cNsPrevTotal = cNsTotal; 3569 3570 uint64_t cNsExecutingDelta = cNsExecuting - pState->cNsPrevExecuting;3571 pState->cNsPrevExecuting = cNsExecuting;3572 3573 uint64_t cNsHaltedDelta = cNsHalted - pState->cNsPrevHalted;3574 pState->cNsPrevHalted = cNsHalted;3575 3586 3576 3587 /* Calc pcts. */
Note:
See TracChangeset
for help on using the changeset viewer.