Changeset 20713 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Jun 19, 2009 11:43:01 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r20712 r20713 36 36 #include <iprt/cidr.h> 37 37 #include <iprt/stream.h> 38 39 #include "slirp/statistics.h"40 38 41 39 #include "Builtins.h" … … 115 113 HANDLE hWakeupEvent; 116 114 #endif 115 STAMCOUNTER StatQueuePktSent; /**< counting packet sent via PDM queue */ 116 STAMCOUNTER StatQueuePktDropped; /**< counting packet drops by PDM queue */ 117 117 } DRVNAT; 118 118 /** Pointer the NAT driver instance data. */ … … 497 497 Log2(("slirp_output: pu8Buf=%p cb=%#x (pThis=%p)\n%.*Rhxd\n", pu8Buf, cb, pThis, cb, pu8Buf)); 498 498 499 STAM_COUNTER_RESET( DRVNAT_STAT(pThis, DrvNAT_package_drop, STAMCOUNTER));500 STAM_COUNTER_RESET( DRVNAT_STAT(pThis, DrvNAT_package_sent, STAMCOUNTER));499 STAM_COUNTER_RESET(&pThis->StatQueuePktDropped); 500 STAM_COUNTER_RESET(&pThis->StatQueuePktSent); 501 501 Assert(pThis); 502 502 … … 509 509 Log2(("pItem:%p %.Rhxd\n", pItem, pItem->pu8Buf)); 510 510 PDMQueueInsert(pThis->pSendQueue, &pItem->Core); 511 STAM_COUNTER_INC( DRVNAT_STAT(pThis, DrvNAT_package_sent, STAMCOUNTER));511 STAM_COUNTER_INC(&pThis->StatQueuePktSent); 512 512 return; 513 513 } … … 517 517 else 518 518 { 519 LogRel(("NAT: %d messages suppressed about dropping pack age(couldn't allocate queue item)\n", s_cDroppedPackets));519 LogRel(("NAT: %d messages suppressed about dropping packet (couldn't allocate queue item)\n", s_cDroppedPackets)); 520 520 s_cDroppedPackets = 0; 521 521 } 522 STAM_COUNTER_INC( DRVNAT_STAT(pThis, DrvNAT_package_drop, STAMCOUNTER));522 STAM_COUNTER_INC(&pThis->StatQueuePktDropped); 523 523 RTMemFree((void *)pu8Buf); 524 524 } … … 603 603 slirp_deregister_statistics(pThis->pNATState, pDrvIns); 604 604 pThis->pNATState = NULL; 605 #ifdef VBOX_WITH_STATISTICS 606 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatQueuePktSent); 607 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatQueuePktDropped); 608 #endif 605 609 } 606 610 … … 833 837 #endif 834 838 #define SLIRP_SET_TUNING_VALUE(name, setter) \ 835 do \ 836 { \ 837 int len = 0; \ 838 rc = CFGMR3QueryS32(pCfgHandle, name, &len); \ 839 if (RT_SUCCESS(rc)) \ 840 setter(pThis->pNATState, len); \ 841 }while(0) 839 do \ 840 { \ 841 int len = 0; \ 842 rc = CFGMR3QueryS32(pCfgHandle, name, &len); \ 843 if (RT_SUCCESS(rc)) \ 844 setter(pThis->pNATState, len); \ 845 } while(0) 846 842 847 SLIRP_SET_TUNING_VALUE("SocketRcvBuf", slirp_set_rcvbuf); 843 848 SLIRP_SET_TUNING_VALUE("SocketSndBuf", slirp_set_sndbuf); … … 846 851 847 852 slirp_register_statistics(pThis->pNATState, pDrvIns); 853 #ifdef VBOX_WITH_STATISTICS 854 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktSent, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent via PDM queue", "/Drivers/NAT%u/QueuePacketSent", pDrvIns->iInstance); 855 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktDropped, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent via PDM queue", "/Drivers/NAT%u/QueuePacketDropped", pDrvIns->iInstance); 856 #endif 857 848 858 int rc2 = drvNATConstructRedir(pDrvIns->iInstance, pThis, pCfgHandle, Network); 849 859 if (RT_SUCCESS(rc2)) -
trunk/src/VBox/Devices/Network/slirp/counters.h
r20712 r20713 75 75 PROFILE_COUNTER(TCP_input, "TCP::input"); 76 76 77 COUNTING_COUNTER(DrvNAT_package_sent, "counting package sent via PDM queue");78 COUNTING_COUNTER(DrvNAT_package_drop, "counting package drops by PDM queue");79 -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r20712 r20713 20 20 #ifdef VBOX_WITH_SLIRP_ALIAS 21 21 # include <alias.h> 22 #endif23 24 #ifdef VBOX_WITH_STATISTICS25 # include "statistics.h"26 22 #endif 27 23 … … 715 711 } 716 712 717 /* instantiate the variables. */718 #ifdef VBOX_WITH_STATISTICS719 # define COUNTING_COUNTER(name, desc) DECLHIDDEN(uint32_t) g_offSlirpStat##name720 # define PROFILE_COUNTER(name, desc) DECLHIDDEN(uint32_t) g_offSlirpStat##name721 # include "counters.h"722 # undef COUNTING_COUNTER723 # undef PROFILE_COUNTER724 #endif725 726 713 /** 727 714 * Register statistics. … … 732 719 # define COUNTER(name, type, units, dsc) \ 733 720 do { \ 734 ASMAtomicUoWriteU32(&g_offSlirpStat##name, \735 RT_UOFFSETOF(NATState, Stat##name)); \736 721 PDMDrvHlpSTAMRegisterF(pDrvIns, \ 737 722 &pData->Stat ## name, \ … … 740 725 units, \ 741 726 dsc, \ 742 "/Drivers/NAT%u/ Stat" #name,\727 "/Drivers/NAT%u/" #name, \ 743 728 pDrvIns->iInstance); \ 744 729 } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.