- Timestamp:
- Jan 9, 2019 10:02:07 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r76708 r76726 695 695 if (pCfgGuest->enmDir == PDMAUDIODIR_IN) 696 696 { 697 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/BytesElapsed", pStream->szName); 698 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->In.Stats.BytesElapsed, 699 szStatName, STAMUNIT_BYTES, "Elapsed bytes read."); 700 701 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/BytesRead", pStream->szName); 702 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->In.Stats.BytesTotalRead, 703 szStatName, STAMUNIT_BYTES, "Total bytes read."); 704 705 RTStrPrintf(szStatName, sizeof(szStatName), "Host/%s/FramesCaptured", pStream->szName); 706 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->In.Stats.FramesCaptured, 707 szStatName, STAMUNIT_COUNT, "Total frames captured."); 697 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalFramesCaptured", pStream->szName); 698 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->In.Stats.TotalFramesCaptured, 699 szStatName, STAMUNIT_COUNT, "Total frames played."); 700 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalTimesCaptured", pStream->szName); 701 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->In.Stats.TotalTimesCaptured, 702 szStatName, STAMUNIT_COUNT, "Total number of playbacks."); 703 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalFramesRead", pStream->szName); 704 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->In.Stats.TotalFramesRead, 705 szStatName, STAMUNIT_COUNT, "Total frames read."); 706 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalTimesRead", pStream->szName); 707 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->In.Stats.TotalTimesRead, 708 szStatName, STAMUNIT_COUNT, "Total number of reads."); 708 709 } 709 710 else if (pCfgGuest->enmDir == PDMAUDIODIR_OUT) 710 711 { 711 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/BytesElapsed", pStream->szName); 712 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->Out.Stats.BytesElapsed, 713 szStatName, STAMUNIT_BYTES, "Elapsed bytes written."); 714 715 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/BytesWritten", pStream->szName); 716 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->Out.Stats.BytesTotalWritten, 717 szStatName, STAMUNIT_BYTES, "Total bytes written."); 718 719 RTStrPrintf(szStatName, sizeof(szStatName), "Host/%s/FramesPlayed", pStream->szName); 720 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->Out.Stats.FramesPlayed, 712 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalFramesPlayed", pStream->szName); 713 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->Out.Stats.TotalFramesPlayed, 721 714 szStatName, STAMUNIT_COUNT, "Total frames played."); 715 716 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalTimesPlayed", pStream->szName); 717 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->Out.Stats.TotalTimesPlayed, 718 szStatName, STAMUNIT_COUNT, "Total number of playbacks."); 719 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalFramesWritten", pStream->szName); 720 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->Out.Stats.TotalFramesWritten, 721 szStatName, STAMUNIT_COUNT, "Total frames written."); 722 723 RTStrPrintf(szStatName, sizeof(szStatName), "Guest/%s/TotalTimesWritten", pStream->szName); 724 PDMDrvHlpSTAMRegCounterEx(pThis->pDrvIns, &pStream->Out.Stats.TotalTimesWritten, 725 szStatName, STAMUNIT_COUNT, "Total number of writes."); 722 726 } 723 727 else … … 874 878 if (pStream->enmDir == PDMAUDIODIR_IN) 875 879 { 876 STAM_COUNTER_RESET(&pStream->In.Stats.BytesElapsed); 877 STAM_COUNTER_RESET(&pStream->In.Stats.BytesTotalRead); 878 STAM_COUNTER_RESET(&pStream->In.Stats.FramesCaptured); 880 STAM_COUNTER_RESET(&pStream->In.Stats.TotalFramesCaptured); 881 STAM_COUNTER_RESET(&pStream->In.Stats.TotalFramesRead); 882 STAM_COUNTER_RESET(&pStream->In.Stats.TotalTimesCaptured); 883 STAM_COUNTER_RESET(&pStream->In.Stats.TotalTimesRead); 879 884 } 880 885 else if (pStream->enmDir == PDMAUDIODIR_OUT) 881 886 { 882 STAM_COUNTER_RESET(&pStream->Out.Stats.BytesElapsed); 883 STAM_COUNTER_RESET(&pStream->Out.Stats.BytesTotalWritten); 884 STAM_COUNTER_RESET(&pStream->Out.Stats.FramesPlayed); 887 STAM_COUNTER_RESET(&pStream->Out.Stats.TotalFramesPlayed); 888 STAM_COUNTER_RESET(&pStream->Out.Stats.TotalFramesWritten); 889 STAM_COUNTER_RESET(&pStream->Out.Stats.TotalTimesPlayed); 890 STAM_COUNTER_RESET(&pStream->Out.Stats.TotalTimesWritten); 885 891 } 886 892 else … … 975 981 DrvAudioHlpFileWrite(pStream->Out.Dbg.pFileStreamWrite, pvBuf, cbToWrite, 0 /* fFlags */); 976 982 977 #ifdef VBOX_WITH_STATISTICS978 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesWritten, cfGstWritten);979 #endif980 983 uint32_t cfGstMixed = 0; 981 984 if (cfGstWritten) … … 996 999 997 1000 pStream->tsLastReadWrittenNs = RTTimeNanoTS(); 998 #ifdef DEBUG999 pStream->Out.Dbg.cfWrittenSinceLastPlay += AUDIOMIXBUF_F2F_RATIO(&pStream->Guest.MixBuf, cfGstMixed);1000 #endif1001 1001 /* Keep going. */ 1002 1002 } … … 1008 1008 1009 1009 #ifdef VBOX_WITH_STATISTICS 1010 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesMixedOut, cfGstMixed); 1010 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesWritten, cfGstWritten); 1011 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesMixedOut, cfGstMixed); 1011 1012 Assert(cfGstWritten >= cfGstMixed); 1012 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesLostOut, cfGstWritten - cfGstMixed); 1013 STAM_COUNTER_ADD(&pThis->Stats.TotalBytesWritten, cbWrittenTotal); 1014 STAM_COUNTER_ADD(&pStream->Out.Stats.BytesTotalWritten, cbWrittenTotal); 1013 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesLostOut, cfGstWritten - cfGstMixed); 1014 STAM_COUNTER_ADD(&pThis->Stats.TotalBytesWritten, cbWrittenTotal); 1015 1016 STAM_COUNTER_ADD(&pStream->Out.Stats.TotalFramesWritten, cfGstWritten); 1017 STAM_COUNTER_INC(&pStream->Out.Stats.TotalTimesWritten); 1015 1018 #endif 1016 1019 } … … 1547 1550 1548 1551 pStream->tsLastPlayedCapturedNs = RTTimeNanoTS(); 1549 #ifdef DEBUG1550 Log3Func(("[%s] Dbg: cfWrittenSinceLastPlay=%RU64 (%RU64ms)\n",1551 pStream->szName,1552 pStream->Out.Dbg.cfWrittenSinceLastPlay, DrvAudioHlpFramesToMilli(pStream->Out.Dbg.cfWrittenSinceLastPlay, &pStream->Host.Cfg.Props)));1553 pStream->Out.Dbg.cfWrittenSinceLastPlay = 0;1554 #endif1555 1552 } 1556 1553 … … 1576 1573 STAM_COUNTER_ADD (&pThis->Stats.TotalFramesOut, cfPlayedTotal); 1577 1574 STAM_PROFILE_ADV_STOP(&pThis->Stats.DelayOut, out); 1578 STAM_COUNTER_ADD (&pStream->Out.Stats.FramesPlayed, cfPlayedTotal); 1575 1576 STAM_COUNTER_ADD (&pStream->Out.Stats.TotalFramesPlayed, cfPlayedTotal); 1577 STAM_COUNTER_INC (&pStream->Out.Stats.TotalTimesPlayed); 1579 1578 #endif 1580 1579 } … … 1852 1851 1853 1852 #ifdef VBOX_WITH_STATISTICS 1854 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesIn, cfCaptured); 1855 STAM_COUNTER_ADD(&pStream->In.Stats.FramesCaptured, cfCaptured); 1853 STAM_COUNTER_ADD(&pThis->Stats.TotalFramesIn, cfCaptured); 1854 1855 STAM_COUNTER_ADD(&pStream->In.Stats.TotalFramesCaptured, cfCaptured); 1856 1856 #endif 1857 1857 } … … 2349 2349 const uint32_t cbRead = AUDIOMIXBUF_F2B(&pStream->Guest.MixBuf, cfRead); 2350 2350 2351 STAM_COUNTER_ADD(&pThis->Stats.TotalBytesRead, cbRead); 2352 STAM_COUNTER_ADD(&pStream->In.Stats.BytesTotalRead, cbRead); 2351 STAM_COUNTER_ADD(&pThis->Stats.TotalBytesRead, cbRead); 2352 2353 STAM_COUNTER_ADD(&pStream->In.Stats.TotalFramesRead, cfRead); 2354 STAM_COUNTER_INC(&pStream->In.Stats.TotalTimesRead); 2353 2355 #endif 2354 2356 Assert(cfToRead >= cfRead); … … 3186 3188 { 3187 3189 #ifdef VBOX_WITH_STATISTICS 3188 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->In.Stats.BytesElapsed); 3189 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->In.Stats.BytesTotalRead); 3190 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->In.Stats.FramesCaptured); 3190 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->In.Stats.TotalFramesCaptured); 3191 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->In.Stats.TotalTimesCaptured); 3192 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->In.Stats.TotalFramesRead); 3193 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->In.Stats.TotalTimesRead); 3191 3194 #endif 3192 3195 if (pThis->In.Cfg.Dbg.fEnabled) … … 3202 3205 { 3203 3206 #ifdef VBOX_WITH_STATISTICS 3204 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->Out.Stats.BytesElapsed); 3205 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->Out.Stats.BytesTotalWritten); 3206 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->Out.Stats.FramesPlayed); 3207 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->Out.Stats.TotalFramesPlayed); 3208 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->Out.Stats.TotalTimesPlayed); 3209 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->Out.Stats.TotalFramesWritten); 3210 PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pStream->Out.Stats.TotalTimesWritten); 3207 3211 #endif 3208 3212 if (pThis->Out.Cfg.Dbg.fEnabled)
Note:
See TracChangeset
for help on using the changeset viewer.