VirtualBox

Changeset 84552 in vbox


Ignore:
Timestamp:
May 27, 2020 7:34:40 AM (5 years ago)
Author:
vboxsync
Message:

VMM/DBGFTracer: Support string I/O port accesses, bugref:9210

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/dbgf.h

    r84458 r84552  
    28342834VMM_INT_DECL(int)   DBGFTracerEvtIoPortUnmap(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, uint64_t hIoPorts);
    28352835VMM_INT_DECL(int)   DBGFTracerEvtIoPortRead(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, uint64_t hIoPorts, RTIOPORT offPort, const void *pvVal, size_t cbVal);
     2836VMM_INT_DECL(int)   DBGFTracerEvtIoPortReadStr(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, uint64_t hIoPorts, RTIOPORT offPort, const void *pv, size_t cb,
     2837                                               uint32_t cTransfersReq, uint32_t cTransfersRet);
    28362838VMM_INT_DECL(int)   DBGFTracerEvtIoPortWrite(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, uint64_t hIoPorts, RTIOPORT offPort, const void *pvVal, size_t cbVal);
     2839VMM_INT_DECL(int)   DBGFTracerEvtIoPortWriteStr(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, uint64_t hIoPorts, RTIOPORT offPort, const void *pv, size_t cb,
     2840                                                uint32_t cTransfersReq, uint32_t cTransfersRet);
    28372841VMM_INT_DECL(int)   DBGFTracerEvtIrq(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, int32_t iIrq, int32_t fIrqLvl);
    28382842VMM_INT_DECL(int)   DBGFTracerEvtIoApicMsi(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, RTGCPHYS GCPhys, uint32_t u32Val);
  • trunk/src/VBox/VMM/VMMAll/DBGFAllTracer.cpp

    r84494 r84552  
    288288
    289289/**
     290 * Handles a I/O port string transfer event.
     291 *
     292 * @returns VBox status code.
     293 * @param   pVM                     The current context VM instance data.
     294 * @param   pThisCC                 The event tracer instance current context data.
     295 * @param   enmTraceEvt             The trace event type posted.
     296 * @param   hEvtSrc                 The event source for the posted event.
     297 * @param   hIoPorts                The I/O port region handle for the transfer.
     298 * @param   offPort                 The offset into the region where the transfer happened.
     299 * @param   pv                      The data being transfered.
     300 * @param   cb                      Number of bytes of valid data in the buffer.
     301 * @param   cbItem                  Item size in bytes.
     302 * @param   cTransfersReq           Number of transfers requested.
     303 * @param   cTransfersRet           Number of transfers done.
     304 */
     305static int dbgfTracerEvtIoPortStr(PVMCC pVM, PDBGFTRACERINSCC pThisCC, DBGFTRACEREVT enmTraceEvt, DBGFTRACEREVTSRC hEvtSrc,
     306                                  uint64_t hIoPorts, RTIOPORT offPort, const void *pv, size_t cb, size_t cbItem, uint32_t cTransfersReq,
     307                                  uint32_t cTransfersRet)
     308{
     309    /* Fast path for really small transfers where everything fits into the descriptor. */
     310    DBGFTRACEREVTIOPORTSTR EvtIoPortStr;
     311    EvtIoPortStr.hIoPorts      = hIoPorts;
     312    EvtIoPortStr.cbItem        = cbItem;
     313    EvtIoPortStr.cTransfersReq = cTransfersReq;
     314    EvtIoPortStr.cTransfersRet = cTransfersRet;
     315    EvtIoPortStr.offPort       = offPort;
     316    if (cb <= sizeof(EvtIoPortStr.abData))
     317    {
     318        memcpy(&EvtIoPortStr.abData[0], pv, cb);
     319        return dbgfTracerEvtPostSingle(pVM, pThisCC, hEvtSrc, enmTraceEvt, &EvtIoPortStr, NULL /*pidEvt*/);
     320    }
     321
     322    /*
     323     * Slow path where we have to split the data into multiple entries.
     324     * Each one is linked to the previous one by the previous event ID.
     325     */
     326    const uint8_t *pbBuf = (const uint8_t *)pv;
     327    size_t cbLeft = cb;
     328    uint64_t idEvtPrev = 0;
     329    memcpy(&EvtIoPortStr.abData[0], pbBuf, sizeof(EvtIoPortStr.abData));
     330    pbBuf  += sizeof(EvtIoPortStr.abData);
     331    cbLeft -= sizeof(EvtIoPortStr.abData);
     332
     333    int rc = dbgfTracerEvtPostSingle(pVM, pThisCC, hEvtSrc, enmTraceEvt, &EvtIoPortStr, &idEvtPrev);
     334    while (   RT_SUCCESS(rc)
     335           && cbLeft)
     336    {
     337        size_t cbThisXfer = RT_MIN(cbLeft, DBGF_TRACER_EVT_PAYLOAD_SZ);
     338        rc = dbgfTracerEvtPostEx(pVM, pThisCC, hEvtSrc, enmTraceEvt, idEvtPrev,
     339                                 pbBuf, cbThisXfer, &idEvtPrev);
     340
     341        pbBuf  += cbThisXfer;
     342        cbLeft -= cbThisXfer;
     343    }
     344
     345    return rc;
     346}
     347
     348
     349/**
    290350 * Registers an MMIO region mapping event for the given event source.
    291351 *
     
    490550
    491551/**
     552 * Registers an I/O region string read event for the given event source.
     553 *
     554 * @returns VBox status code.
     555 * @param   pVM                     The current context VM instance data.
     556 * @param   hEvtSrc                 The event source for the posted event.
     557 * @param   hIoPorts                The I/O port region handle being read from.
     558 * @param   offPort                 The offset into the region where the read happened.
     559 * @param   pv                      The data being read.
     560 * @param   cb                      Item size in bytes.
     561 * @param   cTransfersReq           Number of transfers requested.
     562 * @param   cTransfersRet           Number of transfers done.
     563 */
     564VMM_INT_DECL(int) DBGFTracerEvtIoPortReadStr(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, uint64_t hIoPorts, RTIOPORT offPort, const void *pv, size_t cb,
     565                                             uint32_t cTransfersReq, uint32_t cTransfersRet)
     566{
     567    PDBGFTRACERINSCC pThisCC = dbgfTracerGetInstance(pVM);
     568    AssertReturn(pThisCC, VERR_DBGF_TRACER_IPE_1);
     569
     570    return dbgfTracerEvtIoPortStr(pVM, pThisCC, DBGFTRACEREVT_IOPORT_READ_STR, hEvtSrc, hIoPorts, offPort, pv, cTransfersRet * cb,
     571                                  cb, cTransfersReq, cTransfersRet);
     572}
     573
     574
     575/**
    492576 * Registers an I/O region write event for the given event source.
    493577 *
     
    517601
    518602/**
     603 * Registers an I/O region string write event for the given event source.
     604 *
     605 * @returns VBox status code.
     606 * @param   pVM                     The current context VM instance data.
     607 * @param   hEvtSrc                 The event source for the posted event.
     608 * @param   hIoPorts                The I/O port region handle being written to.
     609 * @param   offPort                 The offset into the region where the write happened.
     610 * @param   pv                      The data being written.
     611 * @param   cb                      Item size in bytes.
     612 * @param   cTransfersReq           Number of transfers requested.
     613 * @param   cTransfersRet           Number of transfers done.
     614 */
     615VMM_INT_DECL(int) DBGFTracerEvtIoPortWriteStr(PVMCC pVM, DBGFTRACEREVTSRC hEvtSrc, uint64_t hIoPorts, RTIOPORT offPort, const void *pv, size_t cb,
     616                                              uint32_t cTransfersReq, uint32_t cTransfersRet)
     617{
     618    PDBGFTRACERINSCC pThisCC = dbgfTracerGetInstance(pVM);
     619    AssertReturn(pThisCC, VERR_DBGF_TRACER_IPE_1);
     620
     621    return dbgfTracerEvtIoPortStr(pVM, pThisCC, DBGFTRACEREVT_IOPORT_WRITE_STR, hEvtSrc, hIoPorts, offPort, pv, cTransfersReq * cb,
     622                                  cb, cTransfersReq, cTransfersRet);
     623}
     624
     625
     626/**
    519627 * Registers an IRQ change event for the given event source.
    520628 *
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Tracer.cpp

    r84494 r84552  
    185185static const RTTRACELOGEVTITEMDESC g_DevIoPortRwEvtItems[] =
    186186{
    187     {"hIoPorts",       "The MMIO region handle being unmapped",                 RTTRACELOGTYPE_UINT64,  0},
     187    {"hIoPorts",       "The I/O region handle being accessed",                  RTTRACELOGTYPE_UINT64,  0},
    188188    {"offPort",        "The offset in the I/O port region being accessed",      RTTRACELOGTYPE_UINT16,  0},
    189189    {"cbXfer",         "Number of bytes being transfered",                      RTTRACELOGTYPE_UINT64,  0},
     
    210210
    211211
     212static const RTTRACELOGEVTITEMDESC g_DevIoPortRwStrEvtItems[] =
     213{
     214    {"hIoPorts",       "The I/O region handle being accesses",                  RTTRACELOGTYPE_UINT64,  0},
     215    {"offPort",        "The offset in the I/O port region being accessed",      RTTRACELOGTYPE_UINT16,  0},
     216    {"cbItem",         "Item size for the access",                              RTTRACELOGTYPE_UINT32,  0},
     217    {"cTransfersReq",  "Number of transfers requested by the guest",            RTTRACELOGTYPE_UINT32,  0},
     218    {"cTransfersRet",  "Number of transfers executed by the device",            RTTRACELOGTYPE_UINT32,  0}
     219};
     220
     221static const RTTRACELOGEVTDESC g_DevIoPortReadStrEvtDesc =
     222{
     223    "Dev.IoPortReadStr",
     224    "I/O port region of a device is being read using REP INS",
     225    RTTRACELOGEVTSEVERITY_DEBUG,
     226    RT_ELEMENTS(g_DevIoPortRwStrEvtItems),
     227    &g_DevIoPortRwStrEvtItems[0]
     228};
     229
     230static const RTTRACELOGEVTDESC g_DevIoPortWriteStrEvtDesc =
     231{
     232    "Dev.IoPortWriteStr",
     233    "I/O port region of a device is being written using REP OUTS",
     234    RTTRACELOGEVTSEVERITY_DEBUG,
     235    RT_ELEMENTS(g_DevIoPortRwStrEvtItems),
     236    &g_DevIoPortRwStrEvtItems[0]
     237};
     238
     239
    212240static const RTTRACELOGEVTITEMDESC g_DevIrqEvtItems[] =
    213241{
     
    269297
    270298
    271 static const RTTRACELOGEVTITEMDESC g_DevGCPhysRwDataEvtItems[] =
     299static const RTTRACELOGEVTITEMDESC g_DevRwDataEvtItems[] =
    272300{
    273301    {"abData",        "The data being read/written",                            RTTRACELOGTYPE_RAWDATA,  0}
    274302};
    275303
    276 static const RTTRACELOGEVTDESC g_DevGCPhysRwDataEvtDesc =
    277 {
    278     "Dev.GCPhysRwData",
     304static const RTTRACELOGEVTDESC g_DevRwDataEvtDesc =
     305{
     306    "Dev.RwData",
    279307    "The data being read or written",
    280308    RTTRACELOGEVTSEVERITY_DEBUG,
    281     RT_ELEMENTS(g_DevGCPhysRwDataEvtItems),
    282     &g_DevGCPhysRwDataEvtItems[0]
     309    RT_ELEMENTS(g_DevRwDataEvtItems),
     310    &g_DevRwDataEvtItems[0]
    283311};
    284312
     
    295323 * @param   pThis                   The DBGF tracer instance.
    296324 */
    297 static PDBGFTRACERGCPHYSRWAGG dbgfTracerR3EvtGCPhysRwAggNew(PDBGFTRACERINSR3 pThis)
     325static PDBGFTRACERGCPHYSRWAGG dbgfTracerR3EvtRwAggNew(PDBGFTRACERINSR3 pThis)
    298326{
    299327    for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aGstMemRwData); i++)
     
    314342 * @param   idEvtPrev               The event ID to look for.
    315343 */
    316 static PDBGFTRACERGCPHYSRWAGG dbgfTracerR3EvtGCPhysRwAggFind(PDBGFTRACERINSR3 pThis, uint64_t idEvtPrev)
     344static PDBGFTRACERGCPHYSRWAGG dbgfTracerR3EvtRwAggFind(PDBGFTRACERINSR3 pThis, uint64_t idEvtPrev)
    317345{
    318346    for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aGstMemRwData); i++)
     
    324352
    325353    return NULL;
     354}
     355
     356
     357/**
     358 * Common code for the guest memory and string I/O port read/write events.
     359 *
     360 * @returns VBox status code.
     361 * @param   pThis                   The DBGF tracer instance.
     362 * @param   pEvtHdr                 The event header.
     363 * @param   cbXfer                  Overall number of bytes of data for this event.
     364 * @param   pvData                  Initial data supplied in the event starting the aggregation.
     365 * @param   cbData                  Number of initial bytes of data.
     366 */
     367static int dbgfTracerR3EvtRwStartCommon(PDBGFTRACERINSR3 pThis, PCDBGFTRACEREVTHDR pEvtHdr, size_t cbXfer, const void *pvData, size_t cbData)
     368{
     369    /* Slow path, find an empty aggregation structure. */
     370    int rc = VINF_SUCCESS;
     371    PDBGFTRACERGCPHYSRWAGG pDataAgg = dbgfTracerR3EvtRwAggNew(pThis);
     372    if (RT_LIKELY(pDataAgg))
     373    {
     374        /* Initialize it. */
     375        pDataAgg->idEvtStart = pEvtHdr->idEvt;
     376        pDataAgg->idEvtPrev  = pEvtHdr->idEvt;
     377        pDataAgg->cbXfer     = cbXfer;
     378        pDataAgg->cbLeft     = pDataAgg->cbXfer;
     379        pDataAgg->offBuf     = 0;
     380
     381        /* Need to reallocate the buffer to hold the complete data? */
     382        if (RT_UNLIKELY(pDataAgg->cbBufMax < pDataAgg->cbXfer))
     383        {
     384            uint8_t *pbBufNew = (uint8_t *)RTMemRealloc(pDataAgg->pbBuf, pDataAgg->cbXfer);
     385            if (RT_LIKELY(pbBufNew))
     386            {
     387                pDataAgg->pbBuf    = pbBufNew;
     388                pDataAgg->cbBufMax = pDataAgg->cbXfer;
     389            }
     390            else
     391                rc = VERR_NO_MEMORY;
     392        }
     393
     394        if (RT_SUCCESS(rc))
     395        {
     396            memcpy(pDataAgg->pbBuf, pvData, cbData);
     397            pDataAgg->offBuf += cbData;
     398            pDataAgg->cbLeft -= cbData;
     399        }
     400    }
     401    else
     402        rc = VERR_NO_MEMORY;
     403
     404    if (RT_FAILURE(rc))
     405    {
     406        LogRelMax(10, ("DBGF: Creating new data aggregation structure for memory read/write failed with %Rrc, trace log will not contain data for this event!\n", rc));
     407
     408        /* Write out the finish event without any data. */
     409        size_t cbEvtData = 0;
     410        rc = RTTraceLogWrEvtAdd(pThis->hTraceLog, &g_DevRwDataEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_FINISH,
     411                                pEvtHdr->idEvt, pEvtHdr->hEvtSrc, NULL, &cbEvtData);
     412        if (pDataAgg) /* Reset the aggregation event. */
     413            pDataAgg->idEvtStart = DBGF_TRACER_EVT_HDR_ID_INVALID;
     414    }
     415
     416    return rc;
    326417}
    327418
     
    352443            size_t cbEvtData = pEvtGCPhysRw->cbXfer;
    353444
    354             rc = RTTraceLogWrEvtAdd(pThis->hTraceLog, &g_DevGCPhysRwDataEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_FINISH,
     445            rc = RTTraceLogWrEvtAdd(pThis->hTraceLog, &g_DevRwDataEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_FINISH,
    355446                                    pEvtHdr->idEvt, pEvtHdr->hEvtSrc, &pEvtGCPhysRw->abData[0], &cbEvtData);
    356447        }
    357448        else
    358         {
    359             /* Slow path, find an empty aggregation structure. */
    360             PDBGFTRACERGCPHYSRWAGG pDataAgg = dbgfTracerR3EvtGCPhysRwAggNew(pThis);
    361             if (RT_LIKELY(pDataAgg))
    362             {
    363                 /* Initialize it. */
    364                 pDataAgg->idEvtStart = pEvtHdr->idEvt;
    365                 pDataAgg->idEvtPrev  = pEvtHdr->idEvt;
    366                 pDataAgg->cbXfer     = pEvtGCPhysRw->cbXfer;
    367                 pDataAgg->cbLeft     = pDataAgg->cbXfer;
    368                 pDataAgg->offBuf     = 0;
    369 
    370                 /* Need to reallocate the buffer to hold the complete data? */
    371                 if (RT_UNLIKELY(pDataAgg->cbBufMax < pDataAgg->cbXfer))
    372                 {
    373                     uint8_t *pbBufNew = (uint8_t *)RTMemRealloc(pDataAgg->pbBuf, pDataAgg->cbXfer);
    374                     if (RT_LIKELY(pbBufNew))
    375                     {
    376                         pDataAgg->pbBuf    = pbBufNew;
    377                         pDataAgg->cbBufMax = pDataAgg->cbXfer;
    378                     }
    379                     else
    380                         rc = VERR_NO_MEMORY;
    381                 }
    382 
    383                 if (RT_SUCCESS(rc))
    384                 {
    385                     memcpy(pDataAgg->pbBuf, &pEvtGCPhysRw->abData[0], sizeof(pEvtGCPhysRw->abData));
    386                     pDataAgg->offBuf += sizeof(pEvtGCPhysRw->abData);
    387                     pDataAgg->cbLeft -= sizeof(pEvtGCPhysRw->abData);
    388                 }
    389             }
    390             else
    391                 rc = VERR_NO_MEMORY;
    392 
    393             if (RT_FAILURE(rc))
    394             {
    395                 LogRelMax(10, ("DBGF: Creating new data aggregation structure for guest memory read/write failed with %Rrc, trace log will not contain data for this event!\n", rc));
    396 
    397                 /* Write out the finish event without any data. */
    398                 size_t cbEvtData = 0;
    399                 rc = RTTraceLogWrEvtAdd(pThis->hTraceLog, &g_DevGCPhysRwDataEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_FINISH,
    400                                         pEvtHdr->idEvt, pEvtHdr->hEvtSrc, NULL, &cbEvtData);
    401                 if (pDataAgg) /* Reset the aggregation event. */
    402                     pDataAgg->idEvtStart = DBGF_TRACER_EVT_HDR_ID_INVALID;
    403             }
    404         }
     449            rc = dbgfTracerR3EvtRwStartCommon(pThis, pEvtHdr, pEvtGCPhysRw->cbXfer, &pEvtGCPhysRw->abData[0], sizeof(pEvtGCPhysRw->abData));
    405450    }
    406451
     
    410455
    411456/**
    412  * Continues a previously started guest memory read/write event.
     457 * Starts a new I/O port string read/write event.
     458 *
     459 * @returns VBox status code.
     460 * @param   pThis                   The DBGF tracer instance.
     461 * @param   pEvtHdr                 The event header.
     462 * @param   pEvtIoPortStrRw         The I/O port string read/write event descriptor.
     463 * @param   cbXfer                  Number of bytes of valid data for this event.
     464 * @param   pEvtDesc                The event descriptor written to the trace log.
     465 */
     466static int dbgfTracerR3EvtIoPortStrRwStart(PDBGFTRACERINSR3 pThis, PCDBGFTRACEREVTHDR pEvtHdr,
     467                                           PCDBGFTRACEREVTIOPORTSTR pEvtIoPortStrRw, size_t cbXfer,
     468                                           PCRTTRACELOGEVTDESC pEvtDesc)
     469{
     470    /* Write out the event header first in any case. */
     471    int rc = RTTraceLogWrEvtAddL(pThis->hTraceLog, pEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_START,
     472                                 pEvtHdr->idEvt, pEvtHdr->hEvtSrc, pEvtIoPortStrRw->hIoPorts, pEvtIoPortStrRw->offPort,
     473                                 pEvtIoPortStrRw->cbItem, pEvtIoPortStrRw->cTransfersReq, pEvtIoPortStrRw->cTransfersRet);
     474    if (RT_SUCCESS(rc))
     475    {
     476        /*
     477         * If the amount of data is small enough to fit into the single event descriptor we can skip allocating
     478         * an aggregation tracking structure and write the event containing the complete data out immediately.
     479         */
     480        if (cbXfer <= sizeof(pEvtIoPortStrRw->abData))
     481        {
     482            size_t cbEvtData = cbXfer;
     483
     484            rc = RTTraceLogWrEvtAdd(pThis->hTraceLog, &g_DevRwDataEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_FINISH,
     485                                    pEvtHdr->idEvt, pEvtHdr->hEvtSrc, &pEvtIoPortStrRw->abData[0], &cbEvtData);
     486        }
     487        else
     488            rc = dbgfTracerR3EvtRwStartCommon(pThis, pEvtHdr, cbXfer, &pEvtIoPortStrRw->abData[0], sizeof(pEvtIoPortStrRw->abData));
     489    }
     490
     491    return rc;
     492}
     493
     494
     495/**
     496 * Continues a previously started guest memory or string I/O port read/write event.
    413497 *
    414498 * @returns VBox status code.
     
    417501 * @param   pvData                  The data to log.
    418502 */
    419 static int dbgfTracerR3EvtGCPhysRwContinue(PDBGFTRACERINSR3 pThis, PCDBGFTRACEREVTHDR pEvtHdr, void *pvData)
     503static int dbgfTracerR3EvtRwContinue(PDBGFTRACERINSR3 pThis, PCDBGFTRACEREVTHDR pEvtHdr, void *pvData)
    420504{
    421505    int rc = VINF_SUCCESS;
    422     PDBGFTRACERGCPHYSRWAGG pDataAgg = dbgfTracerR3EvtGCPhysRwAggFind(pThis, pEvtHdr->idEvtPrev);
     506    PDBGFTRACERGCPHYSRWAGG pDataAgg = dbgfTracerR3EvtRwAggFind(pThis, pEvtHdr->idEvtPrev);
    423507
    424508    if (RT_LIKELY(pDataAgg))
     
    433517        {
    434518            /* All data aggregated, write it out and reset the structure. */
    435             rc = RTTraceLogWrEvtAdd(pThis->hTraceLog, &g_DevGCPhysRwDataEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_FINISH,
     519            rc = RTTraceLogWrEvtAdd(pThis->hTraceLog, &g_DevRwDataEvtDesc, RTTRACELOG_WR_ADD_EVT_F_GRP_FINISH,
    436520                                    pDataAgg->idEvtStart, pEvtHdr->hEvtSrc, pDataAgg->pbBuf, &pDataAgg->cbXfer);
    437521            pDataAgg->offBuf     = 0;
     
    543627                                     pEvtHdr->idEvt, pEvtHdr->hEvtSrc, pEvtIoPortRw->hIoPorts, pEvtIoPortRw->offPort,
    544628                                     pEvtIoPortRw->cbXfer, pEvtIoPortRw->u32Val);
     629            break;
     630        }
     631        case DBGFTRACEREVT_IOPORT_READ_STR:
     632        case DBGFTRACEREVT_IOPORT_WRITE_STR:
     633        {
     634            PCRTTRACELOGEVTDESC pEvtDesc =   pEvtHdr->enmEvt == DBGFTRACEREVT_IOPORT_WRITE_STR
     635                                           ? &g_DevIoPortWriteStrEvtDesc
     636                                           : &g_DevIoPortReadStrEvtDesc;
     637
     638            /* If the previous event ID is invalid this starts a new read/write we have to aggregate all the data for. */
     639            if (pEvtHdr->idEvtPrev == DBGF_TRACER_EVT_HDR_ID_INVALID)
     640            {
     641                PCDBGFTRACEREVTIOPORTSTR pEvtIoPortStrRw = (PCDBGFTRACEREVTIOPORTSTR)(pEvtHdr + 1);
     642                size_t cbXfer =   pEvtHdr->enmEvt == DBGFTRACEREVT_IOPORT_WRITE_STR
     643                                ? pEvtIoPortStrRw->cTransfersReq * pEvtIoPortStrRw->cbItem
     644                                : pEvtIoPortStrRw->cTransfersRet * pEvtIoPortStrRw->cbItem;
     645
     646                rc = dbgfTracerR3EvtIoPortStrRwStart(pThis, pEvtHdr, pEvtIoPortStrRw, cbXfer, pEvtDesc);
     647            }
     648            else
     649            {
     650                /* Continuation of a started read or write, look up the right tracking structure and process the new data. */
     651                void *pvData = pEvtHdr + 1;
     652                rc = dbgfTracerR3EvtRwContinue(pThis, pEvtHdr, pvData);
     653            }
    545654            break;
    546655        }
     
    578687                /* Continuation of a started read or write, look up the right tracking structure and process the new data. */
    579688                void *pvData = pEvtHdr + 1;
    580                 rc = dbgfTracerR3EvtGCPhysRwContinue(pThis, pEvtHdr, pvData);
     689                rc = dbgfTracerR3EvtRwContinue(pThis, pEvtHdr, pvData);
    581690            }
    582691            break;
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