VirtualBox

Changeset 82129 in vbox


Ignore:
Timestamp:
Nov 23, 2019 5:28:03 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134939
Message:

Devices/Network: Don't decorate the public stats with device, just use the main adapter number. Moved to different sub-folder to avoid confusion.

Location:
trunk/src/VBox/Devices/Network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r81727 r82129  
    77317731                                  "EthernetCRC|"
    77327732                                  "GSOEnabled|"
    7733                                   "LinkUpDelay", "");
     7733                                  "LinkUpDelay|"
     7734                                  "StatNo",
     7735                                  "");
    77347736
    77357737    /** @todo LineSpeed unused! */
     
    77887790        LogRel(("%s: WARNING! Link up delay is disabled!\n", pThis->szPrf));
    77897791
     7792    uint32_t uStatNo = iInstance;
     7793    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "StatNo", &uStatNo, iInstance);
     7794    if (RT_FAILURE(rc))
     7795        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to get the \"StatNo\" value"));
     7796
    77907797    LogRel(("%s: Chip=%s LinkUpDelay=%ums EthernetCRC=%s GSO=%s Itr=%s ItrRx=%s TID=%s R0=%s RC=%s\n", pThis->szPrf,
    77917798            g_aChips[pThis->eChip].pcszName, pThis->cMsLinkUpDelay,
     
    79687975    /*
    79697976     * Register statistics.
     7977     * The /Public/ bits are official and used by session info in the GUI.
    79707978     */
    7971     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",            "/Public/Net/E1k%u/BytesReceived", iInstance);
    7972     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data transmitted",         "/Public/Net/E1k%u/BytesTransmitted", iInstance);
    7973 
    7974     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",            "ReceiveBytes");
    7975     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data transmitted",         "TransmitBytes");
     7979    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     7980                           "Amount of data received",    "/Public/NetAdapter/%u/BytesReceived", uStatNo);
     7981    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     7982                           "Amount of data transmitted", "/Public/NetAdapter/%u/BytesTransmitted", uStatNo);
     7983    PDMDevHlpSTAMRegisterF(pDevIns, &pDevIns->iInstance,       STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,
     7984                           "Device instance number",     "/Public/NetAdapter/%u/%s", uStatNo, pDevIns->pReg->szName);
     7985
     7986    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, "ReceiveBytes",         STAMUNIT_BYTES,          "Amount of data received");
     7987    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTransmitBytes,      STAMTYPE_COUNTER, "TransmitBytes",        STAMUNIT_BYTES,          "Amount of data transmitted");
    79767988
    79777989#if defined(VBOX_WITH_STATISTICS)
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r82128 r82129  
    51245124     */
    51255125    PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns,
    5126                                   "MAC|CableConnected|Am79C973|ChipType|Port|IRQ|LineSpeed|PrivIfEnabled|LinkUpDelay",
     5126                                  "MAC|CableConnected|Am79C973|ChipType|Port|IRQ|LineSpeed|PrivIfEnabled|LinkUpDelay|StatNo",
    51275127                                  "");
    51285128    /*
     
    51985198    Log(("#%d Link up delay is set to %u seconds\n", iInstance, pThis->cMsLinkUpDelay / 1000));
    51995199
     5200    uint32_t uStatNo = iInstance;
     5201    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "StatNo", &uStatNo, iInstance);
     5202    if (RT_FAILURE(rc))
     5203        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to get the \"StatNo\" value"));
    52005204
    52015205    /*
     
    54265430    /*
    54275431     * Register statistics.
     5432     * The /Public/ bits are official and used by session info in the GUI.
    54285433     */
    54295434    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
    5430                            "Amount of data received",     "/Public/Net/PCnet%u/BytesReceived", iInstance);
     5435                           "Amount of data received",     "/Public/NetAdapter/%u/BytesReceived", uStatNo);
    54315436    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes,     STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
    5432                            "Amount of data transmitted",  "/Public/Net/PCnet%u/BytesTransmitted", iInstance);
     5437                           "Amount of data transmitted",  "/Public/NetAdapter/%u/BytesTransmitted", uStatNo);
     5438    PDMDevHlpSTAMRegisterF(pDevIns, &pDevIns->iInstance,           STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,
     5439                           "Device instance number",      "/Public/NetAdapter/%u/%s", uStatNo, pDevIns->pReg->szName);
    54335440
    54345441    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, "ReceiveBytes",       STAMUNIT_BYTES,               "Amount of data received");
  • trunk/src/VBox/Devices/Network/DevVirtioNet.cpp

    r81731 r82129  
    21892189     * Validate configuration.
    21902190     */
    2191     PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "MAC|CableConnected|LineSpeed|LinkUpDelay", "");
     2191    PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "MAC|CableConnected|LineSpeed|LinkUpDelay|StatNo", "");
    21922192
    21932193    /* Get config params */
     
    21952195    if (RT_FAILURE(rc))
    21962196        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to get MAC address"));
     2197
    21972198    rc = pHlp->pfnCFGMQueryBool(pCfg, "CableConnected", &pThis->fCableConnected);
    21982199    if (RT_FAILURE(rc))
    21992200        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to get the value of 'CableConnected'"));
     2201
    22002202    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "LinkUpDelay", &pThis->cMsLinkUpDelay, 5000); /* ms */
    22012203    if (RT_FAILURE(rc))
     
    22062208    Log(("%s Link up delay is set to %u seconds\n", INSTANCE(pThis), pThis->cMsLinkUpDelay / 1000));
    22072209
     2210    uint32_t uStatNo = iInstance;
     2211    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "StatNo", &uStatNo, iInstance);
     2212    if (RT_FAILURE(rc))
     2213        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to get the \"StatNo\" value"));
     2214
    22082215    vnetPrintFeatures(pThis, vnetIoCb_GetHostFeatures(&pThis->VPCI), "Device supports the following features");
    22092216
     
    22742281    /*
    22752282     * Statistics and debug stuff.
     2283     * The /Public/ bits are official and used by session info in the GUI.
    22762284     */
    2277     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",            "/Public/Net/VNet%u/BytesReceived", iInstance);
    2278     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data transmitted",         "/Public/Net/VNet%u/BytesTransmitted", iInstance);
     2285    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     2286                           "Amount of data received",    "/Public/NetAdapter/%u/BytesReceived", uStatNo);
     2287    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     2288                           "Amount of data transmitted", "/Public/NetAdapter/%u/BytesTransmitted", uStatNo);
     2289    PDMDevHlpSTAMRegisterF(pDevIns, &pDevIns->iInstance,       STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,
     2290                           "Device instance number",     "/Public/NetAdapter/%u/%s", uStatNo, pDevIns->pReg->szName);
    22792291
    22802292    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatReceiveBytes,        STAMTYPE_COUNTER, "ReceiveBytes",           STAMUNIT_BYTES,          "Amount of data received");
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