mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 23:49:36 +00: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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user