Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2011 13:17:09 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225109 - head/usr.bin/nfsstat
Message-ID:  <201108231317.p7NDH96I004087@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Aug 23 13:17:09 2011
New Revision: 225109
URL: http://svn.freebsd.org/changeset/base/225109

Log:
  Fix nfsstat(1) so that it prints out correct stats for the
  new NFS server when the "-w" option is used. The problem was
  spotted by hrs@ during testing where srvrpcnt[] must be indexed
  by NFSV4OP_XXX and not NFSPROC_XXX.
  
  Submitted by:	hrs
  Approved by:	re (bz)
  MFC after:	2 weeks

Modified:
  head/usr.bin/nfsstat/nfsstat.c

Modified: head/usr.bin/nfsstat/nfsstat.c
==============================================================================
--- head/usr.bin/nfsstat/nfsstat.c	Tue Aug 23 13:07:30 2011	(r225108)
+++ head/usr.bin/nfsstat/nfsstat.c	Tue Aug 23 13:17:09 2011	(r225109)
@@ -1000,24 +1000,24 @@ exp_sidewaysintpr(u_int interval, int cl
 		if (serverOnly) {
 		    printf("%s %6d %6d %6d %6d %6d %6d %6d %6d",
 			((clientOnly && serverOnly) ? "Server:" : ""),
-			nfsstats.srvrpccnt[NFSPROC_GETATTR] -
-			lastst.srvrpccnt[NFSPROC_GETATTR],
-			nfsstats.srvrpccnt[NFSPROC_LOOKUP] -
-			lastst.srvrpccnt[NFSPROC_LOOKUP],
-			nfsstats.srvrpccnt[NFSPROC_READLINK] -
-			lastst.srvrpccnt[NFSPROC_READLINK],
-			nfsstats.srvrpccnt[NFSPROC_READ] -
-			lastst.srvrpccnt[NFSPROC_READ],
-			nfsstats.srvrpccnt[NFSPROC_WRITE] -
-			lastst.srvrpccnt[NFSPROC_WRITE],
-			nfsstats.srvrpccnt[NFSPROC_RENAME] -
-			lastst.srvrpccnt[NFSPROC_RENAME],
-			nfsstats.srvrpccnt[NFSPROC_ACCESS] -
-			lastst.srvrpccnt[NFSPROC_ACCESS],
-			(nfsstats.srvrpccnt[NFSPROC_READDIR] -
-			 lastst.srvrpccnt[NFSPROC_READDIR]) +
-			(nfsstats.srvrpccnt[NFSPROC_READDIRPLUS] -
-			 lastst.srvrpccnt[NFSPROC_READDIRPLUS]));
+			nfsstats.srvrpccnt[NFSV4OP_GETATTR] -
+			lastst.srvrpccnt[NFSV4OP_GETATTR],
+			nfsstats.srvrpccnt[NFSV4OP_LOOKUP] -
+			lastst.srvrpccnt[NFSV4OP_LOOKUP],
+			nfsstats.srvrpccnt[NFSV4OP_READLINK] -
+			lastst.srvrpccnt[NFSV4OP_READLINK],
+			nfsstats.srvrpccnt[NFSV4OP_READ] -
+			lastst.srvrpccnt[NFSV4OP_READ],
+			nfsstats.srvrpccnt[NFSV4OP_WRITE] -
+			lastst.srvrpccnt[NFSV4OP_WRITE],
+			nfsstats.srvrpccnt[NFSV4OP_RENAME] -
+			lastst.srvrpccnt[NFSV4OP_RENAME],
+			nfsstats.srvrpccnt[NFSV4OP_ACCESS] -
+			lastst.srvrpccnt[NFSV4OP_ACCESS],
+			(nfsstats.srvrpccnt[NFSV4OP_READDIR] -
+			 lastst.srvrpccnt[NFSV4OP_READDIR]) +
+			(nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] -
+			 lastst.srvrpccnt[NFSV4OP_READDIRPLUS]));
 		    printf("\n");
 		    lastst = nfsstats;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108231317.p7NDH96I004087>