VirtualBox

Changeset 65027 in vbox for trunk


Ignore:
Timestamp:
Dec 29, 2016 11:49:54 AM (8 years ago)
Author:
vboxsync
Message:

Audio: Some more statistics, renaming.

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r65015 r65027  
    935935
    936936#ifdef VBOX_WITH_STATISTICS
    937             STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesMixed,        csMixed);
    938             STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesLost,         csWritten - csMixed);
     937            STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesMixedOut,     csMixed);
     938            Assert(csWritten >= csMixed);
     939            STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesLostOut,      csWritten - csMixed);
    939940            STAM_COUNTER_ADD(&pThis->Stats.TotalBytesWritten,        cbWritten);
    940941            STAM_COUNTER_ADD(&pGstStream->Out.StatBytesTotalWritten, cbWritten);
     
    10801081    do
    10811082    {
    1082         uint32_t cSamplesMixed = 0;
     1083        uint32_t csMixed = 0;
    10831084
    10841085        rc = pThis->pHostDrvAudio->pfnStreamIterate(pThis->pHostDrvAudio, pHstStream);
     
    10891090        {
    10901091            /* Has the host captured any samples which were not mixed to the guest side yet? */
    1091             uint32_t cSamplesCaptured = AudioMixBufUsed(&pHstStream->MixBuf);
    1092             if (cSamplesCaptured)
     1092            uint32_t csCaptured = AudioMixBufUsed(&pHstStream->MixBuf);
     1093            if (csCaptured)
    10931094            {
    10941095                /* When capturing samples, the guest is the parent while the host is the child.
    10951096                 * So try mixing not yet mixed host-side samples to the guest-side buffer. */
    1096                 rc = AudioMixBufMixToParent(&pHstStream->MixBuf, cSamplesCaptured, &cSamplesMixed);
     1097                rc = AudioMixBufMixToParent(&pHstStream->MixBuf, csCaptured, &csMixed);
    10971098                if (RT_FAILURE(rc))
    10981099                {
     
    11061107                }
    11071108
    1108                 Log3Func(("[%s] %RU32/%RU32 input samples mixed, rc=%Rrc\n", pHstStream->szName, cSamplesMixed, cSamplesCaptured, rc));
     1109#ifdef VBOX_WITH_STATISTICS
     1110                STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesMixedIn, csMixed);
     1111                Assert(csCaptured >= csMixed);
     1112                STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesLostIn,  csCaptured - csMixed);
     1113#endif
     1114                Log3Func(("[%s] %RU32/%RU32 input samples mixed, rc=%Rrc\n", pHstStream->szName, csMixed, csCaptured, rc));
    11091115            }
    11101116            else
     
    12491255            {
    12501256#ifdef VBOX_WITH_STATISTICS
    1251                 STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesPlayed, csPlayed);
     1257                STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesOut, csPlayed);
    12521258                STAM_PROFILE_ADV_STOP(&pThis->Stats.DelayOut, out);
    12531259                STAM_COUNTER_ADD(&pHstStream->Out.StatSamplesPlayed, csPlayed);
     
    13151321               pStream->szName, pStream->enmDir));
    13161322
    1317     uint32_t cSamplesCaptured = 0;
     1323    uint32_t csCaptured = 0;
    13181324
    13191325    do
     
    13361342        PDMAUDIOSTRMSTS stsBackend = pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pHstStream);
    13371343
    1338         uint32_t cSamplesLive = AudioMixBufLive(&pGstStream->MixBuf);
    1339         if (!cSamplesLive)
     1344        uint32_t csLive = AudioMixBufLive(&pGstStream->MixBuf);
     1345        if (!csLive)
    13401346        {
    13411347            if (   (stsBackend & PDMAUDIOSTRMSTS_FLAG_ENABLED)
     
    13431349            {
    13441350                rc = pThis->pHostDrvAudio->pfnStreamCapture(pThis->pHostDrvAudio, pHstStream, NULL /* pvBuf */, 0 /* cbBuf */,
    1345                                                             &cSamplesCaptured);
     1351                                                            &csCaptured);
    13461352                if (RT_FAILURE(rc))
    13471353                {
     
    13521358                {
    13531359#ifdef VBOX_WITH_STATISTICS
    1354                     STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesCaptured,  cSamplesCaptured);
    1355                     STAM_COUNTER_ADD(&pHstStream->In.StatSamplesCaptured, cSamplesCaptured);
    1356 #endif
    1357                     Log3Func(("[%s] %RU32 samples captured\n", pHstStream->szName, cSamplesCaptured));
     1360                    STAM_COUNTER_ADD(&pThis->Stats.TotalSamplesIn,  csCaptured);
     1361                    STAM_COUNTER_ADD(&pHstStream->In.StatSamplesCaptured, csCaptured);
     1362#endif
     1363                    Log3Func(("[%s] %RU32 samples captured\n", pHstStream->szName, csCaptured));
    13581364                }
    13591365            }
     
    13681374        }
    13691375        else
    1370             Log3Func(("[%s] Skipping (still has %RU32 live samples)\n", pHstStream->szName, cSamplesLive));
     1376            Log3Func(("[%s] Skipping (still has %RU32 live samples)\n", pHstStream->szName, csLive));
    13711377
    13721378    } while (0);
     
    13751381    {
    13761382        if (pcSamplesCaptured)
    1377             *pcSamplesCaptured = cSamplesCaptured;
     1383            *pcSamplesCaptured = csCaptured;
    13781384    }
    13791385    else
     
    26622668        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesWritten,  "TotalSamplesWritten",
    26632669                                  STAMUNIT_COUNT, "Total samples written by device emulation ");
    2664         PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesMixed,    "TotalSamplesMixed",
    2665                                   STAMUNIT_COUNT, "Total samples mixed.");
    2666         PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesLost,     "TotalSamplesLost",
    2667                                   STAMUNIT_COUNT, "Total samples lost.");
    2668         PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesPlayed,   "TotalSamplesPlayed",
     2670        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesMixedIn,  "TotalSamplesMixedIn",
     2671                                  STAMUNIT_COUNT, "Total input samples mixed.");
     2672        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesMixedOut, "TotalSamplesMixedOut",
     2673                                  STAMUNIT_COUNT, "Total output samples mixed.");
     2674        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesLostIn,   "TotalSamplesLostIn",
     2675                                  STAMUNIT_COUNT, "Total input samples lost.");
     2676        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesLostOut,  "TotalSamplesLostOut",
     2677                                  STAMUNIT_COUNT, "Total output samples lost.");
     2678        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesOut,   "TotalSamplesPlayed",
    26692679                                  STAMUNIT_COUNT, "Total samples played by backend.");
    2670         PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesCaptured, "TotalSamplesCaptured",
     2680        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalSamplesIn, "TotalSamplesCaptured",
    26712681                                  STAMUNIT_COUNT, "Total samples captured by backend.");
    26722682        PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalBytesRead,       "TotalBytesRead",
     
    27662776    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesRead);
    27672777    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesWritten);
    2768     PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesMixed);
    2769     PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesLost);
    2770     PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesPlayed);
    2771     PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesCaptured);
     2778    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesMixedIn);
     2779    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesMixedOut);
     2780    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesLostIn);
     2781    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesLostOut);
     2782    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesOut);
     2783    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalSamplesIn);
    27722784    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalBytesRead);
    27732785    PDMDrvHlpSTAMDeregister(pThis->pDrvIns, &pThis->Stats.TotalBytesWritten);
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r65012 r65027  
    8484    STAMCOUNTER TotalSamplesRead;
    8585    STAMCOUNTER TotalSamplesWritten;
    86     STAMCOUNTER TotalSamplesMixed;
    87     STAMCOUNTER TotalSamplesLost;
    88     STAMCOUNTER TotalSamplesPlayed;
    89     STAMCOUNTER TotalSamplesCaptured;
     86    STAMCOUNTER TotalSamplesMixedIn;
     87    STAMCOUNTER TotalSamplesMixedOut;
     88    STAMCOUNTER TotalSamplesLostIn;
     89    STAMCOUNTER TotalSamplesLostOut;
     90    STAMCOUNTER TotalSamplesOut;
     91    STAMCOUNTER TotalSamplesIn;
    9092    STAMCOUNTER TotalBytesRead;
    9193    STAMCOUNTER TotalBytesWritten;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette