VirtualBox

Changeset 22449 in vbox for trunk/src


Ignore:
Timestamp:
Aug 26, 2009 5:37:36 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
51453
Message:

NAT: re-counters

Location:
trunk/src/VBox/Devices/Network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r22413 r22449  
    5252#include <iprt/req.h>
    5353
     54#define COUNTERS_INIT
     55#include "counters.h"
    5456
    5557/*******************************************************************************
     
    235237static DECLCALLBACK(void) drvNATRecvWorker(PDRVNAT pThis, uint8_t *pu8Buf, int cb)
    236238{
     239    STAM_PROFILE_START(&pThis->StatNATRecv, a);
    237240    if (RT_FAILURE(pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, RT_INDEFINITE_WAIT)))
    238241    {
    239242        AssertMsgFailed(("NAT: No RX available even on indefinite wait"));
    240243    }
     244    STAM_PROFILE_STOP(&pThis->StatNATRecvWait, a);
    241245    int rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb);
    242246    RTMemFree(pu8Buf);
     247    STAM_PROFILE_STOP(&pThis->StatNATRecv, a);
    243248    AssertRC(rc);
    244249}
  • trunk/src/VBox/Devices/Network/slirp/counters.h

    r22413 r22449  
    4747#  define DEREGISTER_COUNTER(name, storage) do {} while (0)
    4848# endif
     49#else
    4950# undef COUNTERS_INIT
    5051#endif
     
    118119#  ifdef SLIRP_SPLIT_CAN_OUTPUT
    119120DRV_COUNTING_COUNTER(NATRecvWakeups, "counting wakeups of NAT RX thread");
     121DRV_PROFILE_COUNTER(NATRecv,"Time spent in NATRecv worker");
     122DRV_PROFILE_COUNTER(NATRecvWait,"Time spent in NATRecv worker in waiting of free RX buffers");
    120123#  endif
    121124DRV_COUNTING_COUNTER(QueuePktSent, "counting packet sent via PDM Queue");       /**< counting packet sent via PDM queue */
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r22413 r22449  
    1616#endif
    1717#include <alias.h>
    18 #define COUNTERS_INIT
    19 #include "counters.h"
    2018
    2119#if !defined(RT_OS_WINDOWS)
     
    570568# define PROFILE_COUNTER(name, dsc)     REGISTER_COUNTER(name, pData, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc)
    571569# define COUNTING_COUNTER(name, dsc)    REGISTER_COUNTER(name, pData, STAMTYPE_COUNTER, STAMUNIT_COUNT,          dsc)
    572 
    573570# include "counters.h"
    574 
    575571# undef COUNTER
    576572/** @todo register statistics for the variables dumped by:
     
    588584# define PROFILE_COUNTER(name, dsc)     DEREGISTER_COUNTER(name, pData)
    589585# define COUNTING_COUNTER(name, dsc)    DEREGISTER_COUNTER(name, pData)
    590 
    591586# include "counters.h"
    592587#endif /* VBOX_WITH_STATISTICS */
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r22413 r22449  
    2323
    2424#include <iprt/req.h>
     25
     26#define COUNTERS_INIT
     27#include "counters.h"
     28
    2529#include "ip_icmp.h"
    2630#include "dnsproxy/dnsproxy.h"
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette