Changeset 22403 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Aug 24, 2009 7:12:48 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/counters.h
r22402 r22403 24 24 */ 25 25 26 #if !defined(PROFILE_COUNTER) && !defined(DRV_PROFILE_COUNTER) 27 # error (DRV_)PROFILE_COUNTER is not defied 26 /* 27 * COUNTERS_INIT is used before using counters.h to declare helping macro 28 * definitions for (de-)registering counters 29 */ 30 #ifndef COUNTERS_H 31 # define COUNTERS_H 32 # if defined(VBOX_WITH_STATISTICS) 33 # define REGISTER_COUNTER(name, type, units, dsc) \ 34 do { \ 35 PDMDrvHlpSTAMRegisterF(pDrvIns, \ 36 &pData->Stat ## name, \ 37 type, \ 38 STAMVISIBILITY_ALWAYS, \ 39 units, \ 40 dsc, \ 41 "/Drivers/NAT%u/" #name, \ 42 pDrvIns->iInstance); \ 43 } while (0) 44 # define DEREGISTER_COUNTER(name) PDMDrvHlpSTAMDeregister(pDrvIns, &pData->Stat ## name) 45 # else 46 # define REGISTER_COUNTER(name, type, units, dsc) do {} while (0) 47 # define DEREGISTER_COUNTER(name) do {} while (0) 48 # endif 28 49 #endif 29 #if !defined(COUNTING_COUNTER) && !defined(DRV_COUNTING_COUNTER) 30 # error (DRV_)COUNTING_COUNTER is not defined 31 #endif 50 51 #ifndef COUNTERS_INIT 52 # if !defined(PROFILE_COUNTER) && !defined(DRV_PROFILE_COUNTER) 53 # error (DRV_)PROFILE_COUNTER is not defied 54 # endif 55 # if !defined(COUNTING_COUNTER) && !defined(DRV_COUNTING_COUNTER) 56 # error (DRV_)COUNTING_COUNTER is not defined 57 # endif 32 58 33 59 /* 34 60 * DRV_ prefixed are counters used in DrvNAT the rest are used in Slirp 35 61 */ 36 # ifdef DRV_PROFILE_COUNTER37 # define PROFILE_COUNTER(name, dsc) do {} while (0)38 # endif39 # ifdef DRV_COUNTING_COUNTER40 # define COUNTING_COUNTER(name, dsc) do {} while (0)41 # endif62 # ifdef DRV_PROFILE_COUNTER 63 # define PROFILE_COUNTER(name, dsc) do {} while (0) 64 # endif 65 # ifdef DRV_COUNTING_COUNTER 66 # define COUNTING_COUNTER(name, dsc) do {} while (0) 67 # endif 42 68 43 # ifdef PROFILE_COUNTER44 # define DRV_PROFILE_COUNTER(name, dsc) do {} while (0)45 # endif46 # ifdef COUNTING_COUNTER47 # define DRV_COUNTING_COUNTER(name, dsc) do {} while (0)48 # endif69 # ifdef PROFILE_COUNTER 70 # define DRV_PROFILE_COUNTER(name, dsc) do {} while (0) 71 # endif 72 # ifdef COUNTING_COUNTER 73 # define DRV_COUNTING_COUNTER(name, dsc) do {} while (0) 74 # endif 49 75 50 76 PROFILE_COUNTER(Fill, "Profiling slirp fills"); … … 99 125 PROFILE_COUNTER(ALIAS_output, "ALIAS::output"); 100 126 101 # undef DRV_COUNTING_COUNTER102 # undef DRV_PROFILE_COUNTER127 # undef DRV_COUNTING_COUNTER 128 # undef DRV_PROFILE_COUNTER 103 129 104 #undef COUNTING_COUNTER 105 #undef PROFILE_COUNTER 130 # undef COUNTING_COUNTER 131 # undef PROFILE_COUNTER 132 #endif /*!COUNTERS_INIT*/ -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r22315 r22403 16 16 #endif 17 17 #include <alias.h> 18 #define COUNTERS_INIT 19 #include "counters.h" 18 20 19 21 #if !defined(RT_OS_WINDOWS) … … 566 568 { 567 569 #ifdef VBOX_WITH_STATISTICS 568 # define COUNTER(name, type, units, dsc) \ 569 do { \ 570 PDMDrvHlpSTAMRegisterF(pDrvIns, \ 571 &pData->Stat ## name, \ 572 type, \ 573 STAMVISIBILITY_ALWAYS, \ 574 units, \ 575 dsc, \ 576 "/Drivers/NAT%u/" #name, \ 577 pDrvIns->iInstance); \ 578 } while (0) 579 580 # define PROFILE_COUNTER(name, dsc) COUNTER(name, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc) 581 # define COUNTING_COUNTER(name, dsc) COUNTER(name, STAMTYPE_COUNTER, STAMUNIT_COUNT, dsc) 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) 582 572 583 573 # include "counters.h" … … 598 588 { 599 589 #ifdef VBOX_WITH_STATISTICS 600 # define PROFILE_COUNTER(name, dsc) PDMDrvHlpSTAMDeregister(pDrvIns, &pData->Stat ##name)601 # define COUNTING_COUNTER(name, dsc) PDMDrvHlpSTAMDeregister(pDrvIns, &pData->Stat ##name)590 # define PROFILE_COUNTER(name, dsc) DEREGISTER_COUNTER(name) 591 # define COUNTING_COUNTER(name, dsc) DEREGISTER_COUNTER(name) 602 592 603 593 # include "counters.h"
Note:
See TracChangeset
for help on using the changeset viewer.