summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2009-06-19 07:48:46 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2009-06-19 07:48:46 +0000
commit8a8dea7c3e4baf119fbbcb3e3dcbf1db9410cf97 (patch)
tree06ca339d6a9d5ab48f58fb523df68d1923b8492b /usr.bin
parente6973bd6646ce01967620c0ae2759a96cb5c509d (diff)
- add two new views to systat, 'nfsserver' and 'nfsclient'.
output is similar to nfsstat(1), but it allows for better monitoring/debugging tricked into by and "i love this" thib@ ok canacar@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/Makefile6
-rw-r--r--usr.bin/systat/main.c3
-rw-r--r--usr.bin/systat/nfs.c447
-rw-r--r--usr.bin/systat/systat.115
-rw-r--r--usr.bin/systat/systat.h3
5 files changed, 467 insertions, 7 deletions
diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile
index 030bd9f72a0..dabc5a97850 100644
--- a/usr.bin/systat/Makefile
+++ b/usr.bin/systat/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.22 2008/11/08 06:38:27 canacar Exp $
+# $OpenBSD: Makefile,v 1.23 2009/06/19 07:48:45 jasper Exp $
PROG= systat
@@ -8,8 +8,8 @@ CFLAGS+=-DNOKVM
CPPFLAGS+=-I${.CURDIR}/../../usr.bin/vmstat
CPPFLAGS+=-I${.CURDIR}/../../sbin/pfctl
SRCS= dkstats.c engine.c if.c iostat.c main.c mbufs.c netstat.c \
- pigs.c sensors.c swap.c vmstat.c pftop.c cache.c pf.c pool.c \
- malloc.c
+ nfs.c pigs.c sensors.c swap.c vmstat.c pftop.c cache.c pf.c \
+ pool.c malloc.c
DPADD= ${LIBCURSES} ${LIBM} ${LIBKVM}
LDADD= -lcurses -lm -lkvm
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 3c490f85fe4..0b25ab1a10a 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.51 2008/11/08 06:38:27 canacar Exp $ */
+/* $Id: main.c,v 1.52 2009/06/19 07:48:45 jasper Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -343,6 +343,7 @@ initialize(void)
initpf();
initpool();
initmalloc();
+ initnfs();
}
void
diff --git a/usr.bin/systat/nfs.c b/usr.bin/systat/nfs.c
new file mode 100644
index 00000000000..6847402f24a
--- /dev/null
+++ b/usr.bin/systat/nfs.c
@@ -0,0 +1,447 @@
+/* $OpenBSD: nfs.c,v 1.1 2009/06/19 07:48:45 jasper Exp $ */
+
+/*
+ * Copyright (c) 2009 Jasper Lievisse Adriaanse <jasper@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include <sys/param.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
+#include <nfs/nfs.h>
+
+#include <err.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "systat.h"
+
+int check_nfs(void);
+int select_client(void);
+int select_server(void);
+int read_nfs(void);
+void print_client(void);
+void print_server(void);
+
+struct nfsstats nfsstats;
+int num_client = 0;
+int num_server = 0;
+
+field_def fields_nfs[] = {
+ /* Client */
+ {"Rpc Counts", 10, 12, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
+ {"", 12, 14, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+ {"Rpc Info", 14, 12, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
+ {"", 12, 14, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+ {"Cache Info", 10, 12, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+ {"", 12, 14, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+
+ /* Server */
+ {"Rpc Counts", 10, 12, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
+ {"", 12, 14, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+ {"Cache Stats", 14, 12, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
+ {"", 12, 14, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+ {"Writes", 10, 12, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+ {"", 12, 14, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
+};
+
+/* _V suffixed fields indicate a value column. */
+#define FIELD_ADDR(x) (&fields_nfs[x])
+
+/* Client */
+#define FLD_NFS_C_RPC_COUNTS FIELD_ADDR(0)
+#define FLD_NFS_C_RPC_COUNTS_V FIELD_ADDR(1)
+#define FLD_NFS_C_RPC_INFO FIELD_ADDR(2)
+#define FLD_NFS_C_RPC_INFO_V FIELD_ADDR(3)
+#define FLD_NFS_C_CACHE_INFO FIELD_ADDR(4)
+#define FLD_NFS_C_CACHE_V FIELD_ADDR(5)
+
+/* Server */
+#define FLD_NFS_S_RPC_COUNTS FIELD_ADDR(6)
+#define FLD_NFS_S_RPC_COUNTS_V FIELD_ADDR(7)
+#define FLD_NFS_S_CACHE_STATS FIELD_ADDR(8)
+#define FLD_NFS_S_CACHE_STATS_V FIELD_ADDR(9)
+#define FLD_NFS_S_WRITES FIELD_ADDR(10)
+#define FLD_NFS_S_WRITES_V FIELD_ADDR(11)
+
+/* Define views */
+field_def *view_nfs_0[] = {
+ FLD_NFS_C_RPC_COUNTS, FLD_NFS_C_RPC_COUNTS_V, FLD_NFS_C_RPC_INFO,
+ FLD_NFS_C_RPC_INFO_V, FLD_NFS_C_CACHE_INFO, FLD_NFS_C_CACHE_V ,NULL
+};
+
+field_def *view_nfs_1[] = {
+ FLD_NFS_S_RPC_COUNTS, FLD_NFS_S_RPC_COUNTS_V, FLD_NFS_S_CACHE_STATS,
+ FLD_NFS_S_CACHE_STATS_V, FLD_NFS_S_WRITES, FLD_NFS_S_WRITES_V, NULL
+};
+
+/* Define view managers */
+struct view_manager nfs_client_mgr = {
+ "Client", select_client, read_nfs, NULL, print_header,
+ print_client, keyboard_callback, NULL, NULL
+};
+
+struct view_manager nfs_server_mgr = {
+ "Server", select_server, read_nfs, NULL, print_header,
+ print_server, keyboard_callback, NULL, NULL
+};
+
+field_view views_nfs[] = {
+ {view_nfs_0, "nfsclient", '8', &nfs_client_mgr},
+ {view_nfs_1, "nfsserver", '9', &nfs_server_mgr},
+ {NULL, NULL, 0, NULL}
+};
+
+int
+select_client(void)
+{
+ num_disp = num_client;
+ return(0);
+}
+
+int
+select_server(void)
+{
+ num_disp = num_server;
+ return(0);
+}
+
+int
+initnfs(void)
+{
+ field_view *v;
+
+ for (v = views_nfs; v->name != NULL; v++)
+ add_view(v);
+
+ read_nfs();
+
+ return(0);
+}
+
+/*
+ * We get all the information in one go and don't care about
+ * server or client fields (those will be '0' if not applicable.
+ */
+int
+read_nfs(void)
+{
+ struct nfsstats *p = &nfsstats;
+ int mib[3];
+ size_t len = sizeof(*p);
+
+ mib[0] = CTL_VFS;
+ mib[1] = 2; /* NETDEV */
+ mib[2] = NFS_NFSSTATS;
+
+ if (sysctl(mib, 3, p, &len, NULL, 0) < 0)
+ return(-1);
+ else
+ return(0);
+}
+
+
+/*
+ * As we want a view with multiple columns, mixed with labels and values,
+ * we can't use the regular dance and have to use our own (looong) dance
+ * to build the layout.
+ */
+void
+print_client(void)
+{
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Getattr");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_GETATTR]);
+ print_fld_str(FLD_NFS_C_RPC_INFO, "TimedOut");
+ print_fld_ssize(FLD_NFS_C_RPC_INFO_V, nfsstats.rpctimeouts);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "Attr Hits ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.attrcache_hits);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Setattr");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_SETATTR]);
+ print_fld_str(FLD_NFS_C_RPC_INFO, "Invalid");
+ print_fld_ssize(FLD_NFS_C_RPC_INFO_V, nfsstats.rpcinvalid);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "Attr Misses");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.attrcache_misses);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Lookup");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_LOOKUP]);
+ print_fld_str(FLD_NFS_C_RPC_INFO, "X Replies");
+ print_fld_ssize(FLD_NFS_C_RPC_INFO_V, nfsstats.rpcunexpected);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "Lkup Hits ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.lookupcache_hits);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Readlink");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_READLINK]);
+ print_fld_str(FLD_NFS_C_RPC_INFO, "Retries");
+ print_fld_ssize(FLD_NFS_C_RPC_INFO_V, nfsstats.rpcretries);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "Lkup Misses ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.lookupcache_misses);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Read");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_READ]);
+ print_fld_str(FLD_NFS_C_RPC_INFO, "Requests");
+ print_fld_ssize(FLD_NFS_C_RPC_INFO_V, nfsstats.rpcrequests);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioR Hits ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V,
+ nfsstats.biocache_reads-nfsstats.read_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Write");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V, nfsstats.rpccnt[NFSPROC_WRITE]);
+ print_fld_str(FLD_NFS_C_RPC_INFO, "FrcSync");
+ print_fld_ssize(FLD_NFS_C_RPC_INFO_V, nfsstats.forcedsync);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioR Misses");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.read_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Create");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_CREATE]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioW Hits ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V,
+ nfsstats.biocache_writes-nfsstats.write_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Remove");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_REMOVE]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioW Misses");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.write_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Rename");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_RENAME]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioRL Hits ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V,
+ nfsstats.biocache_readlinks-nfsstats.readlink_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Link");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V, nfsstats.rpccnt[NFSPROC_LINK]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioRL Misses");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.readlink_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Symlink");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_SYMLINK]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioD Hits ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V,
+ nfsstats.biocache_readdirs-nfsstats.readdir_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Mkdir");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V, nfsstats.rpccnt[NFSPROC_MKDIR]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "BioD Misses");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.readdir_bios);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Rmdir");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V, nfsstats.rpccnt[NFSPROC_RMDIR]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "DirE Hits ");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.direofcache_hits);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Readdir");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_READDIR]);
+ print_fld_str(FLD_NFS_C_CACHE_INFO, "DirE Misses");
+ print_fld_ssize(FLD_NFS_C_CACHE_V, nfsstats.direofcache_misses);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "RdirPlus");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_READDIRPLUS]);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Access");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_ACCESS]);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Mknod");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V, nfsstats.rpccnt[NFSPROC_MKNOD]);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Fsstat");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_FSSTAT]);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Fsinfo");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_FSINFO]);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "PathConf");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_PATHCONF]);
+ end_line();
+
+ print_fld_str(FLD_NFS_C_RPC_COUNTS, "Commit");
+ print_fld_ssize(FLD_NFS_C_RPC_COUNTS_V,
+ nfsstats.rpccnt[NFSPROC_COMMIT]);
+ end_line();
+}
+
+void
+print_server(void)
+{
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Getattr");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_GETATTR]);
+ print_fld_str(FLD_NFS_S_CACHE_STATS, "Inprog");
+ print_fld_ssize(FLD_NFS_S_CACHE_STATS_V, nfsstats.srvcache_inproghits);
+ print_fld_str(FLD_NFS_S_WRITES, "WriteOps");
+ print_fld_ssize(FLD_NFS_S_WRITES_V, nfsstats.srvvop_writes);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Setattr");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_SETATTR]);
+ print_fld_str(FLD_NFS_S_CACHE_STATS, "Idem");
+ print_fld_ssize(FLD_NFS_S_CACHE_STATS_V,
+ nfsstats.srvcache_idemdonehits);
+ print_fld_str(FLD_NFS_S_WRITES, "WriteRPC");
+ print_fld_ssize(FLD_NFS_S_WRITES_V, nfsstats.srvrpccnt[NFSPROC_WRITE]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Lookup");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_LOOKUP]);
+ print_fld_str(FLD_NFS_S_CACHE_STATS, "Non-idem");
+ print_fld_ssize(FLD_NFS_S_CACHE_STATS_V,
+ nfsstats.srvcache_nonidemdonehits);
+ print_fld_str(FLD_NFS_S_WRITES, "Opsaved");
+ print_fld_ssize(FLD_NFS_S_WRITES_V,
+ nfsstats.srvrpccnt[NFSPROC_WRITE] - nfsstats.srvvop_writes);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Readlink");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_READLINK]);
+ print_fld_str(FLD_NFS_S_CACHE_STATS, "Misses");
+ print_fld_ssize(FLD_NFS_S_CACHE_STATS_V, nfsstats.srvcache_misses);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Read");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_READ]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Write");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_WRITE]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Create");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_CREATE]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Remove");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_REMOVE]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Rename");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_RENAME]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Link");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_LINK]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Symlink");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_SYMLINK]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Mkdir");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_MKDIR]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Rmdir");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_RMDIR]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Readdir");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_READDIR]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "RdirPlus");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_READDIRPLUS]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Access");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_ACCESS]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Mknod");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_MKNOD]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Fsstat");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_FSSTAT]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Fsinfo");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_FSINFO]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "PathConf");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_PATHCONF]);
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Commit");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V,
+ nfsstats.srvrpccnt[NFSPROC_COMMIT]);
+ end_line();
+
+ /* The following end_line() creates two seperate blocks on the screen */
+ end_line();
+
+ print_fld_str(FLD_NFS_S_RPC_COUNTS, "Ret-Failed");
+ print_fld_ssize(FLD_NFS_S_RPC_COUNTS_V, nfsstats.srvrpc_errs);
+ print_fld_str(FLD_NFS_S_CACHE_STATS, "Faults");
+ print_fld_ssize(FLD_NFS_S_CACHE_STATS_V, nfsstats.srv_errs);
+ end_line();
+}
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index 174a74a4d9a..e34c1846052 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: systat.1,v 1.78 2008/12/17 08:21:43 canacar Exp $
+.\" $OpenBSD: systat.1,v 1.79 2009/06/19 07:48:45 jasper Exp $
.\" $NetBSD: systat.1,v 1.6 1996/05/10 23:16:39 thorpej Exp $
.\"
.\" Copyright (c) 1985, 1990, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)systat.1 8.2 (Berkeley) 12/30/93
.\"
-.Dd $Mdocdate: December 17 2008 $
+.Dd $Mdocdate: June 19 2009 $
.Dt SYSTAT 1
.Os
.Sh NAME
@@ -118,6 +118,8 @@ argument expects to be one of:
.Ic sensors ,
.Ic mbufs ,
.Ic netstat ,
+.Ic nfsclient ,
+.Ic nfsserver ,
.Ic swap ,
.Ic states ,
.Ic rules ,
@@ -330,6 +332,14 @@ with each shown symbolically, when possible.
.\".It Cm tcp \*(Ba udp \*(Ba all
.\"Display only network connections using the indicated protocol.
.\".El
+.It Ic nfsclient
+Display statistics about the NFS client activity.
+Output ressembles
+.Cm nfsstat Fl c .
+.It Ic nfsserver
+Display statistics about the NFS server activity.
+Ooutput ressembles
+.Cm nfsstat Fl s .
.It Ic pf
Display filter information about
.Xr pf 4 ,
@@ -592,6 +602,7 @@ Port names.
.Xt fstat 1 ,
.Xr kill 1 ,
.Xr netstat 1 ,
+.Xr nfsstat 1 ,
.Xr ps 1 ,
.Xr top 1 ,
.Xr iostat 8 ,
diff --git a/usr.bin/systat/systat.h b/usr.bin/systat/systat.h
index 65aca5ea432..485f4845ebf 100644
--- a/usr.bin/systat/systat.h
+++ b/usr.bin/systat/systat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systat.h,v 1.12 2008/11/08 06:38:27 canacar Exp $ */
+/* $OpenBSD: systat.h,v 1.13 2009/06/19 07:48:45 jasper Exp $ */
/* $NetBSD: systat.h,v 1.2 1995/01/20 08:52:14 jtc Exp $ */
/*-
@@ -85,6 +85,7 @@ int initpftop(void);
int initpf(void);
int initpool(void);
int initmalloc(void);
+int initnfs(void);
void error(const char *fmt, ...);
void nlisterr(struct nlist []);