Changeset 90972 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 27, 2021 11:00:48 PM (3 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r90971 r90972 3223 3223 * We always switch buffer if we have more than one. 3224 3224 */ 3225 #if VMMLOGGER_BUFFER_COUNT == 1 3226 fFlushedBuffer = true; 3227 #else 3225 3228 AssertCompile(VMMLOGGER_BUFFER_COUNT >= 1); 3226 fFlushedBuffer = VMMLOGGER_BUFFER_COUNT == 1; 3229 pShared->idxBuf = (idxBuffer + 1) % VMMLOGGER_BUFFER_COUNT; 3230 fFlushedBuffer = false; 3231 #endif 3227 3232 } 3228 3233 else -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r90958 r90972 476 476 STAMR3RegisterF(pVM, &pShared->StatFlushes, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Reg", i); 477 477 STAMR3RegisterF(pVM, &pShared->StatCannotBlock, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Reg/CannotBlock", i); 478 STAMR3RegisterF(pVM, &pShared->StatRaces, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Reg/Races", i); 479 STAMR3RegisterF(pVM, &pShared->StatRacesReal, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Reg/RacesReal", i); 478 480 STAMR3RegisterF(pVM, &pShared->StatWait, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "", "/VMM/LogFlush/CPU%u/Reg/Wait", i); 479 481 STAMR3RegisterF(pVM, &pShared->cbDropped, STAMTYPE_U32, STAMVISIBILITY_USED, STAMUNIT_BYTES, "", "/VMM/LogFlush/CPU%u/Reg/cbDropped", i); … … 484 486 STAMR3RegisterF(pVM, &pShared->StatFlushes, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Rel", i); 485 487 STAMR3RegisterF(pVM, &pShared->StatCannotBlock, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Rel/CannotBlock", i); 488 STAMR3RegisterF(pVM, &pShared->StatRaces, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Rel/Races", i); 489 STAMR3RegisterF(pVM, &pShared->StatRacesReal, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "", "/VMM/LogFlush/CPU%u/Rel/RacesReal", i); 486 490 STAMR3RegisterF(pVM, &pShared->StatWait, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "", "/VMM/LogFlush/CPU%u/Rel/Wait", i); 487 491 STAMR3RegisterF(pVM, &pShared->cbDropped, STAMTYPE_U32, STAMVISIBILITY_USED, STAMUNIT_BYTES, "", "/VMM/LogFlush/CPU%u/Rel/cbDropped", i); … … 942 946 { 943 947 #if VMMLOGGER_BUFFER_COUNT > 1 944 /* Yield if other log buffers are being flushed already, so we try 945 avoid totally mixing things up... */ 948 /* 949 * To avoid totally mixing up the output, make some effort at delaying if 950 * there are buffers still being worked on by the flusher thread. 951 */ 946 952 if (pShared->cFlushing > 0) 947 RTThreadYield(); 953 { 954 STAM_REL_COUNTER_INC(&pShared->StatRaces); 955 for (uint32_t iTry = 0; iTry < 32 && pShared->cFlushing != 0; iTry++) 956 { 957 RTLogBulkWrite(pDstLogger, "", 0); /* A no-op, but it takes the lock and the hope is */ 958 if (pShared->cFlushing != 0) /* that we end up waiting on the flusher finish up. */ 959 RTThreadYield(); 960 } 961 if (pShared->cFlushing != 0) 962 { 963 RTLogLoggerEx(pDstLogger, RTLOGGRPFLAGS_LEVEL_1, UINT32_MAX, "*MAYBE WRONG ORDER*\n"); 964 if (pShared->cFlushing != 0) 965 STAM_REL_COUNTER_INC(&pShared->StatRacesReal); 966 } 967 } 948 968 #endif 949 969 RTLogBulkWrite(pDstLogger, pShared->aBufs[idxBuf].pchBufR3, pShared->aBufs[idxBuf].AuxDesc.offBuf); -
trunk/src/VBox/VMM/include/VMMInternal.h
r90970 r90972 123 123 STAMCOUNTER StatFlushes; 124 124 STAMCOUNTER StatCannotBlock; 125 STAMCOUNTER StatRaces; 126 STAMCOUNTER StatRacesReal; 125 127 STAMPROFILE StatWait; 126 128 } VMMR3CPULOGGER;
Note:
See TracChangeset
for help on using the changeset viewer.