VirtualBox

Changeset 53696 in vbox for trunk


Ignore:
Timestamp:
Jan 2, 2015 12:42:19 PM (10 years ago)
Author:
vboxsync
Message:

VBoxDTrace: Better code. (r73)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0/VBoxDTraceR0.cpp

    r53695 r53696  
    13751375{
    13761376    PSUPDRVVDTPROVIDERCORE  pProv        = (PSUPDRVVDTPROVIDERCORE)pvProv;
    1377     dtrace_provider_id_t    idProvider   = pProv->TracerData.DTrace.idProvider;
    1378     size_t const            cbFnNmBuf    = _4K + _1K;
    1379     char                   *pszFnNmBuf;
    1380     uint16_t                idxProv;
    1381     PVTGPROBELOC            pProbeLoc;
    1382     PVTGPROBELOC            pProbeLocEnd;
    13831377
    13841378    if (pDtProbeDesc)
     
    13871381    if (pProv->TracerData.DTrace.fZombie)
    13881382        return;
     1383       
     1384    dtrace_provider_id_t const idProvider   = pProv->TracerData.DTrace.idProvider;
     1385    AssertPtrReturnVoid(idProvider);
    13891386
    13901387    AssertPtrReturnVoid(pProv->pHdr);
    1391     pProbeLoc    = pProv->pHdr->paProbLocs;
    1392     pProbeLocEnd = pProv->pHdr->paProbLocsEnd;
     1388    PVTGPROBELOC pProbeLoc    = pProv->pHdr->paProbLocs;
     1389    PVTGPROBELOC pProbeLocEnd = pProv->pHdr->paProbLocsEnd;
    13931390    if (pProv->TracerData.DTrace.cProvidedProbes >= (uintptr_t)(pProbeLocEnd - pProbeLoc))
    13941391        return;
    13951392
    1396      /* Need a buffer for extracting the function names and mangling them in
    1397         case of collision. */
    1398      pszFnNmBuf = (char *)RTMemAlloc(cbFnNmBuf);
    1399      if (!pszFnNmBuf)
     1393    /* Need a buffer for extracting the function names and mangling them in
     1394       case of collision. */
     1395    size_t const            cbFnNmBuf    = _4K + _1K;
     1396    char *pszFnNmBuf = (char *)RTMemAlloc(cbFnNmBuf);
     1397    if (!pszFnNmBuf)
    14001398         return;
    14011399
    1402      /*
    1403       * Itereate the probe location list and register all probes related to
    1404       * this provider.
    1405       */
    1406      idxProv      = (uint16_t)(&pProv->pHdr->paProviders[0] - pProv->pDesc);
    1407      while ((uintptr_t)pProbeLoc < (uintptr_t)pProbeLocEnd)
    1408      {
     1400    /*
     1401     * Itereate the probe location list and register all probes related to
     1402     * this provider.
     1403     */
     1404    uint16_t idxProv = (uint16_t)(&pProv->pHdr->paProviders[0] - pProv->pDesc);
     1405    while ((uintptr_t)pProbeLoc < (uintptr_t)pProbeLocEnd)
     1406    {
    14091407         PVTGDESCPROBE pProbeDesc = (PVTGDESCPROBE)pProbeLoc->pbProbe;
    14101408         if (   pProbeDesc->idxProvider == idxProv
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