VirtualBox

Changeset 93468 in vbox


Ignore:
Timestamp:
Jan 27, 2022 9:17:12 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149580
Message:

VBoxDbg,VMM/STAM,Main: Converted VBoxDbg to use the VMM function table, extending the STAMR3Enum to include the unit string to avoid needing to call STAMR3GetUnit a lot. The latter would better fit with the XML based viewer, as it only gets the string version of the unit. Had to adjust a user of STAMR3Enum in Main. bugref:10074

Location:
trunk
Files:
10 edited

Legend:

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

    r93115 r93468  
    13411341 * @param   pvSample        Pointer to the data. enmType indicates the format of this data.
    13421342 * @param   enmUnit         The unit.
     1343 * @param   pszUnit         The unit as string.  This is a permanent string,
     1344 *                          same as returned by STAMR3GetUnit().
    13431345 * @param   enmVisibility   The visibility.
    13441346 * @param   pszDesc         The description.
     
    13461348 */
    13471349typedef DECLCALLBACKTYPE(int, FNSTAMR3ENUM,(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
    1348                                             STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser));
     1350                                            const char *pszUnit, STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser));
    13491351/** Pointer to a FNSTAMR3ENUM(). */
    13501352typedef FNSTAMR3ENUM *PFNSTAMR3ENUM;
  • trunk/src/VBox/Debugger/Makefile.kmk

    r93115 r93468  
    114114        VBoxDbgConsole.cpp \
    115115        VBoxDbgStatsQt.cpp
    116 VBoxDbg_LIBS = \
    117         $(VBOX_LIB_VMM_LAZY)
    118116VBoxDbg_LDFLAGS.darwin = \
    119117        -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDbg.dylib
  • trunk/src/VBox/Debugger/VBoxDbg.cpp

    r93460 r93468  
    151151{
    152152    AssertPtrReturn(pUVM, VERR_INVALID_POINTER);
    153     AssertPtrReturn(VMR3RetainUVM(pUVM) != UINT32_MAX, VERR_INVALID_POINTER);
     153    AssertPtrReturn(pVMM, VERR_INVALID_POINTER);
     154    AssertReturn(VMMR3VTABLE_IS_COMPATIBLE(pVMM->uMagicVersion), VERR_VERSION_MISMATCH);
     155    AssertReturn(pVMM->pfnVMR3RetainUVM(pUVM) != UINT32_MAX, VERR_INVALID_POINTER);
    154156
    155157    int rc = dbgGuiCreate(NULL, pUVM, pVMM, ppGui, ppGuiVT);
    156158
    157     VMR3ReleaseUVM(pUVM);
     159    pVMM->pfnVMR3ReleaseUVM(pUVM);
    158160    return rc;
    159161}
  • trunk/src/VBox/Debugger/VBoxDbgBase.cpp

    r93444 r93468  
    3434
    3535VBoxDbgBase::VBoxDbgBase(VBoxDbgGui *a_pDbgGui)
    36     : m_pDbgGui(a_pDbgGui), m_pUVM(NULL), m_hGUIThread(RTThreadNativeSelf())
     36    : m_pDbgGui(a_pDbgGui), m_pUVM(NULL), m_pVMM(NULL), m_hGUIThread(RTThreadNativeSelf())
    3737{
    3838    NOREF(m_pDbgGui); /* shut up warning. */
     
    4242     */
    4343    m_pUVM = a_pDbgGui->getUvmHandle();
    44     if (m_pUVM)
    45     {
    46         VMR3RetainUVM(m_pUVM);
    47 
    48         int rc = VMR3AtStateRegister(m_pUVM, atStateChange, this);
     44    m_pVMM = a_pDbgGui->getVMMFunctionTable();
     45    if (m_pUVM && m_pVMM)
     46    {
     47        m_pVMM->pfnVMR3RetainUVM(m_pUVM);
     48
     49        int rc = m_pVMM->pfnVMR3AtStateRegister(m_pUVM, atStateChange, this);
    4950        AssertRC(rc);
    5051    }
     
    5859     */
    5960    /** @todo need to do some locking here?  */
    60     PUVM pUVM = ASMAtomicXchgPtrT(&m_pUVM, NULL, PUVM);
    61     if (pUVM)
    62     {
    63         int rc = VMR3AtStateDeregister(pUVM, atStateChange, this);
     61    PUVM          pUVM = ASMAtomicXchgPtrT(&m_pUVM, NULL, PUVM);
     62    PCVMMR3VTABLE pVMM = ASMAtomicXchgPtrT(&m_pVMM, NULL, PCVMMR3VTABLE);
     63    if (pUVM && pVMM)
     64    {
     65        int rc = pVMM->pfnVMR3AtStateDeregister(pUVM, atStateChange, this);
    6466        AssertRC(rc);
    6567
    66         VMR3ReleaseUVM(pUVM);
     68        pVMM->pfnVMR3ReleaseUVM(pUVM);
    6769    }
    6870}
     
    7476    QByteArray Utf8Array = rPat.toUtf8();
    7577    const char *pszPat = !rPat.isEmpty() ? Utf8Array.constData() : NULL;
    76     PUVM pUVM = m_pUVM;
    77     if (    pUVM
    78         &&  VMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
    79         return STAMR3Reset(pUVM, pszPat);
     78    PUVM          pUVM = m_pUVM;
     79    PCVMMR3VTABLE pVMM = m_pVMM;
     80    if (   pUVM
     81        && pVMM
     82        && pVMM->pfnVMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
     83        return pVMM->pfnSTAMR3Reset(pUVM, pszPat);
    8084    return VERR_INVALID_HANDLE;
    8185}
     
    8791    QByteArray Utf8Array = rPat.toUtf8();
    8892    const char *pszPat = !rPat.isEmpty() ? Utf8Array.constData() : NULL;
    89     PUVM pUVM = m_pUVM;
    90     if (    pUVM
    91         &&  VMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
    92         return STAMR3Enum(pUVM, pszPat, pfnEnum, pvUser);
     93    PUVM          pUVM = m_pUVM;
     94    PCVMMR3VTABLE pVMM = m_pVMM;
     95    if (   pUVM
     96        && pVMM
     97        && pVMM->pfnVMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
     98        return pVMM->pfnSTAMR3Enum(pUVM, pszPat, pfnEnum, pvUser);
    9399    return VERR_INVALID_HANDLE;
    94100}
     
    98104VBoxDbgBase::dbgcCreate(PCDBGCIO pIo, unsigned fFlags)
    99105{
    100     PUVM pUVM = m_pUVM;
    101     if (    pUVM
    102         &&  VMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
    103         return DBGCCreate(pUVM, pIo, fFlags);
     106    PUVM          pUVM = m_pUVM;
     107    PCVMMR3VTABLE pVMM = m_pVMM;
     108    if (   pUVM
     109        && pVMM
     110        && pVMM->pfnVMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
     111        return pVMM->pfnDBGCCreate(pUVM, pIo, fFlags);
    104112    return VERR_INVALID_HANDLE;
    105113}
     
    107115
    108116/*static*/ DECLCALLBACK(void)
    109 VBoxDbgBase::atStateChange(PUVM pUVM, PCVMMR3VTABLE /*pVMM*/, VMSTATE enmState, VMSTATE /*enmOldState*/, void *pvUser)
     117VBoxDbgBase::atStateChange(PUVM pUVM, PCVMMR3VTABLE pVMM, VMSTATE enmState, VMSTATE /*enmOldState*/, void *pvUser)
    110118{
    111119    VBoxDbgBase *pThis = (VBoxDbgBase *)pvUser; NOREF(pUVM);
     
    115123        {
    116124            /** @todo need to do some locking here?  */
    117             PUVM pUVM2 = ASMAtomicXchgPtrT(&pThis->m_pUVM, NULL, PUVM);
    118             if (pUVM2)
     125            PUVM          pUVM2 = ASMAtomicXchgPtrT(&pThis->m_pUVM, NULL, PUVM);
     126            PCVMMR3VTABLE pVMM2 = ASMAtomicXchgPtrT(&pThis->m_pVMM, NULL, PCVMMR3VTABLE);
     127            if (pUVM2 && pVMM2)
    119128            {
    120129                Assert(pUVM2 == pUVM);
     130                Assert(pVMM2 == pVMM);
    121131                pThis->sigTerminated();
    122                 VMR3ReleaseUVM(pUVM2);
     132                pVMM->pfnVMR3ReleaseUVM(pUVM2);
    123133            }
    124134            break;
     
    132142            break;
    133143    }
     144    RT_NOREF(pVMM);
    134145}
    135146
  • trunk/src/VBox/Debugger/VBoxDbgBase.h

    r93460 r93468  
    115115    /** The user mode VM handle. */
    116116    PUVM volatile m_pUVM;
     117    /** The VMM function table. */
     118    PCVMMR3VTABLE volatile m_pVMM;
    117119    /** The handle of the GUI thread. */
    118120    RTNATIVETHREAD m_hGUIThread;
  • trunk/src/VBox/Debugger/VBoxDbgGui.h

    r93460 r93468  
    143143    {
    144144        return m_pUVM;
     145    }
     146
     147    /**
     148     * Gets the VMM function table.
     149     * @returns The VMM function table.
     150     */
     151    PCVMMR3VTABLE getVMMFunctionTable() const
     152    {
     153        return m_pVMM;
    145154    }
    146155
  • trunk/src/VBox/Debugger/VBoxDbgStatsQt.cpp

    r93115 r93468  
    4141#include <iprt/mem.h>
    4242#include <iprt/assert.h>
     43
     44#include "VBoxDbgGui.h"
    4345
    4446
     
    102104    /** Our index among the parent's children. */
    103105    uint32_t                iSelf;
    104     /** The unit. */
    105     STAMUNIT                enmUnit;
     106    /** The unit string. (not allocated) */
     107    const char             *pszUnit;
    106108    /** The data type.
    107109     * For filler nodes not containing data, this will be set to STAMTYPE_INVALID. */
     
    309311     * Initializes a pristine node.
    310312     */
    311     static int initNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit, const char *pszDesc);
     313    static int initNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample, const char *pszUnit, const char *pszDesc);
    312314
    313315    /**
    314316     * Updates (or reinitializes if you like) a node.
    315317     */
    316     static void updateNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit, const char *pszDesc);
     318    static void updateNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample, const char *pszUnit, const char *pszDesc);
    317319
    318320    /**
     
    362364     * @copydoc FNSTAMR3ENUM */
    363365    static DECLCALLBACK(int) updateCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
    364                                             STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser);
     366                                            const char *pszUnit, STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser);
    365367
    366368    /**
     
    581583     * @param   a_rPatStr       The selection pattern.
    582584     * @param   a_pParent       The parent object. NULL is fine.
    583      */
    584     VBoxDbgStatsModelVM(VBoxDbgGui *a_pDbgGui, QString &a_rPatStr, QObject *a_pParent);
     585     * @param   a_pVMM          The VMM function table.
     586     */
     587    VBoxDbgStatsModelVM(VBoxDbgGui *a_pDbgGui, QString &a_rPatStr, QObject *a_pParent, PCVMMR3VTABLE pVMM);
    585588
    586589    /** Destructor */
     
    595598     */
    596599    static DECLCALLBACK(int) createNewTreeCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
    597                                                    STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser);
     600                                                   const char *pszUnit, STAMVISIBILITY enmVisibility, const char *pszDesc,
     601                                                   void *pvUser);
    598602
    599603    /**
     
    605609     */
    606610    PDBGGUISTATSNODE createNewTree(QString &a_rPatStr);
     611
     612    /** The VMM function table. */
     613    PCVMMR3VTABLE m_pVMM;
    607614};
    608615
     
    821828    a_pNode->cChildren = 0;
    822829    a_pNode->iSelf = UINT32_MAX;
    823     a_pNode->enmUnit = STAMUNIT_INVALID;
     830    a_pNode->pszUnit = "";
    824831    a_pNode->enmType = STAMTYPE_INVALID;
    825832
     
    856863    pRoot->iSelf = 0;
    857864    pRoot->enmType = STAMTYPE_INVALID;
    858     pRoot->enmUnit = STAMUNIT_INVALID;
     865    pRoot->pszUnit = "";
    859866    pRoot->pszName = (char *)RTMemDup("/", sizeof("/"));
    860867    pRoot->cchName = 1;
     
    876883    pNode->iSelf = UINT32_MAX;
    877884    pNode->enmType = STAMTYPE_INVALID;
    878     pNode->enmUnit = STAMUNIT_INVALID;
     885    pNode->pszUnit = "";
    879886    pNode->pszName = (char *)RTMemDupEx(pszName, cchName, 1);
    880887    pNode->cchName = cchName;
     
    10591066
    10601067/*static*/ int
    1061 VBoxDbgStatsModel::initNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit, const char *pszDesc)
     1068VBoxDbgStatsModel::initNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample,
     1069                            const char *pszUnit, const char *pszDesc)
    10621070{
    10631071    /*
    10641072     * Copy the data.
    10651073     */
    1066     pNode->enmUnit = enmUnit;
     1074    pNode->pszUnit = pszUnit;
    10671075    Assert(pNode->enmType == STAMTYPE_INVALID);
    10681076    pNode->enmType = enmType;
     
    11381146
    11391147/*static*/ void
    1140 VBoxDbgStatsModel::updateNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit, const char *pszDesc)
    1141 {
    1142 
     1148VBoxDbgStatsModel::updateNode(PDBGGUISTATSNODE pNode, STAMTYPE enmType, void *pvSample, const char *pszUnit, const char *pszDesc)
     1149{
    11431150    /*
    11441151     * Reset and init the node if the type changed.
     
    11481155        if (pNode->enmType != STAMTYPE_INVALID)
    11491156            resetNode(pNode);
    1150         initNode(pNode, enmType, pvSample, enmUnit, pszDesc);
     1157        initNode(pNode, enmType, pvSample, pszUnit, pszDesc);
    11511158        pNode->enmState = kDbgGuiStatsNodeState_kRefresh;
    11521159    }
     
    17641771/*static*/ DECLCALLBACK(int)
    17651772VBoxDbgStatsModel::updateCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
    1766                                   STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser)
     1773                                  const char *pszUnit, STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser)
    17671774{
    17681775    VBoxDbgStatsModelVM *pThis = (VBoxDbgStatsModelVM *)pvUser;
    17691776    Log3(("updateCallback: %s\n", pszName));
     1777    RT_NOREF(enmUnit);
    17701778
    17711779    /*
     
    18051813     * Perform the update and advance to the next one.
    18061814     */
    1807     updateNode(pNode, enmType, pvSample, enmUnit, pszDesc);
     1815    updateNode(pNode, enmType, pvSample, pszUnit, pszDesc);
    18081816    pThis->updateCallbackAdvance(pNode);
    18091817
     
    22302238VBoxDbgStatsModel::strUnit(PCDBGGUISTATSNODE pNode)
    22312239{
    2232     if (pNode->enmUnit == STAMUNIT_INVALID)
    2233         return "";
    2234     return STAMR3GetUnit(pNode->enmUnit);
     2240    return pNode->pszUnit;
    22352241}
    22362242
     
    25122518    {
    25132519        case STAMTYPE_COUNTER:
    2514             RTStrPrintf(szBuf, sizeof(szBuf), "%8llu %s", a_pNode->Data.Counter.c, STAMR3GetUnit(a_pNode->enmUnit));
     2520            RTStrPrintf(szBuf, sizeof(szBuf), "%8llu %s", a_pNode->Data.Counter.c, a_pNode->pszUnit);
    25152521            break;
    25162522
     
    25212527            RTStrPrintf(szBuf, sizeof(szBuf),
    25222528                        "%8llu %s (%12llu ticks, %7llu times, max %9llu, min %7lld)",
    2523                         a_pNode->Data.Profile.cTicks / u64, STAMR3GetUnit(a_pNode->enmUnit),
     2529                        a_pNode->Data.Profile.cTicks / u64, a_pNode->pszUnit,
    25242530                        a_pNode->Data.Profile.cTicks, a_pNode->Data.Profile.cPeriods, a_pNode->Data.Profile.cTicksMax, a_pNode->Data.Profile.cTicksMin);
    25252531            break;
     
    25302536            RTStrPrintf(szBuf, sizeof(szBuf),
    25312537                        "%8u:%-8u %s",
    2532                         a_pNode->Data.RatioU32.u32A, a_pNode->Data.RatioU32.u32B, STAMR3GetUnit(a_pNode->enmUnit));
     2538                        a_pNode->Data.RatioU32.u32A, a_pNode->Data.RatioU32.u32B, a_pNode->pszUnit);
    25332539            break;
    25342540
     
    25362542            if (a_pNode->Data.pStr)
    25372543                a_rString += *a_pNode->Data.pStr;
    2538             RTStrPrintf(szBuf, sizeof(szBuf), " %s", STAMR3GetUnit(a_pNode->enmUnit));
     2544            RTStrPrintf(szBuf, sizeof(szBuf), " %s", a_pNode->pszUnit);
    25392545            break;
    25402546
    25412547        case STAMTYPE_U8:
    25422548        case STAMTYPE_U8_RESET:
    2543             RTStrPrintf(szBuf, sizeof(szBuf), "%8u %s", a_pNode->Data.u8, STAMR3GetUnit(a_pNode->enmUnit));
     2549            RTStrPrintf(szBuf, sizeof(szBuf), "%8u %s", a_pNode->Data.u8, a_pNode->pszUnit);
    25442550            break;
    25452551
    25462552        case STAMTYPE_X8:
    25472553        case STAMTYPE_X8_RESET:
    2548             RTStrPrintf(szBuf, sizeof(szBuf), "%8x %s", a_pNode->Data.u8, STAMR3GetUnit(a_pNode->enmUnit));
     2554            RTStrPrintf(szBuf, sizeof(szBuf), "%8x %s", a_pNode->Data.u8, a_pNode->pszUnit);
    25492555            break;
    25502556
    25512557        case STAMTYPE_U16:
    25522558        case STAMTYPE_U16_RESET:
    2553             RTStrPrintf(szBuf, sizeof(szBuf), "%8u %s", a_pNode->Data.u16, STAMR3GetUnit(a_pNode->enmUnit));
     2559            RTStrPrintf(szBuf, sizeof(szBuf), "%8u %s", a_pNode->Data.u16, a_pNode->pszUnit);
    25542560            break;
    25552561
    25562562        case STAMTYPE_X16:
    25572563        case STAMTYPE_X16_RESET:
    2558             RTStrPrintf(szBuf, sizeof(szBuf), "%8x %s", a_pNode->Data.u16, STAMR3GetUnit(a_pNode->enmUnit));
     2564            RTStrPrintf(szBuf, sizeof(szBuf), "%8x %s", a_pNode->Data.u16, a_pNode->pszUnit);
    25592565            break;
    25602566
    25612567        case STAMTYPE_U32:
    25622568        case STAMTYPE_U32_RESET:
    2563             RTStrPrintf(szBuf, sizeof(szBuf), "%8u %s", a_pNode->Data.u32, STAMR3GetUnit(a_pNode->enmUnit));
     2569            RTStrPrintf(szBuf, sizeof(szBuf), "%8u %s", a_pNode->Data.u32, a_pNode->pszUnit);
    25642570            break;
    25652571
    25662572        case STAMTYPE_X32:
    25672573        case STAMTYPE_X32_RESET:
    2568             RTStrPrintf(szBuf, sizeof(szBuf), "%8x %s", a_pNode->Data.u32, STAMR3GetUnit(a_pNode->enmUnit));
     2574            RTStrPrintf(szBuf, sizeof(szBuf), "%8x %s", a_pNode->Data.u32, a_pNode->pszUnit);
    25692575            break;
    25702576
    25712577        case STAMTYPE_U64:
    25722578        case STAMTYPE_U64_RESET:
    2573             RTStrPrintf(szBuf, sizeof(szBuf), "%8llu %s", a_pNode->Data.u64, STAMR3GetUnit(a_pNode->enmUnit));
     2579            RTStrPrintf(szBuf, sizeof(szBuf), "%8llu %s", a_pNode->Data.u64, a_pNode->pszUnit);
    25742580            break;
    25752581
    25762582        case STAMTYPE_X64:
    25772583        case STAMTYPE_X64_RESET:
    2578             RTStrPrintf(szBuf, sizeof(szBuf), "%8llx %s", a_pNode->Data.u64, STAMR3GetUnit(a_pNode->enmUnit));
     2584            RTStrPrintf(szBuf, sizeof(szBuf), "%8llx %s", a_pNode->Data.u64, a_pNode->pszUnit);
    25792585            break;
    25802586
    25812587        case STAMTYPE_BOOL:
    25822588        case STAMTYPE_BOOL_RESET:
    2583             RTStrPrintf(szBuf, sizeof(szBuf), "%s %s", a_pNode->Data.f ? "true    " : "false   ", STAMR3GetUnit(a_pNode->enmUnit));
     2589            RTStrPrintf(szBuf, sizeof(szBuf), "%s %s", a_pNode->Data.f ? "true    " : "false   ", a_pNode->pszUnit);
    25842590            break;
    25852591
     
    26782684
    26792685
    2680 VBoxDbgStatsModelVM::VBoxDbgStatsModelVM(VBoxDbgGui *a_pDbgGui, QString &a_rPatStr, QObject *a_pParent)
    2681     : VBoxDbgStatsModel(a_pParent), VBoxDbgBase(a_pDbgGui)
     2686VBoxDbgStatsModelVM::VBoxDbgStatsModelVM(VBoxDbgGui *a_pDbgGui, QString &a_rPatStr, QObject *a_pParent, PCVMMR3VTABLE pVMM)
     2687    : VBoxDbgStatsModel(a_pParent), VBoxDbgBase(a_pDbgGui), m_pVMM(pVMM)
    26822688{
    26832689    /*
     
    27222728/*static*/ DECLCALLBACK(int)
    27232729VBoxDbgStatsModelVM::createNewTreeCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
    2724                                            STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser)
     2730                                           const char *pszUnit, STAMVISIBILITY enmVisibility, const char *pszDesc, void *pvUser)
    27252731{
    27262732    PDBGGUISTATSNODE pRoot = (PDBGGUISTATSNODE)pvUser;
    27272733    Log3(("createNewTreeCallback: %s\n", pszName));
     2734    RT_NOREF(enmUnit);
    27282735
    27292736    /*
     
    27682775     * Save the data.
    27692776     */
    2770     return initNode(pNode, enmType, pvSample, enmUnit, pszDesc);
     2777    return initNode(pNode, enmType, pvSample, pszUnit, pszDesc);
    27712778}
    27722779
     
    32003207     * Create the tree view and setup the layout.
    32013208     */
    3202     VBoxDbgStatsModelVM *pModel = new VBoxDbgStatsModelVM(a_pDbgGui, m_PatStr, NULL);
     3209    VBoxDbgStatsModelVM *pModel = new VBoxDbgStatsModelVM(a_pDbgGui, m_PatStr, NULL, a_pDbgGui->getVMMFunctionTable());
    32033210    m_pView = new VBoxDbgStatsView(a_pDbgGui, pModel, this);
    32043211
  • trunk/src/VBox/Main/include/GuestImpl.h

    r93166 r93468  
    189189    void i_updateStats(uint64_t iTick);
    190190    static DECLCALLBACK(int) i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample,
    191                                                        STAMUNIT enmUnit, STAMVISIBILITY enmVisiblity,
     191                                                       STAMUNIT enmUnit, const char *pszUnit, STAMVISIBILITY enmVisiblity,
    192192                                                       const char *pszDesc, void *pvUser);
    193193
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r93444 r93468  
    219219/* static */
    220220DECLCALLBACK(int)  Guest::i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample,
    221                                                     STAMUNIT enmUnit, STAMVISIBILITY enmVisiblity,
     221                                                    STAMUNIT enmUnit, const char *pszUnit, STAMVISIBILITY enmVisiblity,
    222222                                                    const char *pszDesc, void *pvUser)
    223223{
    224     RT_NOREF(enmVisiblity, pszDesc);
     224    RT_NOREF(enmVisiblity, pszDesc, pszUnit);
    225225    AssertLogRelMsgReturn(enmType == STAMTYPE_COUNTER, ("Unexpected sample type %d ('%s')\n", enmType, pszName), VINF_SUCCESS);
    226226    AssertLogRelMsgReturn(enmUnit == STAMUNIT_BYTES, ("Unexpected sample unit %d ('%s')\n", enmUnit, pszName), VINF_SUCCESS);
  • trunk/src/VBox/VMM/VMMR3/STAM.cpp

    r93115 r93468  
    25932593{
    25942594    PSTAMR3ENUMONEARGS pArgs = (PSTAMR3ENUMONEARGS)pvArg;
     2595    const char *pszUnit = STAMR3GetUnit(pDesc->enmUnit);
    25952596    int rc;
    25962597    if (pDesc->enmType == STAMTYPE_CALLBACK)
     
    25992600        char szBuf[512];
    26002601        pDesc->u.Callback.pfnPrint(pArgs->pVM, pDesc->u.Callback.pvSample, szBuf, sizeof(szBuf));
    2601         rc = pArgs->pfnEnum(pDesc->pszName, pDesc->enmType, szBuf, pDesc->enmUnit,
     2602        rc = pArgs->pfnEnum(pDesc->pszName, pDesc->enmType, szBuf, pDesc->enmUnit, pszUnit,
    26022603                            pDesc->enmVisibility, pDesc->pszDesc, pArgs->pvUser);
    26032604    }
    26042605    else
    2605         rc = pArgs->pfnEnum(pDesc->pszName, pDesc->enmType, pDesc->u.pv, pDesc->enmUnit,
     2606        rc = pArgs->pfnEnum(pDesc->pszName, pDesc->enmType, pDesc->u.pv, pDesc->enmUnit, pszUnit,
    26062607                            pDesc->enmVisibility, pDesc->pszDesc, pArgs->pvUser);
    26072608    return rc;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette