VirtualBox

Changeset 7058 in vbox


Ignore:
Timestamp:
Feb 20, 2008 6:29:10 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28294
Message:

Added (disabled) instrumentation for measuring the time DMA writes to virtual disks take.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r7043 r7058  
    7373/** The maximum number of release log entries per device. */
    7474#define MAX_LOG_REL_ERRORS  1024
     75
     76/** Temporary instrumentation for tracking down potential virtual disk
     77 * write performance issues. */
     78#undef VBOX_INSTRUMENT_DMA_WRITES
    7579
    7680typedef struct ATADevState {
     
    186190    /* Release statistics: number of ATAPI PIO commands. */
    187191    STAMCOUNTER StatATAPIPIO;
     192#ifdef VBOX_INSTRUMENT_DMA_WRITES
     193    /* Release statistics: number of DMA sector writes and the time spent. */
     194    STAMPROFILEADV StatInstrVDWrites;
     195#endif
    188196
    189197    /** Statistics: number of read operations and the time spent reading. */
     
    13501358    STAM_PROFILE_ADV_START(&s->StatWrites, w);
    13511359    s->Led.Asserted.s.fWriting = s->Led.Actual.s.fWriting = 1;
     1360#ifdef VBOX_INSTRUMENT_DMA_WRITES
     1361    if (s->fDMA)
     1362        STAM_PROFILE_ADV_START(&s->StatInstrVDWrites, vw);;
     1363#endif
    13521364    rc = s->pDrvBlock->pfnWrite(s->pDrvBlock, u64Sector * 512, pvBuf, cSectors * 512);
     1365#ifdef VBOX_INSTRUMENT_DMA_WRITES
     1366    if (s->fDMA)
     1367        STAM_PROFILE_ADV_STOP(&s->StatInstrVDWrites, vw);;
     1368#endif
    13531369    s->Led.Actual.s.fWriting = 0;
    13541370    STAM_PROFILE_ADV_STOP(&s->StatWrites, w);
     
    60046020#endif
    60056021            PDMDevHlpSTAMRegisterF(pDevIns, &pIf->StatBytesRead,    STAMTYPE_COUNTER,     STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,           "Amount of data read.",              "/Devices/ATA%d/Unit%d/ReadBytes", i, j);
     6022#ifdef VBOX_INSTRUMENT_DMA_WRITES
     6023            PDMDevHlpSTAMRegisterF(pDevIns, &pIf->StatInstrVDWrites,       STAMTYPE_PROFILE_ADV, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL,  "Profiling of the VD DMA write operations.","/Devices/ATA%d/Unit%d/InstrVDWrites", i, j);
     6024#endif
    60066025#ifdef VBOX_WITH_STATISTICS
    60076026            PDMDevHlpSTAMRegisterF(pDevIns, &pIf->StatWrites,       STAMTYPE_PROFILE_ADV, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL,  "Profiling of the write operations.","/Devices/ATA%d/Unit%d/Writes", i, j);
Note: See TracChangeset for help on using the changeset viewer.

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