Re: svn commit: r281888 - head/usr.bin/nfsstat

2015-04-23 Thread Rick Macklem
John Baldwin wrote:
> On Thursday, April 23, 2015 02:36:02 PM Edward Tomasz Napierala
> wrote:
> > Author: trasz
> > Date: Thu Apr 23 14:36:01 2015
> > New Revision: 281888
> > URL: https://svnweb.freebsd.org/changeset/base/281888
> > 
> > Log:
> >   Remove oldnfs support from nfsstat(1).
> >   
> >   Reviewed by:  rmacklem@ (earlier version)
> >   Sponsored by: The FreeBSD Foundation
> > 
> > Modified:
> >   head/usr.bin/nfsstat/nfsstat.1
> >   head/usr.bin/nfsstat/nfsstat.c
> 
> It might be nice to rename the "new" datastructure names as well, so
> that
> ext_nfsstats would just be nfsstats.
> 
Actually, I hope to soon add a new revision of "nfsstats", so that
the "iostat like stats" can be supported (D1626) and also make all
the fields uint64_t, so they don't wrap.

Maybe I can all that one "nfsstats"? ;-)

Btw, if you have a suggestion for the best way to acquire this new
structure from the kernel, please let me know.
(I was planning on code that would copy this new one to ext_nfsstats
 when it is acquired by an old binary.)

rick

> --
> John Baldwin
> 
> 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r281888 - head/usr.bin/nfsstat

2015-04-23 Thread John Baldwin
On Thursday, April 23, 2015 02:36:02 PM Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Thu Apr 23 14:36:01 2015
> New Revision: 281888
> URL: https://svnweb.freebsd.org/changeset/base/281888
> 
> Log:
>   Remove oldnfs support from nfsstat(1).
>   
>   Reviewed by:rmacklem@ (earlier version)
>   Sponsored by:   The FreeBSD Foundation
> 
> Modified:
>   head/usr.bin/nfsstat/nfsstat.1
>   head/usr.bin/nfsstat/nfsstat.c

It might be nice to rename the "new" datastructure names as well, so that
ext_nfsstats would just be nfsstats.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r281888 - head/usr.bin/nfsstat

2015-04-23 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Apr 23 14:36:01 2015
New Revision: 281888
URL: https://svnweb.freebsd.org/changeset/base/281888

Log:
  Remove oldnfs support from nfsstat(1).
  
  Reviewed by:  rmacklem@ (earlier version)
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.bin/nfsstat/nfsstat.1
==
--- head/usr.bin/nfsstat/nfsstat.1  Thu Apr 23 14:22:20 2015
(r281887)
+++ head/usr.bin/nfsstat/nfsstat.1  Thu Apr 23 14:36:01 2015
(r281888)
@@ -28,7 +28,7 @@
 .\" From: @(#)nfsstat.18.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd May 1, 2013
+.Dd April 23, 2015
 .Dt NFSSTAT 1
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 statistics
 .Sh SYNOPSIS
 .Nm
-.Op Fl cemoszW
+.Op Fl cemszW
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Op Fl w Ar wait
@@ -58,10 +58,8 @@ The options are as follows:
 .It Fl c
 Only display client side statistics.
 .It Fl e
-Report the extra statistics collected by the new NFS client and
+Report the extra statistics collected by the NFS client and
 server for NFSv4.
-This option is incompatible with
-.Fl o .
 .It Fl M
 Extract values associated with the name list from the specified core
 instead of the default
@@ -75,10 +73,6 @@ This option is only supported by the new
 .It Fl N
 Extract the name list from the specified system instead of the default
 .Pa /boot/kernel/kernel .
-.It Fl o
-Report statistics for the old NFS client and/or server.
-Without this
-option statistics for the new NFS client and/or server will be reported.
 .It Fl s
 Only display server side statistics.
 .It Fl W

Modified: head/usr.bin/nfsstat/nfsstat.c
==
--- head/usr.bin/nfsstat/nfsstat.c  Thu Apr 23 14:22:20 2015
(r281887)
+++ head/usr.bin/nfsstat/nfsstat.c  Thu Apr 23 14:36:01 2015
(r281888)
@@ -79,22 +79,19 @@ struct nlist nl[] = {
 };
 kvm_t *kd;
 
-static int deadkernel = 0;
 static int widemode = 0;
 static int zflag = 0;
-static int run_v4 = 1;
 static int printtitle = 1;
 static struct ext_nfsstats ext_nfsstats;
 static int extra_output = 0;
 
-void intpr(int, int);
-void printhdr(int, int);
-void sidewaysintpr(u_int, int, int);
-void usage(void);
-char *sperc1(int, int);
-char *sperc2(int, int);
-void exp_intpr(int, int);
-void exp_sidewaysintpr(u_int, int, int);
+static void intpr(int, int);
+static void printhdr(int, int);
+static void usage(void);
+static char *sperc1(int, int);
+static char *sperc2(int, int);
+static void exp_intpr(int, int);
+static void exp_sidewaysintpr(u_int, int, int);
 
 #define DELTA(field)   (nfsstats.field - lastst.field)
 
@@ -106,7 +103,6 @@ main(int argc, char **argv)
int serverOnly = -1;
int ch;
char *memf, *nlistf;
-   char errbuf[_POSIX2_LINE_MAX];
int mntlen, i;
char buf[1024];
struct statfs *mntbuf;
@@ -114,7 +110,7 @@ main(int argc, char **argv)
 
interval = 0;
memf = nlistf = NULL;
-   while ((ch = getopt(argc, argv, "cesWM:mN:ow:z")) != -1)
+   while ((ch = getopt(argc, argv, "cesWM:mN:w:z")) != -1)
switch(ch) {
case 'M':
memf = optarg;
@@ -162,14 +158,7 @@ main(int argc, char **argv)
case 'z':
zflag = 1;
break;
-   case 'o':
-   if (extra_output != 0)
-   err(1, "-o incompatible with -e");
-   run_v4 = 0;
-   break;
case 'e':
-   if (run_v4 == 0)
-   err(1, "-e incompatible with -o");
extra_output = 1;
break;
case '?':
@@ -190,26 +179,11 @@ main(int argc, char **argv)
}
}
 #endif
-   if (run_v4 != 0 && modfind("nfscommon") < 0)
-   errx(1, "new client/server not loaded");
-
-   if (run_v4 == 0 && (nlistf != NULL || memf != NULL)) {
-   deadkernel = 1;
-
-   if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY,
-   errbuf)) == 0) {
-   errx(1, "kvm_openfiles: %s", errbuf);
-   }
-   if (kvm_nlist(kd, nl) != 0) {
-   errx(1, "kvm_nlist: can't get names");
-   }
-   }
+   if (modfind("nfscommon") < 0)
+   errx(1, "NFS client/server not loaded");
 
if (interval) {
-   if (run_v4 > 0)
-   exp_sidewaysintpr(interval, clientOnly, serverOnly);
-   else
-   sidewaysintpr(interval, clientOnly, serverOnly);
+   exp_sidewaysintpr(interval, clientOnly, serverOnly);
} else {
if (extra_output != 0)