mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
Make Slirp statistics gathering and output conditional to LOG_ENABLED
Add 'info slirp' command to monitor to display statistics Disable Slirp debugging code by default git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3451 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7d294b61ed
commit
31a60e2275
22 changed files with 203 additions and 125 deletions
|
@ -41,7 +41,10 @@ int tcp_keepintvl = TCPTV_KEEPINTVL;
|
|||
int tcp_maxidle;
|
||||
int so_options = DO_KEEPALIVE;
|
||||
|
||||
#ifdef LOG_ENABLED
|
||||
struct tcpstat tcpstat; /* tcp statistics */
|
||||
#endif
|
||||
|
||||
u_int32_t tcp_now; /* for RFC 1323 timestamps */
|
||||
|
||||
/*
|
||||
|
@ -62,7 +65,7 @@ tcp_fasttimo()
|
|||
(tp->t_flags & TF_DELACK)) {
|
||||
tp->t_flags &= ~TF_DELACK;
|
||||
tp->t_flags |= TF_ACKNOW;
|
||||
tcpstat.tcps_delack++;
|
||||
STAT(tcpstat.tcps_delack++);
|
||||
(void) tcp_output(tp);
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +195,7 @@ tcp_timers(tp, timer)
|
|||
* We tried our best, now the connection must die!
|
||||
*/
|
||||
tp->t_rxtshift = TCP_MAXRXTSHIFT;
|
||||
tcpstat.tcps_timeoutdrop++;
|
||||
STAT(tcpstat.tcps_timeoutdrop++);
|
||||
tp = tcp_drop(tp, tp->t_softerror);
|
||||
/* tp->t_softerror : ETIMEDOUT); */ /* XXX */
|
||||
return (tp); /* XXX */
|
||||
|
@ -204,7 +207,7 @@ tcp_timers(tp, timer)
|
|||
*/
|
||||
tp->t_rxtshift = 6;
|
||||
}
|
||||
tcpstat.tcps_rexmttimeo++;
|
||||
STAT(tcpstat.tcps_rexmttimeo++);
|
||||
rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
|
||||
TCPT_RANGESET(tp->t_rxtcur, rexmt,
|
||||
(short)tp->t_rttmin, TCPTV_REXMTMAX); /* XXX */
|
||||
|
@ -267,7 +270,7 @@ tcp_timers(tp, timer)
|
|||
* Force a byte to be output, if possible.
|
||||
*/
|
||||
case TCPT_PERSIST:
|
||||
tcpstat.tcps_persisttimeo++;
|
||||
STAT(tcpstat.tcps_persisttimeo++);
|
||||
tcp_setpersist(tp);
|
||||
tp->t_force = 1;
|
||||
(void) tcp_output(tp);
|
||||
|
@ -279,7 +282,7 @@ tcp_timers(tp, timer)
|
|||
* or drop connection if idle for too long.
|
||||
*/
|
||||
case TCPT_KEEP:
|
||||
tcpstat.tcps_keeptimeo++;
|
||||
STAT(tcpstat.tcps_keeptimeo++);
|
||||
if (tp->t_state < TCPS_ESTABLISHED)
|
||||
goto dropit;
|
||||
|
||||
|
@ -299,7 +302,7 @@ tcp_timers(tp, timer)
|
|||
* by the protocol spec, this requires the
|
||||
* correspondent TCP to respond.
|
||||
*/
|
||||
tcpstat.tcps_keepprobe++;
|
||||
STAT(tcpstat.tcps_keepprobe++);
|
||||
#ifdef TCP_COMPAT_42
|
||||
/*
|
||||
* The keepalive packet must have nonzero length
|
||||
|
@ -317,7 +320,7 @@ tcp_timers(tp, timer)
|
|||
break;
|
||||
|
||||
dropit:
|
||||
tcpstat.tcps_keepdrops++;
|
||||
STAT(tcpstat.tcps_keepdrops++);
|
||||
tp = tcp_drop(tp, 0); /* ETIMEDOUT); */
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue