VirtualBox

Changeset 64671 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Nov 15, 2016 12:53:00 PM (8 years ago)
Author:
vboxsync
Message:

DrvVD: Add statistics about how many attempts were made to query a direct buffer pointer from the device/driver above and how many succeeded

File:
1 edited

Legend:

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

    r64664 r64671  
    411411    unsigned                 cErrors;
    412412    /** @} */
     413
     414    /** @name Statistics.
     415     * @{ */
     416    /** how many attempts were made to query a direct buffer pointer from the
     417     * device/driver above. */
     418    STAMCOUNTER              StatQueryBufAttempts;
     419    /** How many attempts to query a direct buffer pointer succeeded. */
     420    STAMCOUNTER              StatQueryBufSuccess;
     421    /** @} */
    413422} VBOXDISK;
    414423
     
    29292938        void *pvBuf = NULL;
    29302939        size_t cbBuf = 0;
     2940
     2941        STAM_COUNTER_INC(&pThis->StatQueryBufAttempts);
    29312942        rc = pThis->pDrvMediaExPort->pfnIoReqQueryBuf(pThis->pDrvMediaExPort, pIoReq, &pIoReq->abAlloc[0],
    29322943                                                      &pvBuf, &cbBuf);
    29332944        if (RT_SUCCESS(rc))
    29342945        {
     2946            STAM_COUNTER_INC(&pThis->StatQueryBufSuccess);
    29352947            pIoReq->ReadWrite.cbIoBuf           = cbBuf;
    29362948            pIoReq->ReadWrite.fDirectBuf        = true;
     
    43914403        if (pThis->aIoReqAllocBins[i].hMtxLstIoReqAlloc != NIL_RTSEMFASTMUTEX)
    43924404            RTSemFastMutexDestroy(pThis->aIoReqAllocBins[i].hMtxLstIoReqAlloc);
     4405
     4406    PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatQueryBufAttempts);
     4407    PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatQueryBufSuccess);
    43934408}
    43944409
     
    53815396        }
    53825397    } /* !fEmptyDrive */
     5398
     5399    PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->StatQueryBufAttempts, "QueryBufAttempts",
     5400                              STAMUNIT_COUNT, "Number of attempts to query a direct buffer.");
     5401    PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->StatQueryBufSuccess, "QueryBufSuccess",
     5402                              STAMUNIT_COUNT, "Number of succeeded attempts to query a direct buffer.");
    53835403
    53845404    if (RT_FAILURE(rc))
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