Skip to content

Commit

Permalink
NetBSD 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed Sep 26, 2002
1 parent b27857a commit 9e58c88
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
26 changes: 13 additions & 13 deletions 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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -136,25 +136,25 @@ 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
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 .
15 changes: 9 additions & 6 deletions 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.
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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 = ", ";
Expand Down Expand Up @@ -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);
}

0 comments on commit 9e58c88

Please sign in to comment.