VirtualBox

Ignore:
Timestamp:
Apr 23, 2021 12:42:47 PM (4 years ago)
Author:
vboxsync
Message:

Audio/SB16: Added a tiny bit of profiling.

File:
1 edited

Legend:

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

    r88653 r88673  
    276276    uint8_t mixer_nreg;
    277277    uint8_t mixer_regs[256];
     278
     279#ifdef VBOX_WITH_STATISTICS
     280    STAMPROFILE             StatTimerIO;
     281    STAMCOUNTER             StatBytesRead;
     282#endif
    278283} SB16STATE;
    279284
     
    16431648    }
    16441649
     1650    STAM_REL_COUNTER_ADD(&pThis->StatBytesRead, copy);
     1651
    16451652    uint32_t cbWritten;
    16461653    int rc = sb16WriteAudio(pThis, pStream, uChannel, off, cb, copy, &cbWritten);
     
    17121719static DECLCALLBACK(void) sb16TimerIO(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, void *pvUser)
    17131720{
     1721    RT_NOREF(pvUser);
     1722
    17141723    PSB16STATE pThis = PDMDEVINS_2_DATA(pDevIns, PSB16STATE);
    1715     Assert(hTimer == pThis->hTimerIO); RT_NOREF(pvUser);
     1724    STAM_PROFILE_START(&pThis->StatTimerIO, a);
     1725    Assert(hTimer == pThis->hTimerIO);
    17161726
    17171727    uint64_t cTicksNow     = PDMDevHlpTimerGet(pDevIns, hTimer);
     
    17431753        PDMDevHlpTimerSet(pDevIns, hTimer, cTicksNow + cTicks);
    17441754    }
     1755
     1756    STAM_PROFILE_STOP(&pThis->StatTimerIO, a);
    17451757}
    17461758
     
    28872899    }
    28882900#endif
     2901
     2902    /*
     2903     * Register statistics.
     2904     */
     2905# ifdef VBOX_WITH_STATISTICS
     2906    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimerIO,   STAMTYPE_PROFILE, "Timer",     STAMUNIT_TICKS_PER_CALL, "Profiling sb16TimerIO.");
     2907    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatBytesRead, STAMTYPE_COUNTER, "BytesRead", STAMUNIT_BYTES,          "Bytes read from SB16 emulation.");
     2908# endif
    28892909
    28902910    return VINF_SUCCESS;
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