VirtualBox

Changeset 20376 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jun 8, 2009 4:47:39 AM (16 years ago)
Author:
vboxsync
Message:

NAT: slirp performance counters

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/counters.h

    r20350 r20376  
    3737COUNTING_COUTER(UDP, "UDP sockets");
    3838COUNTING_COUTER(UDPHot, "UDP sockets active");
    39 COUNTING_COUTER(SBAlloc, "SB Alloc");
    40 COUNTING_COUTER(SBReAlloc, "SB ReAlloc");
    4139
    4240COUNTING_COUTER(IORead_in_1, "SB IORead_in_1");
     41COUNTING_COUTER(IORead_in_1_bytes, "SB IORead_in_1_bytes");
    4342COUNTING_COUTER(IORead_in_2, "SB IORead_in_2");
     43COUNTING_COUTER(IORead_in_2_1st_bytes, "SB IORead_in_2_1st_bytes");
     44COUNTING_COUTER(IORead_in_2_2nd_bytes, "SB IORead_in_2_2nd_bytes");
    4445COUNTING_COUTER(IOWrite_in_1, "SB IOWrite_in_1");
     46COUNTING_COUTER(IOWrite_in_1_bytes, "SB IOWrite_in_1_bytes");
    4547COUNTING_COUTER(IOWrite_in_2, "SB IOWrite_in_2");
     48COUNTING_COUTER(IOWrite_in_2_1st_bytes, "SB IOWrite_in_2_1st_bytes");
     49COUNTING_COUTER(IOWrite_in_2_2nd_bytes, "SB IOWrite_in_2_2nd_bytes");
     50COUNTING_COUTER(IOWrite_no_w, "SB IOWrite_no_w");
     51COUNTING_COUTER(IOWrite_rest, "SB IOWrite_rest");
     52COUNTING_COUTER(IOWrite_rest_bytes, "SB IOWrite_rest_bytes");
     53
     54COUNTING_COUTER(IOSBAppend, "SB: Append total");
     55COUNTING_COUTER(IOSBAppend_wa, "SB: Append all is written to network ");
     56COUNTING_COUTER(IOSBAppend_wf, "SB: Append nothing is written");
     57COUNTING_COUTER(IOSBAppend_wp, "SB: Append is written partly");
     58COUNTING_COUTER(IOSBAppend_zm, "SB: Append mbuf is zerro or less");
     59
     60COUNTING_COUTER(IOSBAppendSB, "SB: AppendSB total");
     61COUNTING_COUTER(IOSBAppendSB_w_l_r, "SB: AppendSB (sb_wptr < sb_rptr)");
     62COUNTING_COUTER(IOSBAppendSB_w_ge_r, "SB: AppendSB (sb_wptr >= sb_rptr)");
     63COUNTING_COUTER(IOSBAppendSB_w_alter, "SB: AppendSB (altering of sb_wptr)");
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r20350 r20376  
    858858    int i;
    859859
    860     STAM_PROFILE_START(&pData->StatFill, a);
     860    SLIRP_PROFILE_START(Fill, a);
    861861
    862862    nfds = *pnfds;
     
    889889    ICMP_ENGAGE_EVENT(&pData->icmp_socket, readfds);
    890890   
    891     STAM_COUNTER_RESET(&pData->StatTCP);
    892     STAM_COUNTER_RESET(&pData->StatTCPHot);
     891    SLIRP_COUNTER_RESET(TCP);
     892    SLIRP_COUNTER_RESET(TCPHot);
    893893   
    894894    QSOCKET_FOREACH(so, so_next, tcp)
     
    897897        so->so_poll_index = -1;
    898898#endif
    899         STAM_COUNTER_INC(&pData->StatTCP);
     899        SLIRP_COUNTER_INC(TCP);
    900900   
    901901        /*
     
    919919        if (so->so_state & SS_FACCEPTCONN)
    920920        {
    921             STAM_COUNTER_INC(&pData->StatTCPHot);
     921            SLIRP_COUNTER_INC(TCPHot);
    922922            TCP_ENGAGE_EVENT1(so, readfds);
    923923            CONTINUE(tcp);
     
    930930        {
    931931            Log2(("connecting %R[natsock] engaged\n",so));
    932             STAM_COUNTER_INC(&pData->StatTCPHot);
     932            SLIRP_COUNTER_INC(TCPHot);
    933933            TCP_ENGAGE_EVENT1(so, writefds);
    934934        }
     
    940940        if (CONN_CANFSEND(so) && so->so_rcv.sb_cc)
    941941        {
    942             STAM_COUNTER_INC(&pData->StatTCPHot);
     942            SLIRP_COUNTER_INC(TCPHot);
    943943            TCP_ENGAGE_EVENT1(so, writefds);
    944944        }
     
    950950        if (CONN_CANFRCV(so) && (so->so_snd.sb_cc < (so->so_snd.sb_datalen/2)))
    951951        {
    952             STAM_COUNTER_INC(&pData->StatTCPHot);
     952            SLIRP_COUNTER_INC(TCPHot);
    953953            TCP_ENGAGE_EVENT2(so, readfds, xfds);
    954954        }
     
    959959     * UDP sockets
    960960     */
    961     STAM_COUNTER_RESET(&pData->StatUDP);
    962     STAM_COUNTER_RESET(&pData->StatUDPHot);
     961    SLIRP_COUNTER_RESET(UDP);
     962    SLIRP_COUNTER_RESET(UDPHot);
    963963   
    964964    QSOCKET_FOREACH(so, so_next, udp)
    965965    /* { */
    966966   
    967         STAM_COUNTER_INC(&pData->StatUDP);
     967        SLIRP_COUNTER_INC(UDP);
    968968#if !defined(RT_OS_WINDOWS)
    969969        so->so_poll_index = -1;
     
    10071007        if ((so->so_state & SS_ISFCONNECTED) && so->so_queued <= 4)
    10081008        {
    1009             STAM_COUNTER_INC(&pData->StatUDPHot);
     1009            SLIRP_COUNTER_INC(UDPHot);
    10101010            UDP_ENGAGE_EVENT(so, readfds);
    10111011        }
     
    10211021#endif /* !RT_OS_WINDOWS */
    10221022
    1023     STAM_PROFILE_STOP(&pData->StatFill, a);
     1023    SLIRP_PROFILE_STOP(Fill, a);
    10241024}
    10251025
     
    10401040#endif
    10411041
    1042     STAM_PROFILE_START(&pData->StatPoll, a);
     1042    SLIRP_PROFILE_START(Poll, a);
    10431043
    10441044    /* Update time */
     
    10521052        if (time_fasttimo && ((curtime - time_fasttimo) >= 2))
    10531053        {
    1054             STAM_PROFILE_START(&pData->StatFastTimer, a);
     1054            SLIRP_PROFILE_START(FastTimer, a);
    10551055            tcp_fasttimo(pData);
    10561056            time_fasttimo = 0;
    1057             STAM_PROFILE_STOP(&pData->StatFastTimer, a);
     1057            SLIRP_PROFILE_STOP(FastTimer, a);
    10581058        }
    10591059        if (do_slowtimo && ((curtime - last_slowtimo) >= 499))
    10601060        {
    1061             STAM_PROFILE_START(&pData->StatSlowTimer, a);
     1061            SLIRP_PROFILE_START(SlowTimer, a);
    10621062            ip_slowtimo(pData);
    10631063            tcp_slowtimo(pData);
    10641064            last_slowtimo = curtime;
    1065             STAM_PROFILE_STOP(&pData->StatSlowTimer, a);
     1065            SLIRP_PROFILE_STOP(SlowTimer, a);
    10661066        }
    10671067    }
     
    14301430#endif
    14311431
    1432     STAM_PROFILE_STOP(&pData->StatPoll, a);
     1432    SLIRP_PROFILE_STOP(Poll, a);
    14331433}
    14341434
  • trunk/src/VBox/Devices/Network/slirp/slirp.h

    r20306 r20376  
    436436#endif /*VBOX_WITH_SLIRP_ALIAS*/
    437437
    438 #endif
     438#ifdef VBOX_WITH_STATISTICS
     439#define VBOX_SLIRP_COUNTER_OPER_ARG0(name, type, op) \
     440    STAM_##type##_##op(&pData->Stat##name)
     441#define VBOX_SLIRP_COUNTER_OPER_ARG1(name, type, op, arg) \
     442    STAM_##type##_##op(&pData->Stat##name, arg)
     443#else
     444#define VBOX_SLIRP_COUNTER_OPER_ARG0(name, type, op) do{}while(0)
     445#define VBOX_SLIRP_COUNTER_OPER_ARG1(name, type, op, arg) do{}while(0)
     446#endif
     447
     448#define SLIRP_PROFILE_START(name, arg) \
     449    VBOX_SLIRP_COUNTER_OPER_ARG1(name, PROFILE, START, arg)
     450#define SLIRP_PROFILE_STOP(name, arg)  \
     451    VBOX_SLIRP_COUNTER_OPER_ARG1(name, PROFILE, STOP, arg)
     452
     453#define SLIRP_COUNTER_RESET(name) \
     454    VBOX_SLIRP_COUNTER_OPER_ARG0(name, COUNTER, RESET)
     455
     456#define SLIRP_COUNTER_INC(name) \
     457    VBOX_SLIRP_COUNTER_OPER_ARG0(name, COUNTER, INC)
     458
     459#define SLIRP_COUNTER_ADD(name, val) \
     460    VBOX_SLIRP_COUNTER_OPER_ARG1(name, COUNTER, ADD, (val))
     461
     462#endif
Note: See TracChangeset for help on using the changeset viewer.

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