Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 0eec05715da3ca8ae3817a0833b18fa6 > files > 55

nfs-utils-1.0.9-50.el5.src.rpm

--- nfs-utils-1.0.9/utils/nhfsstone/nhfsstone.c.orig	2006-07-08 09:04:32.000000000 +0900
+++ nfs-utils-1.0.9/utils/nhfsstone/nhfsstone.c	2008-10-07 15:46:17.000000000 +0900
@@ -259,6 +259,8 @@
 int	Verbose;			/* print more info */
 int	Testop = -1;			/* operation to test */
 int	Saveerrno;			/* place to save errno */
+char 	proc_vers[] = "proc3";		/* using NFS vers (2,3,4) statistics. defautlt = NFSv3 */
+					/* please see /proc/net/rpc/nfs procX line. */
 
 #define	subtime(t1, t2)	{if ((t1.tv_usec -= t2.tv_usec) >= 1000000) {\
 				t1.tv_sec += (t1.tv_usec / 1000000); \
@@ -459,6 +461,15 @@
 				Verbose++;
 				break;
 
+			case '2':
+			case '3':
+			case '4':
+				/*
+				 * NFS version (default is NFSv3)
+				 */
+				sprintf(proc_vers, "proc%c", *opts);
+				break;
+
 			default:
 				usage();
 				exit(1);
@@ -1594,7 +1605,7 @@
 
 		if ((sp = strchr(line, '\n')) != NULL)
 			*sp = '\0';
-		if (!(sp = strtok(line, " \t")) || strcmp(line, "proc2"))
+		if (!(sp = strtok(line, " \t")) || strcmp(line, proc_vers))
 			continue;
 		if (!(sp = strtok(NULL, " \t")))
 			goto bummer;
@@ -1806,7 +1817,7 @@
 usage(void)
 {
 
-	(void) fprintf(stderr, "usage: %s [-v] [[-t secs] | [-c calls]] [-l load] [-p nprocs] [-m mixfile] [dir]...\n", Myname);
+	(void) fprintf(stderr, "usage: %s [-v] [[-t secs] | [-c calls]] [-2|-3|-4 (nfs vers:default -3)]  [-l load] [-p nprocs] [-m mixfile] [dir]...\n", Myname);
 }
 
 void
--- nfs-utils-1.0.9/utils/nhfsstone/nhfsstone.man.orig	2006-07-08 09:04:32.000000000 +0900
+++ nfs-utils-1.0.9/utils/nhfsstone/nhfsstone.man	2008-10-07 16:11:44.000000000 +0900
@@ -18,6 +18,8 @@
 ] [
 .B \-m mixfile
 ] [
+.B \-2 | -3 | -4
+] [
 .B dir
 ]...
 .SH DESCRIPTION
@@ -134,6 +136,12 @@
 root 0%, lookup 34%, readlink 8%, read 22%, wrcache 0%, write 15%, create 2%,
 remove 1%, rename 0%, link 0%, symlink 0%, mkdir 0%, rmdir 0%, readdir 3%,
 fsstat 1%.
+.TP
+.B \-2 | -3 | -4 
+specify NFS version like nfsstat (8C). Default is 3 (NFSv3). The 
+.BR nhfsstone 
+use specifified NFS statistics from /proc/net/rpc/nfs.
+option 
 .SH USING NHFSSTONE
 As with all benchmarks,
 .B nhfsstone