VirtualBox

Changeset 107317 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Dec 13, 2024 1:21:33 PM (5 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166348
Message:

UsbNet: bugref:10779 Public statistics, also added missing PDMUsbHlpSTAMRegisterF to pdmusb.h

File:
1 edited

Legend:

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

    r107312 r107317  
    416416    PVUSBURB                            pResetUrb;
    417417
     418    STAMCOUNTER                         StatReceiveBytes;
     419    STAMCOUNTER                         StatTransmitBytes;
     420
    418421    /**
    419422     * LUN\#0 data.
     
    13221325    pUrb->cbData = (uint32_t)(sizeof(*pNth16) + sizeof(*pNdp16) + cb);
    13231326    usbNetLinkDone(pThis, pUrb);
     1327    STAM_REL_COUNTER_ADD(&pThis->StatReceiveBytes, cb);
    13241328    RTCritSectLeave(&pThis->CritSect);
    13251329
     
    16101614                    if (RT_FAILURE(rc))
    16111615                        return usbNetCompleteStall(pThis, NULL, pUrb, "SendBuf failed");
     1616                    STAM_REL_COUNTER_ADD(&pThis->StatTransmitBytes, pDGram->wDatagramLength);
    16121617                }
    16131618                else
     
    22012206                                     "MAC|"
    22022207                                     "CableConnected|"
    2203                                      "LinkUpDelay|"
     2208                                     "LinkUpDelay"
    22042209                                     , "Config", "UsbNet", iInstance);
    22052210    if (RT_FAILURE(rc))
     
    22862291            AssertFailedReturn(VERR_INVALID_PARAMETER);
    22872292    }
     2293
     2294    /*
     2295     * Register statistics.
     2296     * The /Public/ bits are official and used by session info in the GUI.
     2297     */
     2298    PDMUsbHlpSTAMRegisterF(pUsbIns, &pThis->StatReceiveBytes,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     2299                           "Amount of data received",    "/Public/NetAdapter/%u/BytesReceived", iInstance);
     2300    PDMUsbHlpSTAMRegisterF(pUsbIns, &pThis->StatTransmitBytes, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
     2301                           "Amount of data transmitted", "/Public/NetAdapter/%u/BytesTransmitted", iInstance);
     2302    PDMUsbHlpSTAMRegisterF(pUsbIns, &pUsbIns->iInstance,       STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,
     2303                           "Device instance number",     "/Public/NetAdapter/%u/%s", iInstance, pUsbIns->pReg->szName);
    22882304
    22892305    return VINF_SUCCESS;
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