From 9e58c88729563e61ccbb85980c3fd12bf84227ea Mon Sep 17 00:00:00 2001 From: itojun Date: Thu, 26 Sep 2002 05:44:19 +0000 Subject: [PATCH] NetBSD 1.6 --- netbsd/usr.sbin/trpt/trpt.8 | 26 +++++++++++++------------- netbsd/usr.sbin/trpt/trpt.c | 15 +++++++++------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/netbsd/usr.sbin/trpt/trpt.8 b/netbsd/usr.sbin/trpt/trpt.8 index 05c2235b52..9c86a3b9fd 100644 --- a/netbsd/usr.sbin/trpt/trpt.8 +++ b/netbsd/usr.sbin/trpt/trpt.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: trpt.8,v 1.11 1999/03/22 18:44:13 garbled Exp $ +.\" $NetBSD: trpt.8,v 1.13 2002/02/02 02:03:48 wiz Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -59,7 +59,7 @@ when a socket is marked for (see .Xr setsockopt 2 ) , and prints a readable description of these records. -When no options are supplied, +When no options are supplied, .Nm prints all the trace records found in the system grouped according to @@ -110,9 +110,9 @@ is as follows. Isolate the problem and enable debugging on the socket(s) involved in the connection. Find the address of the protocol control blocks -associated with the sockets using the +associated with the sockets using the .Fl A -option to +option to .Xr netstat 1 . Then run .Nm @@ -136,10 +136,6 @@ default kernel memory .It Pa /netbsd default system namelist .El -.Sh SEE ALSO -.Xr netstat 1 , -.Xr setsockopt 2 , -.Xr trsp 8 .Sh DIAGNOSTICS .Bl -tag -width Ds .It Sy no namelist @@ -147,14 +143,18 @@ When the system image doesn't contain the proper symbols to find the trace buffer; others which should be self explanatory. .El +.Sh SEE ALSO +.Xr netstat 1 , +.Xr setsockopt 2 , +.Xr trsp 8 +.Sh HISTORY +The +.Nm +command appeared in +.Bx 4.2 . .Sh BUGS Should also print the data for each input or output, but this is not saved in the trace record. .Pp The output format is inscrutable and should be described here. -.Sh HISTORY -The -.Nm -command appeared in -.Bx 4.2 . diff --git a/netbsd/usr.sbin/trpt/trpt.c b/netbsd/usr.sbin/trpt/trpt.c index 9b6d15ef5c..a96c004d63 100644 --- a/netbsd/usr.sbin/trpt/trpt.c +++ b/netbsd/usr.sbin/trpt/trpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: trpt.c,v 1.9 1999/07/01 19:15:03 itojun Exp $ */ +/* $NetBSD: trpt.c,v 1.12 2001/09/11 15:45:01 thorpej Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)trpt.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: trpt.c,v 1.9 1999/07/01 19:15:03 itojun Exp $"); +__RCSID("$NetBSD: trpt.c,v 1.12 2001/09/11 15:45:01 thorpej Exp $"); #endif #endif /* not lint */ @@ -144,7 +144,9 @@ static caddr_t tcp_pcbs[TCP_NDEBUG]; static n_time ntime; static int aflag, follow, sflag, tflag; -extern char *__progname; +/* see sys/netinet/tcp_debug.c */ +struct tcp_debug tcp_debug[TCP_NDEBUG]; +int tcp_debx; int main __P((int, char *[])); void dotrace __P((caddr_t)); @@ -510,9 +512,10 @@ tcp_trace(act, ostate, atp, tp, family, packet, req) register int i; for (i = 0; i < TCPT_NTIMERS; i++) { - if (tp->t_timer[i] == 0) + if ((tp->t_timer[i].c_flags & CALLOUT_ACTIVE) == 0) continue; - printf("%s%s=%d", cp, tcptimers[i], tp->t_timer[i]); + printf("%s%s=%llu", cp, tcptimers[i], + (unsigned long long) tp->t_timer[i].c_time); if (i == TCPT_REXMT) printf(" (t_rxtshft=%d)", tp->t_rxtshift); cp = ", "; @@ -545,6 +548,6 @@ usage() { (void) fprintf(stderr, "usage: %s [-afjst] [-p hex-address]" - " [-N system] [-M core]\n", __progname); + " [-N system] [-M core]\n", getprogname()); exit(1); }