Changeset 20376 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Jun 8, 2009 4:47:39 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/counters.h
r20350 r20376 37 37 COUNTING_COUTER(UDP, "UDP sockets"); 38 38 COUNTING_COUTER(UDPHot, "UDP sockets active"); 39 COUNTING_COUTER(SBAlloc, "SB Alloc");40 COUNTING_COUTER(SBReAlloc, "SB ReAlloc");41 39 42 40 COUNTING_COUTER(IORead_in_1, "SB IORead_in_1"); 41 COUNTING_COUTER(IORead_in_1_bytes, "SB IORead_in_1_bytes"); 43 42 COUNTING_COUTER(IORead_in_2, "SB IORead_in_2"); 43 COUNTING_COUTER(IORead_in_2_1st_bytes, "SB IORead_in_2_1st_bytes"); 44 COUNTING_COUTER(IORead_in_2_2nd_bytes, "SB IORead_in_2_2nd_bytes"); 44 45 COUNTING_COUTER(IOWrite_in_1, "SB IOWrite_in_1"); 46 COUNTING_COUTER(IOWrite_in_1_bytes, "SB IOWrite_in_1_bytes"); 45 47 COUNTING_COUTER(IOWrite_in_2, "SB IOWrite_in_2"); 48 COUNTING_COUTER(IOWrite_in_2_1st_bytes, "SB IOWrite_in_2_1st_bytes"); 49 COUNTING_COUTER(IOWrite_in_2_2nd_bytes, "SB IOWrite_in_2_2nd_bytes"); 50 COUNTING_COUTER(IOWrite_no_w, "SB IOWrite_no_w"); 51 COUNTING_COUTER(IOWrite_rest, "SB IOWrite_rest"); 52 COUNTING_COUTER(IOWrite_rest_bytes, "SB IOWrite_rest_bytes"); 53 54 COUNTING_COUTER(IOSBAppend, "SB: Append total"); 55 COUNTING_COUTER(IOSBAppend_wa, "SB: Append all is written to network "); 56 COUNTING_COUTER(IOSBAppend_wf, "SB: Append nothing is written"); 57 COUNTING_COUTER(IOSBAppend_wp, "SB: Append is written partly"); 58 COUNTING_COUTER(IOSBAppend_zm, "SB: Append mbuf is zerro or less"); 59 60 COUNTING_COUTER(IOSBAppendSB, "SB: AppendSB total"); 61 COUNTING_COUTER(IOSBAppendSB_w_l_r, "SB: AppendSB (sb_wptr < sb_rptr)"); 62 COUNTING_COUTER(IOSBAppendSB_w_ge_r, "SB: AppendSB (sb_wptr >= sb_rptr)"); 63 COUNTING_COUTER(IOSBAppendSB_w_alter, "SB: AppendSB (altering of sb_wptr)"); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r20350 r20376 858 858 int i; 859 859 860 S TAM_PROFILE_START(&pData->StatFill, a);860 SLIRP_PROFILE_START(Fill, a); 861 861 862 862 nfds = *pnfds; … … 889 889 ICMP_ENGAGE_EVENT(&pData->icmp_socket, readfds); 890 890 891 S TAM_COUNTER_RESET(&pData->StatTCP);892 S TAM_COUNTER_RESET(&pData->StatTCPHot);891 SLIRP_COUNTER_RESET(TCP); 892 SLIRP_COUNTER_RESET(TCPHot); 893 893 894 894 QSOCKET_FOREACH(so, so_next, tcp) … … 897 897 so->so_poll_index = -1; 898 898 #endif 899 S TAM_COUNTER_INC(&pData->StatTCP);899 SLIRP_COUNTER_INC(TCP); 900 900 901 901 /* … … 919 919 if (so->so_state & SS_FACCEPTCONN) 920 920 { 921 S TAM_COUNTER_INC(&pData->StatTCPHot);921 SLIRP_COUNTER_INC(TCPHot); 922 922 TCP_ENGAGE_EVENT1(so, readfds); 923 923 CONTINUE(tcp); … … 930 930 { 931 931 Log2(("connecting %R[natsock] engaged\n",so)); 932 S TAM_COUNTER_INC(&pData->StatTCPHot);932 SLIRP_COUNTER_INC(TCPHot); 933 933 TCP_ENGAGE_EVENT1(so, writefds); 934 934 } … … 940 940 if (CONN_CANFSEND(so) && so->so_rcv.sb_cc) 941 941 { 942 S TAM_COUNTER_INC(&pData->StatTCPHot);942 SLIRP_COUNTER_INC(TCPHot); 943 943 TCP_ENGAGE_EVENT1(so, writefds); 944 944 } … … 950 950 if (CONN_CANFRCV(so) && (so->so_snd.sb_cc < (so->so_snd.sb_datalen/2))) 951 951 { 952 S TAM_COUNTER_INC(&pData->StatTCPHot);952 SLIRP_COUNTER_INC(TCPHot); 953 953 TCP_ENGAGE_EVENT2(so, readfds, xfds); 954 954 } … … 959 959 * UDP sockets 960 960 */ 961 S TAM_COUNTER_RESET(&pData->StatUDP);962 S TAM_COUNTER_RESET(&pData->StatUDPHot);961 SLIRP_COUNTER_RESET(UDP); 962 SLIRP_COUNTER_RESET(UDPHot); 963 963 964 964 QSOCKET_FOREACH(so, so_next, udp) 965 965 /* { */ 966 966 967 S TAM_COUNTER_INC(&pData->StatUDP);967 SLIRP_COUNTER_INC(UDP); 968 968 #if !defined(RT_OS_WINDOWS) 969 969 so->so_poll_index = -1; … … 1007 1007 if ((so->so_state & SS_ISFCONNECTED) && so->so_queued <= 4) 1008 1008 { 1009 S TAM_COUNTER_INC(&pData->StatUDPHot);1009 SLIRP_COUNTER_INC(UDPHot); 1010 1010 UDP_ENGAGE_EVENT(so, readfds); 1011 1011 } … … 1021 1021 #endif /* !RT_OS_WINDOWS */ 1022 1022 1023 S TAM_PROFILE_STOP(&pData->StatFill, a);1023 SLIRP_PROFILE_STOP(Fill, a); 1024 1024 } 1025 1025 … … 1040 1040 #endif 1041 1041 1042 S TAM_PROFILE_START(&pData->StatPoll, a);1042 SLIRP_PROFILE_START(Poll, a); 1043 1043 1044 1044 /* Update time */ … … 1052 1052 if (time_fasttimo && ((curtime - time_fasttimo) >= 2)) 1053 1053 { 1054 S TAM_PROFILE_START(&pData->StatFastTimer, a);1054 SLIRP_PROFILE_START(FastTimer, a); 1055 1055 tcp_fasttimo(pData); 1056 1056 time_fasttimo = 0; 1057 S TAM_PROFILE_STOP(&pData->StatFastTimer, a);1057 SLIRP_PROFILE_STOP(FastTimer, a); 1058 1058 } 1059 1059 if (do_slowtimo && ((curtime - last_slowtimo) >= 499)) 1060 1060 { 1061 S TAM_PROFILE_START(&pData->StatSlowTimer, a);1061 SLIRP_PROFILE_START(SlowTimer, a); 1062 1062 ip_slowtimo(pData); 1063 1063 tcp_slowtimo(pData); 1064 1064 last_slowtimo = curtime; 1065 S TAM_PROFILE_STOP(&pData->StatSlowTimer, a);1065 SLIRP_PROFILE_STOP(SlowTimer, a); 1066 1066 } 1067 1067 } … … 1430 1430 #endif 1431 1431 1432 S TAM_PROFILE_STOP(&pData->StatPoll, a);1432 SLIRP_PROFILE_STOP(Poll, a); 1433 1433 } 1434 1434 -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r20306 r20376 436 436 #endif /*VBOX_WITH_SLIRP_ALIAS*/ 437 437 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.