Changeset 22406 in vbox
- Timestamp:
- Aug 24, 2009 9:03:22 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r22380 r22406 166 166 HANDLE hWakeupEvent; 167 167 #endif 168 STAMCOUNTER StatQueuePktSent; /**< counting packet sent via PDM queue */ 169 STAMCOUNTER StatQueuePktDropped; /**< counting packet drops by PDM queue */ 170 STAMCOUNTER StatConsumerFalse; /**< how often to wait for guest RX buffers */ 168 169 #define DRV_PROFILE_COUNTER(name, dsc) STAMPROFILE Stat ## name 170 #define DRV_COUNTING_COUNTER(name, dsc) STAMCOUNTER Stat ## name 171 #include "counters.h" 171 172 #ifdef SLIRP_SPLIT_CAN_OUTPUT 172 173 /** thread delivering packets for receiving by the guest */ … … 176 177 /** Receive Req queue (deliver packets to the guest) */ 177 178 PRTREQQUEUE pRecvReqQueue; 178 STAMCOUNTER StatNATRecvWakeups; /**< how often to wakeup the guest RX thread */179 179 #endif 180 180 } DRVNAT; … … 237 237 if (RT_FAILURE(pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, RT_INDEFINITE_WAIT))) 238 238 { 239 AssertMsgFailed(("N o RX available even on indefinite wait"));239 AssertMsgFailed(("NAT: No RX available even on indefinite wait")); 240 240 } 241 241 int rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb); … … 839 839 pThis->pNATState = NULL; 840 840 #ifdef VBOX_WITH_STATISTICS 841 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatQueuePktSent); 842 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatQueuePktDropped); 843 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatConsumerFalse); 841 # define DRV_PROFILE_COUNTER(name, dsc) DEREGISTER_COUNTER(name, pThis) 842 # define DRV_COUNTING_COUNTER(name, dsc) DEREGISTER_COUNTER(name, pThis) 843 # include "counters.h" 844 844 #endif 845 845 } … … 968 968 slirp_register_statistics(pThis->pNATState, pDrvIns); 969 969 #ifdef VBOX_WITH_STATISTICS 970 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktSent, STAMTYPE_COUNTER, 971 STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent viai " 972 "PDM queue", "/Drivers/NAT%u/QueuePacketSent", pDrvIns->iInstance); 973 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktDropped, STAMTYPE_COUNTER, 974 STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent via PDM" 975 " queue", "/Drivers/NAT%u/QueuePacketDropped", pDrvIns->iInstance); 976 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatConsumerFalse, STAMTYPE_COUNTER, 977 STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting PDM consumer false" 978 " queue", "/Drivers/NAT%u/PDMConsumerFalse", pDrvIns->iInstance); 979 # ifdef SLIRP_SPLIT_CAN_OUTPUT 980 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatNATRecvWakeups, STAMTYPE_COUNTER, 981 STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting wakeups of NATRX" 982 " thread", "/Drivers/NAT%u/NATRecvWakeups", pDrvIns->iInstance); 983 # endif 970 # define DRV_PROFILE_COUNTER(name, dsc) REGISTER_COUNTER(name, pThis, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc) 971 # define DRV_COUNTING_COUNTER(name, dsc) REGISTER_COUNTER(name, pThis, STAMTYPE_COUNTER, STAMUNIT_COUNT, dsc) 972 # include "counters.h" 984 973 #endif 985 974 -
trunk/src/VBox/Devices/Network/slirp/counters.h
r22404 r22406 31 31 # define COUNTERS_H 32 32 # if defined(VBOX_WITH_STATISTICS) 33 # define REGISTER_COUNTER(name, type, units, dsc)\33 # define REGISTER_COUNTER(name, storage, type, units, dsc) \ 34 34 do { \ 35 35 PDMDrvHlpSTAMRegisterF(pDrvIns, \ 36 & pData->Stat ## name,\36 &(storage)->Stat ## name, \ 37 37 type, \ 38 38 STAMVISIBILITY_ALWAYS, \ … … 42 42 pDrvIns->iInstance); \ 43 43 } while (0) 44 # define DEREGISTER_COUNTER(name ) PDMDrvHlpSTAMDeregister(pDrvIns, &pData->Stat ## name)44 # define DEREGISTER_COUNTER(name, storage) PDMDrvHlpSTAMDeregister(pDrvIns, &(storage)->Stat ## name) 45 45 # else 46 # define REGISTER_COUNTER(name, type, units, dsc) do {} while (0)47 # define DEREGISTER_COUNTER(name ) do {} while (0)46 # define REGISTER_COUNTER(name, storage, type, units, dsc) do {} while (0) 47 # define DEREGISTER_COUNTER(name, storage) do {} while (0) 48 48 # endif 49 49 # undef COUNTERS_INIT … … 61 61 * DRV_ prefixed are counters used in DrvNAT the rest are used in Slirp 62 62 */ 63 # ifdef DRV_PROFILE_COUNTER64 # define PROFILE_COUNTER(name, dsc) do {} while (0)65 # endif66 # ifdef DRV_COUNTING_COUNTER67 # define COUNTING_COUNTER(name, dsc) do {} while (0)68 # endif69 63 70 # ifdef PROFILE_COUNTER 71 # define DRV_PROFILE_COUNTER(name, dsc) do {} while (0) 72 # endif 73 # ifdef COUNTING_COUNTER 74 # define DRV_COUNTING_COUNTER(name, dsc) do {} while (0) 75 # endif 76 64 # if defined(PROFILE_COUNTER) || defined(COUNTING_COUNTER) 77 65 PROFILE_COUNTER(Fill, "Profiling slirp fills"); 78 66 PROFILE_COUNTER(Poll, "Profiling slirp polls"); … … 125 113 PROFILE_COUNTER(ALIAS_input, "ALIAS::input"); 126 114 PROFILE_COUNTER(ALIAS_output, "ALIAS::output"); 115 116 # else 117 /*DrvNAT.cpp*/ 118 # ifdef SLIRP_SPLIT_CAN_OUTPUT 119 DRV_COUNTING_COUNTER(NATRecvWakeups, "counting wakeups of NAT RX thread"); 120 # endif 121 DRV_COUNTING_COUNTER(QueuePktSent, "counting packet sent via PDM Queue"); /**< counting packet sent via PDM queue */ 122 DRV_COUNTING_COUNTER(QueuePktDropped, "counting packet drops by PDM Queue"); /**< counting packet drops by PDM queue */ 123 DRV_COUNTING_COUNTER(ConsumerFalse, "counting consumer's reject number to process the queue's item"); /**< how often to wait for guest RX buffers */ 124 # endif 127 125 #endif /*!COUNTERS_INIT*/ 128 126 -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r22404 r22406 568 568 { 569 569 #ifdef VBOX_WITH_STATISTICS 570 # define PROFILE_COUNTER(name, dsc) REGISTER_COUNTER(name, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc)571 # define COUNTING_COUNTER(name, dsc) REGISTER_COUNTER(name, STAMTYPE_COUNTER, STAMUNIT_COUNT, dsc)570 # define PROFILE_COUNTER(name, dsc) REGISTER_COUNTER(name, pData, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc) 571 # define COUNTING_COUNTER(name, dsc) REGISTER_COUNTER(name, pData, STAMTYPE_COUNTER, STAMUNIT_COUNT, dsc) 572 572 573 573 # include "counters.h" … … 586 586 { 587 587 #ifdef VBOX_WITH_STATISTICS 588 # define PROFILE_COUNTER(name, dsc) DEREGISTER_COUNTER(name )589 # define COUNTING_COUNTER(name, dsc) DEREGISTER_COUNTER(name )588 # define PROFILE_COUNTER(name, dsc) DEREGISTER_COUNTER(name, pData) 589 # define COUNTING_COUNTER(name, dsc) DEREGISTER_COUNTER(name, pData) 590 590 591 591 # include "counters.h"
Note:
See TracChangeset
for help on using the changeset viewer.