VirtualBox

Changeset 72336 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 25, 2018 9:59:14 AM (7 years ago)
Author:
vboxsync
Message:

DrvDiskIntegrity: Add async flag to indicate whether a request used the sync or async path

File:
1 edited

Legend:

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

    r72312 r72336  
    220220static const RTTRACELOGEVTITEMDESC g_aEvtItemsReadWrite[] =
    221221{
    222     { "Offset", "Offset to start reading/writing from/to", RTTRACELOGTYPE_UINT64, 0 },
    223     { "Size",   "Number of bytes to transfer",             RTTRACELOGTYPE_SIZE,   0 }
     222    { "Async",  "Flag whether the request is asynchronous", RTTRACELOGTYPE_BOOL,   0 },
     223    { "Offset", "Offset to start reading/writing from/to",  RTTRACELOGTYPE_UINT64, 0 },
     224    { "Size",   "Number of bytes to transfer",              RTTRACELOGTYPE_SIZE,   0 }
     225};
     226
     227/**
     228 * Flush event items.
     229 */
     230static const RTTRACELOGEVTITEMDESC g_aEvtItemsFlush[] =
     231{
     232    { "Async",  "Flag whether the request is asynchronous", RTTRACELOGTYPE_BOOL,   0 }
    224233};
    225234
     
    240249/** Flush event descriptor. */
    241250static const RTTRACELOGEVTDESC g_EvtFlush =
    242     { "Flush", "Flush written data to disk", RTTRACELOGEVTSEVERITY_DEBUG, 0, NULL };
     251    { "Flush", "Flush written data to disk", RTTRACELOGEVTSEVERITY_DEBUG, RT_ELEMENTS(g_aEvtItemsFlush), &g_aEvtItemsFlush[0] };
    243252/** I/O request complete event descriptor. */
    244253static const RTTRACELOGEVTDESC g_EvtComplete =
     
    756765 * @param   pThis    The driver instance data.
    757766 * @param   uGrp     The group ID.
     767 * @param   fAsync   Flag whether this is an async request.
    758768 * @param   off      The offset to put into the event log.
    759769 * @param   cbRead   Amount of bytes to read.
    760770 */
    761 DECLINLINE(void) drvdiskintTraceLogFireEvtRead(PDRVDISKINTEGRITY pThis, uintptr_t uGrp, uint64_t off, size_t cbRead)
     771DECLINLINE(void) drvdiskintTraceLogFireEvtRead(PDRVDISKINTEGRITY pThis, uintptr_t uGrp, bool fAsync, uint64_t off, size_t cbRead)
    762772{
    763773    if (pThis->hIoLogger)
    764774    {
    765775        int rc = RTTraceLogWrEvtAddL(pThis->hIoLogger, &g_EvtRead, RTTRACELOG_WR_ADD_EVT_F_GRP_START,
    766                                      (RTTRACELOGEVTGRPID)uGrp, 0, off, cbRead);
     776                                     (RTTRACELOGEVTGRPID)uGrp, 0, fAsync, off, cbRead);
    767777        AssertRC(rc);
    768778    }
     
    776786 * @param   pThis    The driver instance data.
    777787 * @param   uGrp     The group ID.
     788 * @param   fAsync   Flag whether this is an async request.
    778789 * @param   off      The offset to put into the event log.
    779790 * @param   cbWrite  Amount of bytes to write.
    780791 */
    781 DECLINLINE(void) drvdiskintTraceLogFireEvtWrite(PDRVDISKINTEGRITY pThis, uintptr_t uGrp, uint64_t off, size_t cbWrite)
     792DECLINLINE(void) drvdiskintTraceLogFireEvtWrite(PDRVDISKINTEGRITY pThis, uintptr_t uGrp, bool fAsync, uint64_t off, size_t cbWrite)
    782793{
    783794    if (pThis->hIoLogger)
     
    796807 * @param   pThis    The driver instance data.
    797808 * @param   uGrp     The group ID.
    798  */
    799 DECLINLINE(void) drvdiskintTraceLogFireEvtFlush(PDRVDISKINTEGRITY pThis, uintptr_t uGrp)
     809 * @param   fAsync   Flag whether this is an async request.
     810 */
     811DECLINLINE(void) drvdiskintTraceLogFireEvtFlush(PDRVDISKINTEGRITY pThis, uintptr_t uGrp, bool fAsync)
    800812{
    801813    if (pThis->hIoLogger)
     
    848860    PDRVDISKINTEGRITY pThis = PDMIMEDIA_2_DRVDISKINTEGRITY(pInterface);
    849861
    850     drvdiskintTraceLogFireEvtRead(pThis, (uintptr_t)pvBuf, off, cbRead);
     862    drvdiskintTraceLogFireEvtRead(pThis, (uintptr_t)pvBuf, false /* fAsync */, off, cbRead);
    851863    rc = pThis->pDrvMedia->pfnRead(pThis->pDrvMedia, off, pvBuf, cbRead);
    852864
     
    885897    PDRVDISKINTEGRITY pThis = PDMIMEDIA_2_DRVDISKINTEGRITY(pInterface);
    886898
    887     drvdiskintTraceLogFireEvtWrite(pThis, (uintptr_t)pvBuf, off, cbWrite);
     899    drvdiskintTraceLogFireEvtWrite(pThis, (uintptr_t)pvBuf, false /* fAsync */, off, cbWrite);
    888900
    889901    if (pThis->fRecordWriteBeforeCompletion)
     
    923935    PDRVDISKINTEGRITY pThis = PDMIMEDIA_2_DRVDISKINTEGRITY(pInterface);
    924936
    925     drvdiskintTraceLogFireEvtFlush(pThis, 1);
     937    drvdiskintTraceLogFireEvtFlush(pThis, 1, false /* fAsync */);
    926938    rc = pThis->pDrvMedia->pfnFlush(pThis->pDrvMedia);
    927939    drvdiskintTraceLogFireEvtComplete(pThis, 1, rc, NULL);
     
    14211433        drvdiskintIoReqAdd(pThis, pIoReq);
    14221434
    1423     drvdiskintTraceLogFireEvtRead(pThis, (uintptr_t)hIoReq, off, cbRead);
     1435    drvdiskintTraceLogFireEvtRead(pThis, (uintptr_t)hIoReq, true /* fAsync */, off, cbRead);
    14241436    int rc = pThis->pDrvMediaEx->pfnIoReqRead(pThis->pDrvMediaEx, hIoReq, off, cbRead);
    14251437    if (rc == VINF_SUCCESS)
     
    14891501        drvdiskintIoReqAdd(pThis, pIoReq);
    14901502
    1491     drvdiskintTraceLogFireEvtWrite(pThis, (uintptr_t)hIoReq, off, cbWrite);
     1503    drvdiskintTraceLogFireEvtWrite(pThis, (uintptr_t)hIoReq, true /* fAsync */, off, cbWrite);
    14921504    if (pThis->fRecordWriteBeforeCompletion)
    14931505    {
     
    15361548        drvdiskintIoReqAdd(pThis, pIoReq);
    15371549
    1538     drvdiskintTraceLogFireEvtFlush(pThis, (uintptr_t)hIoReq);
     1550    drvdiskintTraceLogFireEvtFlush(pThis, (uintptr_t)hIoReq, true /* fAsync */);
    15391551    int rc = pThis->pDrvMediaEx->pfnIoReqFlush(pThis->pDrvMediaEx, hIoReq);
    15401552    if (rc == 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