Changeset 107317 in vbox
- Timestamp:
- Dec 13, 2024 1:21:33 PM (5 weeks ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmusb.h
r107276 r107317 1436 1436 } 1437 1437 1438 /** 1439 * Same as pfnSTAMRegister except that the name is specified in a 1440 * RTStrPrintf like fashion. 1441 * 1442 * @param pDevIns Device instance of the DMA. 1443 * @param pvSample Pointer to the sample. 1444 * @param enmType Sample type. This indicates what pvSample is 1445 * pointing at. 1446 * @param enmVisibility Visibility type specifying whether unused 1447 * statistics should be visible or not. 1448 * @param enmUnit Sample unit. 1449 * @param pszDesc Sample description. 1450 * @param pszName Sample name format string, unix path style. If 1451 * this does not start with a '/', the default 1452 * prefix will be prepended, otherwise it will be 1453 * used as-is. 1454 * @param ... Arguments to the format string. 1455 */ 1456 DECLINLINE(void) RT_IPRT_FORMAT_ATTR(7, 8) PDMUsbHlpSTAMRegisterF(PPDMUSBINS pUsbIns, void *pvSample, STAMTYPE enmType, 1457 STAMVISIBILITY enmVisibility, STAMUNIT enmUnit, 1458 const char *pszDesc, const char *pszName, ...) 1459 { 1460 va_list va; 1461 va_start(va, pszName); 1462 pUsbIns->pHlpR3->pfnSTAMRegisterV(pUsbIns, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, va); 1463 va_end(va); 1464 } 1465 1438 1466 #endif /* IN_RING3 */ 1439 1467 -
trunk/src/VBox/Devices/Network/UsbNet.cpp
r107312 r107317 416 416 PVUSBURB pResetUrb; 417 417 418 STAMCOUNTER StatReceiveBytes; 419 STAMCOUNTER StatTransmitBytes; 420 418 421 /** 419 422 * LUN\#0 data. … … 1322 1325 pUrb->cbData = (uint32_t)(sizeof(*pNth16) + sizeof(*pNdp16) + cb); 1323 1326 usbNetLinkDone(pThis, pUrb); 1327 STAM_REL_COUNTER_ADD(&pThis->StatReceiveBytes, cb); 1324 1328 RTCritSectLeave(&pThis->CritSect); 1325 1329 … … 1610 1614 if (RT_FAILURE(rc)) 1611 1615 return usbNetCompleteStall(pThis, NULL, pUrb, "SendBuf failed"); 1616 STAM_REL_COUNTER_ADD(&pThis->StatTransmitBytes, pDGram->wDatagramLength); 1612 1617 } 1613 1618 else … … 2201 2206 "MAC|" 2202 2207 "CableConnected|" 2203 "LinkUpDelay |"2208 "LinkUpDelay" 2204 2209 , "Config", "UsbNet", iInstance); 2205 2210 if (RT_FAILURE(rc)) … … 2286 2291 AssertFailedReturn(VERR_INVALID_PARAMETER); 2287 2292 } 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); 2288 2304 2289 2305 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.