Changeset 82333 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Dec 3, 2019 1:03:18 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135157
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r81153 r82333 1250 1250 { 1251 1251 PVMCC pVM = pTimer->CTX_SUFF(pVM); 1252 STAM_COUNTER_INC(&pTimer->StatSetAbsolute); 1252 1253 1253 1254 /* Treat virtual sync timers specially. */ … … 1556 1557 { 1557 1558 PVMCC pVM = pTimer->CTX_SUFF(pVM); 1559 STAM_COUNTER_INC(&pTimer->StatSetRelative); 1558 1560 1559 1561 /* Treat virtual sync timers specially. */ … … 1878 1880 { 1879 1881 PVMCC pVM = pTimer->CTX_SUFF(pVM); 1882 STAM_COUNTER_INC(&pTimer->StatStop); 1880 1883 1881 1884 /* Treat virtual sync timers specially. */ … … 1985 1988 { 1986 1989 PVMCC pVM = pTimer->CTX_SUFF(pVM); 1990 STAM_COUNTER_INC(&pTimer->StatGet); 1987 1991 1988 1992 uint64_t u64; -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r81153 r82333 1486 1486 } 1487 1487 1488 #ifdef VBOX_WITH_STATISTICS 1489 /** Names the clock of the timer. */ 1490 static const char *tmR3TimerClockName(PTMTIMERR3 pTimer) 1491 { 1492 switch (pTimer->enmClock) 1493 { 1494 case TMCLOCK_VIRTUAL: return "virtual"; 1495 case TMCLOCK_VIRTUAL_SYNC: return "virtual-sync"; 1496 case TMCLOCK_REAL: return "real"; 1497 case TMCLOCK_TSC: return "tsc"; 1498 case TMCLOCK_MAX: break; 1499 } 1500 return "corrupt clock value"; 1501 } 1502 #endif 1503 1488 1504 1489 1505 /** … … 1546 1562 #endif 1547 1563 TM_UNLOCK_TIMERS(pVM); 1564 1565 /* 1566 * Register statistics. 1567 */ 1568 #ifdef VBOX_WITH_STATISTICS 1569 1570 STAMR3RegisterF(pVM, &pTimer->StatTimer, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, 1571 tmR3TimerClockName(pTimer), "/TM/Timers/%s", pszDesc); 1572 STAMR3RegisterF(pVM, &pTimer->StatCritSectEnter, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, 1573 "", "/TM/Timers/%s/CritSectEnter", pszDesc); 1574 STAMR3RegisterF(pVM, &pTimer->StatGet, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, 1575 "", "/TM/Timers/%s/Get", pszDesc); 1576 STAMR3RegisterF(pVM, &pTimer->StatSetAbsolute, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, 1577 "", "/TM/Timers/%s/SetAbsolute", pszDesc); 1578 STAMR3RegisterF(pVM, &pTimer->StatSetRelative, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, 1579 "", "/TM/Timers/%s/SetRelative", pszDesc); 1580 STAMR3RegisterF(pVM, &pTimer->StatStop, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, 1581 "", "/TM/Timers/%s/Stop", pszDesc); 1582 #endif 1548 1583 1549 1584 *ppTimer = pTimer; … … 1872 1907 1873 1908 /* 1874 * Read to move the timer from the created list and onto the free list. 1909 * Deregister statistics. 1910 */ 1911 #ifdef VBOX_WITH_STATISTICS 1912 char szPrefix[128]; 1913 RTStrPrintf(szPrefix, sizeof(szPrefix), "/TM/Timers/%s", pTimer->pszDesc); 1914 STAMR3DeregisterByPrefix(pVM->pUVM, szPrefix); 1915 #endif 1916 1917 /* 1918 * Ready to move the timer from the created list and onto the free list. 1875 1919 */ 1876 1920 Assert(!pTimer->offNext); Assert(!pTimer->offPrev); Assert(!pTimer->offScheduleNext); … … 2229 2273 PPDMCRITSECT pCritSect = pTimer->pCritSect; 2230 2274 if (pCritSect) 2275 { 2276 STAM_PROFILE_START(&pTimer->StatCritSectEnter, Locking); 2231 2277 PDMCritSectEnter(pCritSect, VERR_IGNORED); 2278 STAM_PROFILE_STOP(&pTimer->StatCritSectEnter, Locking); 2279 } 2232 2280 Log2(("tmR3TimerQueueRun: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, u64Expire=%llx (now=%llx) .pszDesc=%s}\n", 2233 2281 pTimer, tmTimerState(pTimer->enmState), pTimer->enmClock, pTimer->enmType, pTimer->u64Expire, u64Now, pTimer->pszDesc)); … … 2254 2302 /* fire */ 2255 2303 TM_SET_STATE(pTimer, TMTIMERSTATE_EXPIRED_DELIVER); 2304 STAM_PROFILE_START(&pTimer->StatTimer, PrfTimer); 2256 2305 switch (pTimer->enmType) 2257 2306 { … … 2265 2314 break; 2266 2315 } 2316 STAM_PROFILE_STOP(&pTimer->StatTimer, PrfTimer); 2267 2317 2268 2318 /* change the state if it wasn't changed already in the handler. */ … … 2416 2466 PPDMCRITSECT pCritSect = pTimer->pCritSect; 2417 2467 if (pCritSect) 2468 { 2469 STAM_PROFILE_START(&pTimer->StatCritSectEnter, Locking); 2418 2470 PDMCritSectEnter(pCritSect, VERR_IGNORED); 2471 STAM_PROFILE_STOP(&pTimer->StatCritSectEnter, Locking); 2472 } 2419 2473 2420 2474 Log2(("tmR3TimerQueueRun: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, u64Expire=%llx (now=%llx) .pszDesc=%s}\n", … … 2433 2487 tmTimerQueueUnlinkActive(pQueue, pTimer); 2434 2488 TM_SET_STATE(pTimer, TMTIMERSTATE_EXPIRED_DELIVER); 2489 STAM_PROFILE_START(&pTimer->StatTimer, PrfTimer); 2435 2490 switch (pTimer->enmType) 2436 2491 { … … 2444 2499 break; 2445 2500 } 2501 STAM_PROFILE_STOP(&pTimer->StatTimer, PrfTimer); 2446 2502 2447 2503 /* Change the state if it wasn't changed already in the handler. -
trunk/src/VBox/VMM/include/TMInternal.h
r80281 r82333 205 205 #if HC_ARCH_BITS == 32 206 206 uint32_t padding0; /**< pad structure to multiple of 8 bytes. */ 207 #endif 208 #ifdef VBOX_WITH_STATISTICS 209 STAMPROFILE StatTimer; 210 STAMPROFILE StatCritSectEnter; 211 STAMCOUNTER StatGet; 212 STAMCOUNTER StatSetAbsolute; 213 STAMCOUNTER StatSetRelative; 214 STAMCOUNTER StatStop; 207 215 #endif 208 216 } TMTIMER;
Note:
See TracChangeset
for help on using the changeset viewer.