summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-08-13 23:45:35 +0000
committerderaadt <deraadt@openbsd.org>2009-08-13 23:45:35 +0000
commitf429edc309387ece992c9e01bf9ac9a66906e004 (patch)
tree979282c877204ec36a330a3aa7c5d7c31526810c
parentSwitch the prompt code to return an empty string when the user enters no (diff)
downloadwireguard-openbsd-f429edc309387ece992c9e01bf9ac9a66906e004.tar.xz
wireguard-openbsd-f429edc309387ece992c9e01bf9ac9a66906e004.zip
there are louder and louder moans about the inability to see packet
rates at the same time as interrupt counts, so sneak them into the bottom corner of the vmstat screen ok dlg
-rw-r--r--usr.bin/systat/if.c18
-rw-r--r--usr.bin/systat/systat.h14
-rw-r--r--usr.bin/systat/vmstat.c16
3 files changed, 30 insertions, 18 deletions
diff --git a/usr.bin/systat/if.c b/usr.bin/systat/if.c
index dc69b96a9ea..8590effce5b 100644
--- a/usr.bin/systat/if.c
+++ b/usr.bin/systat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.15 2009/06/26 06:39:47 jasper Exp $ */
+/* $OpenBSD: if.c,v 1.16 2009/08/13 23:45:35 deraadt Exp $ */
/*
* Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
*
@@ -33,18 +33,6 @@
static enum state { BOOT, TIME, RUN } state = TIME;
-struct ifcount {
- u_int64_t ifc_ib; /* input bytes */
- u_int64_t ifc_ip; /* input packets */
- u_int64_t ifc_ie; /* input errors */
- u_int64_t ifc_ob; /* output bytes */
- u_int64_t ifc_op; /* output packets */
- u_int64_t ifc_oe; /* output errors */
- u_int64_t ifc_co; /* collisions */
- int ifc_flags; /* up / down */
- int ifc_state; /* link state */
-} sum;
-
struct ifstat {
char ifs_name[IFNAMSIZ]; /* interface name */
char ifs_description[IFDESCRSIZE];
@@ -61,7 +49,7 @@ int read_if(void);
int select_if(void);
int if_keyboard_callback(int);
-static void fetchifstat(void);
+void fetchifstat(void);
static void showifstat(struct ifstat *);
static void showtotal(void);
@@ -190,7 +178,7 @@ print_if(void)
}
-static void
+void
fetchifstat(void)
{
struct ifstat *newstats, *ifs;
diff --git a/usr.bin/systat/systat.h b/usr.bin/systat/systat.h
index 485f4845ebf..3dbbe040caa 100644
--- a/usr.bin/systat/systat.h
+++ b/usr.bin/systat/systat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systat.h,v 1.13 2009/06/19 07:48:45 jasper Exp $ */
+/* $OpenBSD: systat.h,v 1.14 2009/08/13 23:45:35 deraadt Exp $ */
/* $NetBSD: systat.h,v 1.2 1995/01/20 08:52:14 jtc Exp $ */
/*-
@@ -91,3 +91,15 @@ void error(const char *fmt, ...);
void nlisterr(struct nlist []);
#endif
+
+struct ifcount {
+ u_int64_t ifc_ib; /* input bytes */
+ u_int64_t ifc_ip; /* input packets */
+ u_int64_t ifc_ie; /* input errors */
+ u_int64_t ifc_ob; /* output bytes */
+ u_int64_t ifc_op; /* output packets */
+ u_int64_t ifc_oe; /* output errors */
+ u_int64_t ifc_co; /* collisions */
+ int ifc_flags; /* up / down */
+ int ifc_state; /* link state */
+} sum;
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index b5335798346..480000481fc 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.69 2009/05/03 05:01:54 drahn Exp $ */
+/* $OpenBSD: vmstat.c,v 1.70 2009/08/13 23:45:35 deraadt Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
-static char rcsid[] = "$OpenBSD: vmstat.c,v 1.69 2009/05/03 05:01:54 drahn Exp $";
+static char rcsid[] = "$OpenBSD: vmstat.c,v 1.70 2009/08/13 23:45:35 deraadt Exp $";
#endif /* not lint */
/*
@@ -251,6 +251,11 @@ labelkre(void)
mvprintw(INTSROW, INTSCOL + 3, " Interrupts");
mvprintw(INTSROW + 1, INTSCOL + 9, "total");
+ if (LINES - 1 > VMSTATROW + 17)
+ mvprintw(VMSTATROW + 17, INTSCOL + 9, "IPKTS");
+ if (LINES - 1 > VMSTATROW + 18)
+ mvprintw(VMSTATROW + 18, INTSCOL + 9, "OPKTS");
+
mvprintw(VMSTATROW + 0, VMSTATCOL + 10, "forks");
mvprintw(VMSTATROW + 1, VMSTATCOL + 10, "fkppw");
mvprintw(VMSTATROW + 2, VMSTATCOL + 10, "fksvm");
@@ -371,6 +376,11 @@ showkre(void)
s.nchcount = nchtotal.ncs_goodhits + nchtotal.ncs_badhits +
nchtotal.ncs_miss + nchtotal.ncs_long;
+ if (LINES - 1 > VMSTATROW + 17)
+ putint(sum.ifc_ip, VMSTATROW + 17, INTSCOL, 8);
+ if (LINES - 1 > VMSTATROW + 18)
+ putint(sum.ifc_op, VMSTATROW + 18, INTSCOL, 8);
+
psiz = 0;
f2 = 0.0;
@@ -465,6 +475,7 @@ showkre(void)
putfloat((nchtotal.ncs_miss + nchtotal.ncs_long - nchtotal.ncs_pass2) *
100.0 / nz(s.nchcount), NAMEIROW + 2, NAMEICOL + 45, 4, 0, 1);
#undef nz
+
}
int
@@ -693,6 +704,7 @@ read_vm(void)
if (state == TIME)
copyinfo(&s3, &s1);
fetchkre();
+ fetchifstat();
if (state == TIME)
dkswap();
num_disp = 0;