Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/usr.bin/systat Pull up the following revisions, approve...
details: https://anonhg.NetBSD.org/src/rev/275402388dbc
branches: netbsd-1-5
changeset: 489347:275402388dbc
user: ad <ad%NetBSD.org@localhost>
date: Fri Sep 01 16:36:04 2000 +0000
description:
Pull up the following revisions, approved by releng-1-5:
- Add "boot", "run", "time" and "zero" commands to all IP displays. These work
as in the "vmstat" display mode. The default mode is now "time", not "boot".
- ANSIfy.
- s@kre\(@vmstat\(@.
- __RCSID() police.
- Tweak inet.icmp display visual a little.
bufcache.c 1.8
cmds.c 1.22
cmdtab.c 1.16
disks.c 1.11
extern.h 1.23
fetch.c 1.7
globalcmds.c 1.8
diffstat:
usr.bin/systat/bufcache.c | 36 ++---
usr.bin/systat/cmds.c | 14 +-
usr.bin/systat/cmdtab.c | 64 +++++++++-
usr.bin/systat/disks.c | 21 +--
usr.bin/systat/extern.h | 260 ++++++++++++++++++++++++-------------------
usr.bin/systat/fetch.c | 11 +-
usr.bin/systat/globalcmds.c | 29 ++--
7 files changed, 244 insertions(+), 191 deletions(-)
diffs (truncated from 770 to 300 lines):
diff -r ea619b354cac -r 275402388dbc usr.bin/systat/bufcache.c
--- a/usr.bin/systat/bufcache.c Fri Sep 01 16:14:44 2000 +0000
+++ b/usr.bin/systat/bufcache.c Fri Sep 01 16:36:04 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.7 2000/04/27 00:30:51 jdc Exp $ */
+/* $NetBSD: bufcache.c,v 1.7.4.1 2000/09/01 16:36:04 ad Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: bufcache.c,v 1.7 2000/04/27 00:30:51 jdc Exp $");
+__RCSID("$NetBSD: bufcache.c,v 1.7.4.1 2000/09/01 16:36:04 ad Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -106,22 +106,21 @@
static struct buf *buf = NULL;
static TAILQ_HEAD(bqueues, buf) bufqueues[BQUEUES];
-static void vc_init __P((void));
-static void ml_init __P((void));
-static struct vnode *vc_lookup __P((struct vnode *));
-static struct mount *ml_lookup __P((struct mount *, int, int));
+static void vc_init(void);
+static void ml_init(void);
+static struct vnode *vc_lookup(struct vnode *);
+static struct mount *ml_lookup(struct mount *, int, int);
WINDOW *
-openbufcache()
+openbufcache(void)
{
return (subwin(stdscr, LINES-5-1, 0, 5, 0));
}
void
-closebufcache(w)
- WINDOW *w;
+closebufcache(WINDOW *w)
{
if (w == NULL)
@@ -133,7 +132,7 @@
}
void
-labelbufcache()
+labelbufcache(void)
{
mvwprintw(wnd, 0, 0, "There are %d buffers using %d kBytes of memory.",
nbuf, bufkb);
@@ -146,7 +145,7 @@
}
void
-showbufcache()
+showbufcache(void)
{
int tbuf, i, lastrow;
long tvalid, tsize;
@@ -186,7 +185,7 @@
}
int
-initbufcache()
+initbufcache(void)
{
if (namelist[X_NBUF].n_type == 0) {
if (kvm_nlist(kd, namelist)) {
@@ -213,7 +212,7 @@
}
void
-fetchbufcache()
+fetchbufcache(void)
{
int i, count;
struct buf *bp;
@@ -271,7 +270,7 @@
}
static void
-vc_init()
+vc_init(void)
{
int i;
@@ -281,7 +280,7 @@
}
static void
-ml_init()
+ml_init(void)
{
struct ml_entry *ml;
@@ -294,8 +293,7 @@
static struct vnode *
-vc_lookup(vaddr)
- struct vnode *vaddr;
+vc_lookup(struct vnode *vaddr)
{
struct vnode *ret;
int i, oldest, match;
@@ -332,9 +330,7 @@
}
static struct mount *
-ml_lookup(maddr, size, valid)
- struct mount *maddr;
- int size, valid;
+ml_lookup(struct mount *maddr, int size, int valid)
{
struct ml_entry *ml;
diff -r ea619b354cac -r 275402388dbc usr.bin/systat/cmds.c
--- a/usr.bin/systat/cmds.c Fri Sep 01 16:14:44 2000 +0000
+++ b/usr.bin/systat/cmds.c Fri Sep 01 16:36:04 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmds.c,v 1.21 2000/06/05 21:48:25 mycroft Exp $ */
+/* $NetBSD: cmds.c,v 1.21.2.1 2000/09/01 16:36:04 ad Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95";
#endif
-__RCSID("$NetBSD: cmds.c,v 1.21 2000/06/05 21:48:25 mycroft Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.21.2.1 2000/09/01 16:36:04 ad Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -49,11 +49,10 @@
#include "systat.h"
#include "extern.h"
-void switch_mode __P((struct mode *p));
+void switch_mode(struct mode *p);
void
-command(cmd)
- char *cmd;
+command(char *cmd)
{
struct command *c;
struct mode *p;
@@ -101,8 +100,7 @@
}
void
-switch_mode(p)
- struct mode *p;
+switch_mode(struct mode *p)
{
int switchfail;
@@ -146,7 +144,7 @@
}
void
-status()
+status(void)
{
error("Showing %s, refresh every %d seconds.", curmode->c_name, naptime);
}
diff -r ea619b354cac -r 275402388dbc usr.bin/systat/cmdtab.c
--- a/usr.bin/systat/cmdtab.c Fri Sep 01 16:14:44 2000 +0000
+++ b/usr.bin/systat/cmdtab.c Fri Sep 01 16:36:04 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmdtab.c,v 1.15 2000/04/11 01:18:35 jwise Exp $ */
+/* $NetBSD: cmdtab.c,v 1.15.4.1 2000/09/01 16:36:04 ad Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: cmdtab.c,v 1.15 2000/04/11 01:18:35 jwise Exp $");
+__RCSID("$NetBSD: cmdtab.c,v 1.15.4.1 2000/09/01 16:36:04 ad Exp $");
#endif /* not lint */
#include "systat.h"
@@ -59,6 +59,14 @@
{ 0 }
};
+struct command icmp_commands[] = {
+ { "boot", icmp_boot, "show total stats since boot"},
+ { "run", icmp_run, "show running total stats"},
+ { "time", icmp_time, "show stats for each sample time"},
+ { "zero", icmp_zero, "re-zero running totals"},
+ { 0 }
+};
+
struct command iostat_commands[] = {
{ "bars", iostat_bars, "show io stats as a bar graph"},
{ "numbers", iostat_numbers, "show io stats numerically"},
@@ -72,6 +80,34 @@
{ 0 }
};
+struct command ip_commands[] = {
+ { "boot", ip_boot, "show total stats since boot"},
+ { "run", ip_run, "show running total stats"},
+ { "time", ip_time, "show stats for each sample time"},
+ { "zero", ip_zero, "re-zero running totals"},
+ { 0 }
+};
+
+#ifdef INET6
+struct command ip6_commands[] = {
+ { "boot", ip6_boot, "show total stats since boot"},
+ { "run", ip6_run, "show running total stats"},
+ { "time", ip6_time, "show stats for each sample time"},
+ { "zero", ip6_zero, "re-zero running totals"},
+ { 0 }
+};
+#endif
+
+#ifdef IPSEC
+struct command ipsec_commands[] = {
+ { "boot", ipsec_boot, "show total stats since boot"},
+ { "run", ipsec_run, "show running total stats"},
+ { "time", ipsec_time, "show stats for each sample time"},
+ { "zero", ipsec_zero, "re-zero running totals"},
+ { NULL, NULL, NULL },
+};
+#endif
+
struct command netstat_commands[] = {
{ "all", netstat_all, "include server sockets"},
{ "display", netstat_display, "show specified hosts or ports"},
@@ -90,6 +126,14 @@
{ 0 }
};
+struct command tcp_commands[] = {
+ { "boot", tcp_boot, "show total stats since boot"},
+ { "run", tcp_run, "show running total stats"},
+ { "time", tcp_time, "show stats for each sample time"},
+ { "zero", tcp_zero, "re-zero running totals"},
+ { NULL, NULL, NULL },
+};
+
struct command vmstat_commands[] = {
{ "boot", vmstat_boot, "show total vm stats since boot"},
{ "run", vmstat_run, "show running total vm stats"},
@@ -113,25 +157,25 @@
initbufcache, openbufcache, closebufcache, 0,
CF_LOADAV },
{ "inet.icmp", showicmp, fetchicmp, labelicmp,
- initicmp, openicmp, closeicmp, 0,
+ initicmp, openicmp, closeicmp, icmp_commands,
CF_LOADAV },
{ "inet.ip", showip, fetchip, labelip,
- initip, openip, closeip, 0,
+ initip, openip, closeip, ip_commands,
CF_LOADAV },
{ "inet.tcp", showtcp, fetchtcp, labeltcp,
- inittcp, opentcp, closetcp, 0,
+ inittcp, opentcp, closetcp, tcp_commands,
CF_LOADAV },
{ "inet.tcpsyn",showtcpsyn, fetchtcp, labeltcpsyn,
- inittcp, opentcp, closetcp, 0,
+ inittcp, opentcp, closetcp, tcp_commands,
CF_LOADAV },
#ifdef INET6
{ "inet6.ip6", showip6, fetchip6, labelip6,
- initip6, openip6, closeip6, 0,
+ initip6, openip6, closeip6, ip6_commands,
CF_LOADAV },
#endif
#ifdef IPSEC
{ "ipsec", showipsec, fetchipsec, labelipsec,
- initipsec, openipsec, closeipsec, 0,
+ initipsec, openipsec, closeipsec, ipsec_commands,
CF_LOADAV },
#endif
{ "iostat", showiostat, fetchiostat, labeliostat,
@@ -149,8 +193,8 @@
{ "swap", showswap, fetchswap, labelswap,
initswap, openswap, closeswap, 0,
CF_LOADAV },
- { "vmstat", showkre, fetchkre, labelkre,
- initkre, openkre, closekre, vmstat_commands,
+ { "vmstat", showvmstat, fetchvmstat, labelvmstat,
+ initvmstat, openvmstat, closevmstat, vmstat_commands,
0 },
{ 0 }
};
diff -r ea619b354cac -r 275402388dbc usr.bin/systat/disks.c
Home |
Main Index |
Thread Index |
Old Index