Changeset 88719 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Apr 26, 2021 10:07:45 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r88718 r88719 154 154 struct 155 155 { 156 STAMCOUNTER TotalFramesPlayed;157 STAMCOUNTER AvgFramesPlayed;158 STAMCOUNTER TotalTimesPlayed;159 STAMCOUNTER TotalFramesWritten;160 STAMCOUNTER AvgFramesWritten;161 STAMCOUNTER TotalTimesWritten;162 156 uint32_t cbBackendWritableBefore; 163 157 uint32_t cbBackendWritableAfter; … … 189 183 #define DRVAUDIOSTREAM_MAGIC_DEAD UINT32_C(0x17500728) 190 184 191 192 #ifdef VBOX_WITH_STATISTICS193 /**194 * Structure for keeping stream statistics for the195 * statistic manager (STAM).196 */197 typedef struct DRVAUDIOSTATS198 {199 STAMCOUNTER TotalStreamsActive;200 STAMCOUNTER TotalStreamsCreated;201 STAMCOUNTER TotalFramesRead;202 STAMCOUNTER TotalFramesWritten;203 STAMCOUNTER TotalFramesMixedIn;204 STAMCOUNTER TotalFramesMixedOut;205 STAMCOUNTER TotalFramesLostIn;206 STAMCOUNTER TotalFramesLostOut;207 STAMCOUNTER TotalFramesOut;208 STAMCOUNTER TotalFramesIn;209 STAMCOUNTER TotalBytesRead;210 STAMCOUNTER TotalBytesWritten;211 /** How much delay (in ms) for input processing. */212 STAMPROFILEADV DelayIn;213 /** How much delay (in ms) for output processing. */214 STAMPROFILEADV DelayOut;215 } DRVAUDIOSTATS, *PDRVAUDIOSTATS;216 #endif217 185 218 186 /** … … 317 285 318 286 #ifdef VBOX_WITH_STATISTICS 319 /** Statistics for the statistics manager (STAM). */ 320 DRVAUDIOSTATS Stats; 287 /** Statistics. */ 288 struct 289 { 290 STAMCOUNTER TotalStreamsActive; 291 STAMCOUNTER TotalStreamsCreated; 292 STAMCOUNTER TotalFramesRead; 293 STAMCOUNTER TotalFramesIn; 294 STAMCOUNTER TotalBytesRead; 295 } Stats; 321 296 #endif 322 297 } DRVAUDIO; … … 557 532 { 558 533 STAM_COUNTER_RESET(&pStreamEx->In.Stats.TotalFramesCaptured); 559 STAM_COUNTER_RESET(&pStreamEx->In.Stats.TotalFramesRead);560 534 STAM_COUNTER_RESET(&pStreamEx->In.Stats.TotalTimesCaptured); 561 535 STAM_COUNTER_RESET(&pStreamEx->In.Stats.TotalTimesRead); … … 563 537 else if (pStreamEx->Core.enmDir == PDMAUDIODIR_OUT) 564 538 { 565 STAM_COUNTER_RESET(&pStreamEx->Out.Stats.TotalFramesPlayed);566 STAM_COUNTER_RESET(&pStreamEx->Out.Stats.TotalFramesWritten);567 STAM_COUNTER_RESET(&pStreamEx->Out.Stats.TotalTimesPlayed);568 STAM_COUNTER_RESET(&pStreamEx->Out.Stats.TotalTimesWritten);569 539 } 570 540 else … … 1689 1659 PDMDrvHlpSTAMRegisterF(pDrvIns, &pStreamEx->In.Stats.TotalTimesCaptured, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_NONE, 1690 1660 "Total number of playbacks.", "%s/TotalTimesCaptured", pStreamEx->Core.szName); 1691 PDMDrvHlpSTAMRegisterF(pDrvIns, &pStreamEx->In.Stats.TotalFramesRead, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_NONE,1692 "Total frames read.", "%s/TotalFramesRead", pStreamEx->Core.szName);1693 1661 PDMDrvHlpSTAMRegisterF(pDrvIns, &pStreamEx->In.Stats.TotalTimesRead, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_NONE, 1694 1662 "Total number of reads.", "%s/TotalTimesRead", pStreamEx->Core.szName); … … 1697 1665 { 1698 1666 Assert(pCfgGuest->enmDir == PDMAUDIODIR_OUT); 1699 PDMDrvHlpSTAMRegisterF(pDrvIns, &pStreamEx->Out.Stats.TotalFramesPlayed, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_NONE,1700 "Total frames played.", "%s/TotalFramesPlayed", pStreamEx->Core.szName);1701 PDMDrvHlpSTAMRegisterF(pDrvIns, &pStreamEx->Out.Stats.TotalTimesPlayed, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_NONE,1702 "Total number of playbacks.", "%s/TotalTimesPlayed", pStreamEx->Core.szName);1703 PDMDrvHlpSTAMRegisterF(pDrvIns, &pStreamEx->Out.Stats.TotalFramesWritten, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_NONE,1704 "Total frames written.", "%s/TotalFramesWritten", pStreamEx->Core.szName);1705 PDMDrvHlpSTAMRegisterF(pDrvIns, &pStreamEx->Out.Stats.TotalTimesWritten, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_NONE,1706 "Total number of writes.", "%s/TotalTimesWritten", pStreamEx->Core.szName);1707 1667 } 1708 1668 #endif /* VBOX_WITH_STATISTICS */ … … 2455 2415 AssertMsg(PDMAudioPropsIsSizeAligned(&pStreamEx->Guest.Cfg.Props, cbBuf), 2456 2416 ("Stream '%s' got a non-frame-aligned write (%RU32 bytes)\n", pStreamEx->Core.szName, cbBuf)); 2457 2458 /// @todo STAM_PROFILE_ADV_START(&pThis->Stats.DelayOut, out); /* (stopped in drvAudioStreamPlayLocked) */2459 2417 2460 2418 int rc = RTCritSectEnter(&pThis->CritSect); … … 3404 3362 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalStreamsCreated); 3405 3363 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesRead); 3406 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesWritten);3407 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesMixedIn);3408 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesMixedOut);3409 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesLostIn);3410 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesLostOut);3411 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesOut);3412 3364 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalFramesIn); 3413 3365 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalBytesRead); 3414 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalBytesWritten);3415 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.DelayIn);3416 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.DelayOut);3417 3366 #endif 3418 3367 … … 3634 3583 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesRead, "TotalFramesRead", 3635 3584 STAMUNIT_COUNT, "Total frames read by device emulation."); 3636 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesWritten, "TotalFramesWritten",3637 STAMUNIT_COUNT, "Total frames written by device emulation ");3638 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesMixedIn, "TotalFramesMixedIn",3639 STAMUNIT_COUNT, "Total input frames mixed.");3640 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesMixedOut, "TotalFramesMixedOut",3641 STAMUNIT_COUNT, "Total output frames mixed.");3642 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesLostIn, "TotalFramesLostIn",3643 STAMUNIT_COUNT, "Total input frames lost.");3644 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesLostOut, "TotalFramesLostOut",3645 STAMUNIT_COUNT, "Total output frames lost.");3646 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesOut, "TotalFramesOut",3647 STAMUNIT_COUNT, "Total frames played by backend.");3648 3585 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalFramesIn, "TotalFramesIn", 3649 3586 STAMUNIT_COUNT, "Total frames captured by backend."); 3650 3587 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalBytesRead, "TotalBytesRead", 3651 3588 STAMUNIT_BYTES, "Total bytes read."); 3652 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalBytesWritten, "TotalBytesWritten",3653 STAMUNIT_BYTES, "Total bytes written.");3654 3655 PDMDrvHlpSTAMRegProfileAdvEx(pDrvIns, &pThis->Stats.DelayIn, "DelayIn",3656 STAMUNIT_NS_PER_CALL, "Profiling of input data processing.");3657 PDMDrvHlpSTAMRegProfileAdvEx(pDrvIns, &pThis->Stats.DelayOut, "DelayOut",3658 STAMUNIT_NS_PER_CALL, "Profiling of output data processing.");3659 3589 #endif 3660 3590
Note:
See TracChangeset
for help on using the changeset viewer.