Changeset 20454 in vbox
- Timestamp:
- Jun 10, 2009 3:59:34 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r20387 r20454 54 54 */ 55 55 #define VBOX_NAT_DELAY_HACK 56 57 56 #ifdef VBOX_WITH_STATISTICS 57 # define COUNTING_COUTER(name, dsc) \ 58 extern "C" void slirp_counting_counter_##name##_reset(PNATState pData); \ 59 extern "C" void slirp_counting_counter_##name##_inc(PNATState pData); \ 60 extern "C" void slirp_counting_counter_##name##_add(PNATState pData, int val); 61 /* @todo think abaout it */ 62 # define PROFILE_COUNTER(name, dsc) 63 # include "Network/slirp/counters.h" 64 # undef COUNTING_COUTER 65 # undef PROFILE_COUNTER 66 # define DRVNAT_COUNTER_RESET(pData, name) \ 67 slirp_counting_counter_##name##_reset(pData) 68 # define DRVNAT_COUNTER_INC(pData, name) \ 69 slirp_counting_counter_##name##_inc(pData) 70 # define DRVNAT_COUNTER_ADD(pData, name, val) \ 71 slirp_counting_counter_##name##_add(pData, (val)) 72 #else 73 #define DRVNAT_COUNTER_RESET(name) do{}while(0) 74 #define DRVNAT_COUNTER_INC(name) do{}while(0) 75 #define DRVNAT_COUNTER_ADD(name) do{}while(0) 76 #endif 58 77 /******************************************************************************* 59 78 * Structures and Typedefs * … … 475 494 Log2(("slirp_output: pu8Buf=%p cb=%#x (pThis=%p)\n%.*Rhxd\n", pu8Buf, cb, pThis, cb, pu8Buf)); 476 495 496 DRVNAT_COUNTER_RESET(pThis->pNATState, DrvNAT_package_drop); 497 DRVNAT_COUNTER_RESET(pThis->pNATState, DrvNAT_package_sent); 477 498 Assert(pThis); 478 499 … … 485 506 Log2(("pItem:%p %.Rhxd\n", pItem, pItem->pu8Buf)); 486 507 PDMQueueInsert(pThis->pSendQueue, &pItem->Core); 508 DRVNAT_COUNTER_INC(pThis->pNATState, DrvNAT_package_sent); 487 509 return; 488 510 } … … 497 519 cDroppedPackets = 0; 498 520 } 521 DRVNAT_COUNTER_INC(pThis->pNATState, DrvNAT_package_drop); 499 522 RTMemFree((void *)pu8Buf); 500 523 } -
trunk/src/VBox/Devices/Network/slirp/counters.h
r20453 r20454 69 69 PROFILE_COUNTER(TCP_reassamble, "TCP::reasamble"); 70 70 PROFILE_COUNTER(TCP_input, "TCP::input"); 71 72 COUNTING_COUTER(DrvNAT_package_sent, "counting package sent via PDM queue"); 73 COUNTING_COUTER(DrvNAT_package_drop, "counting package drops by PDM queue"); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r20424 r20454 1888 1888 tcp_sndspace = kilobytes * _1K; 1889 1889 } 1890 1891 1892 #define COUNTING_COUTER(name, dsc) \ 1893 void slirp_counting_counter_##name##_reset(PNATState pData) \ 1894 { \ 1895 SLIRP_COUNTER_RESET(name); \ 1896 } \ 1897 void slirp_counting_counter_##name##_inc(PNATState pData) \ 1898 { \ 1899 SLIRP_COUNTER_INC(name); \ 1900 } \ 1901 void slirp_counting_counter_##name##_add(PNATState pData,int val) \ 1902 { \ 1903 SLIRP_COUNTER_ADD(name, val); \ 1904 } 1905 /* @todo think abaout it */ 1906 #define PROFILE_COUNTER(name, dsc) 1907 #include "counters.h" 1908 #undef COUNTING_COUTER 1909 #undef PROFILE_COUNTER 1910
Note:
See TracChangeset
for help on using the changeset viewer.