VirtualBox

Changeset 89758 in vbox


Ignore:
Timestamp:
Jun 16, 2021 11:36:09 PM (3 years ago)
Author:
vboxsync
Message:

DevIchAc97: Profile ichac97R3StreamReSetUp as it is doing the heavy lifting wrt stream setup. bugref:9890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r89756 r89758  
    404404    STAMPROFILE             StatReset;
    405405    STAMPROFILE             StatStop;
     406    STAMPROFILE             StatReSetUpChanged;
     407    STAMPROFILE             StatReSetUpSame;
    406408    STAMCOUNTER             StatWriteLviRecover;
    407409    STAMCOUNTER             StatWriteCr;
     
    19611963 *
    19621964 * @returns VBox status code.
     1965 * @retval  VINF_NO_CHANGE if the streams weren't re-created.
     1966 *
    19631967 * @param   pDevIns     The device instance.
    19641968 * @param   pThis       The shared AC'97 device state (shared).
     
    21992203    }
    22002204    else
     2205    {
    22012206        LogFlowFunc(("[SD%RU8] Skipping set-up (unchanged: %s)\n",
    22022207                     pStreamCC->u8SD, PDMAudioStrmCfgToString(&Cfg, szTmp, sizeof(szTmp))));
     2208        rc = VINF_NO_CHANGE;
     2209    }
    22032210    return rc;
    22042211}
     
    22362243                                  PAC97STREAM pStream, PAC97STREAMR3 pStreamCC, bool fForce)
    22372244{
     2245    STAM_REL_PROFILE_START_NS(&pStreamCC->State.StatReSetUpChanged, r);
    22382246    LogFlowFunc(("[SD%RU8]\n", pStream->u8SD));
    22392247    Assert(pStream->u8SD == pStreamCC->u8SD);
     
    22422250
    22432251    ichac97R3StreamTearDown(pStream);
    2244     return ichac97R3StreamSetUp(pDevIns, pThis, pThisCC, pStream, pStreamCC, fForce);
     2252    int rc = ichac97R3StreamSetUp(pDevIns, pThis, pThisCC, pStream, pStreamCC, fForce);
     2253    if (rc == VINF_NO_CHANGE)
     2254        STAM_REL_PROFILE_STOP_NS(&pStreamCC->State.StatReSetUpSame, r);
     2255    else
     2256        STAM_REL_PROFILE_STOP_NS(&pStreamCC->State.StatReSetUpChanged, r);
     2257    return rc;
    22452258}
    22462259
     
    45114524        PDMDevHlpSTAMRegisterF(pDevIns, &pThis->aStreams[idxStream].Regs.sr, STAMTYPE_X16, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,
    45124525                               "Status register (SR).",                         "Stream%u/reg-SR", idxStream);
    4513         PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.Cfg.Props.uHz, STAMTYPE_U32, STAMVISIBILITY_USED, STAMUNIT_BYTES,
     4526        PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.Cfg.Props.uHz, STAMTYPE_U32, STAMVISIBILITY_USED, STAMUNIT_HZ,
    45144527                               "The stream frequency.",                         "Stream%u/Hz", idxStream);
    45154528        PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.Cfg.Props.cbFrame, STAMTYPE_U8, STAMVISIBILITY_USED, STAMUNIT_BYTES,
     
    45424555        PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.StatReset, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL,
    45434556                               "Resetting the stream.",  "Stream%u/Reset", idxStream);
     4557        PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.StatReSetUpChanged, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL,
     4558                               "ichac97R3StreamReSetUp when recreating the streams.", "Stream%u/ReSetUp-Change", idxStream);
     4559        PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.StatReSetUpSame, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL,
     4560                               "ichac97R3StreamReSetUp when no change.",        "Stream%u/ReSetUp-NoChange", idxStream);
    45444561        PDMDevHlpSTAMRegisterF(pDevIns, &pThisCC->aStreams[idxStream].State.StatWriteCr, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,
    45454562                               "CR register writes.",                           "Stream%u/WriteCr", idxStream);
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