History log of /freebsd-current/usr.bin/nfsstat/nfsstat.c
Revision Date Author Comments
# f79b200b 27-Dec-2023 Lexi Winter <lexi@le-fay.org>

nfsstat: make -q work without -e/-E

MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/961


# 30ce26ca 27-Dec-2023 Lexi Winter <lexi@le-fay.org>

nfsstat: update option strings in docs

Add the missing -q option to the nfsstat(1) manpage SYNOPSIS (it is
already documented in DESCRIPTION), and add the missing -E and -q
options to the built-in usage output.

PR: 275912
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/958


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


# 1a7ac2bd 07-Jul-2023 Alfonso Gregory <gfunni234@gmail.com>

Mark usage function as __dead2 in programs where it does not return

In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735


# d92dc803 28-May-2022 Rick Macklem <rmacklem@FreeBSD.org>

nfsstat: Add an entry to output NFSPROC_APPENDWRITE count

Commit 5218d82c81f9 added a new NFSv4.1/4.2 procedure called
AppendWrite that uses a Verify to avoid a separate Getattr RPC
for the common case where the client knows the correct file
size for O_APPEND writes.

This patch modifies nfsstat so that it displays a count of
these new RPCs for the "-E -c" option.


# 75c66619 14-Nov-2021 Rick Macklem <rmacklem@FreeBSD.org>

nfsstat: Add output for counts of new RPCs to the "-E" option

Add output to the "-E" option for new RPCs related
to NFSv4.1/4.2. Also, add output of the counts for
allocated layouts and the title for the "Client"
section (which was lost during a previous commit).

MFC after: 2 weeks


# 72a92f91 23-Aug-2021 Gordon Bergling <gbe@FreeBSD.org>

nfsstat(1): Fix a typo in an error message

- s/priviledged/privileged/

MFC after: 1 week


# b3baff23 23-Oct-2020 Alan Somers <asomers@FreeBSD.org>

nfsstat: delete unused fields

Ever since r192762 nfsstat has included a few fields whose values were
always 0. They were copied from OpenBSD, but have never been used on
FreeBSD. Don't display them.

Reviewed by: rmacklem
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D26920


# dc254170 02-Sep-2020 Alan Somers <asomers@FreeBSD.org>

Fix output of nfsstat -cE in json or xml mode

Due to a copy/paste error, the "getacl" field was duplicated, but only in
XML or JSON mode, not in txt mode.

Discussed with: rmacklem
MFC after: 1 week
Sponsored by: Axcient


# 28a04da3 31-Dec-2019 Rick Macklem <rmacklem@FreeBSD.org>

Get rid of old nfsstat options no longer used.

The "-M" and "-N" options for nfsstat were used by the old NFS code and
have never done anything for the new NFS code.
This patch replaces code that assigns values to variables that are never
used with printf()s noting the options are ignored.
This has the side effect that it gets rid of warnings w.r.t. these
variables being assigned but never used, that occur for some builds.

Noticed during integration of the NFSv4.2 code.


# 29001a81 30-Dec-2019 Rick Macklem <rmacklem@FreeBSD.org>

Replace .h files included from old NFS directories with the new NFS ones.

Prior to this patch, nfsstat.c includes files from sys/nfs, sys/nfsclient
and sys/nfsserver. These .h files (particularily the ones in sys/nfsclient
and sys/nfsserver) are from the old NFS code and should eventually be
deprecated/removed.
This patch changes nfsstat.c to include files from the new/current NFS
code instead of the old ones in preparation for eventual removal.


# 309c8f76 21-Dec-2019 Rick Macklem <rmacklem@FreeBSD.org>

Update nfsstat to list the NFSv4.2 procedures and operations.

r355677 added NFSv4.2 support to the NFS client and server. It also updated
the nfsstats structure to keep counts for the new procedures (client) and
operations (server) added for NFSv4.2.
This patch updates the "-E" option of nfsstat so that it lists counts for
these new procedures and operations.


# b5965b56 28-Jul-2019 Rick Macklem <rmacklem@FreeBSD.org>

Fix printing of Server Re-Failed and Server Faults.

nfsstat -s prints bogus large numbers for the Server Re-Failed and Server
Faults fields. This was introduced by r328588.
Although I know nothing about libxo, these lines aren't titles and this
patch seems to fix the problem, so I am committing it for rea@ who emailed
it to me.
It also deleted the trailing ':' from the title lines, since those were not
in the pre-r328588 output.

If there is a more correct fix, someone conversant with libxo will need
to do so.

Submitted by: rea
MFC after: 2 weeks


# a16e0d44 13-Apr-2019 Rick Macklem <rmacklem@FreeBSD.org>

Fix printing of the line that starts with "LocalOpen...".

When "nfsstat -E -c" was done, the title line starting with "LocalOpen..."
was not being displayed. This was introduced by r328588.

MFC after: 2 weeks


# 2145d321 30-Jan-2018 Emmanuel Vadot <manu@FreeBSD.org>

nfsstat: Add libxo output

Add libxo output support
Merge exp41_intpr and exp_intpr function. The only difference is to print
NFSV4.1 operations in exp41, add a third arguement to control that.
printtitle was set to 1 and don't have a switch, add a -q options to control it.

Reviewed by: bapt
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D14012


# 2d446498 24-Jun-2017 Rick Macklem <rmacklem@FreeBSD.org>

Add RPC count reporting for the two new RPCs added by r320322.

This is a content change.

PR: 219550
MFC after: 2 weeks


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 0744a2b0 26-Nov-2016 Rick Macklem <rmacklem@FreeBSD.org>

Add a -E flag to nfsstat.c so that it prints out the NFSv4.1
procedure/operation counts.
It also avoids clipping the counts at 9 digits.

Reviewed by: bcr (doc parts)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8626


# 684d18c9 15-Aug-2016 Rick Macklem <rmacklem@FreeBSD.org>

Fix r304026 so that it builds for gcc.

Reported by: np
Tested by: np
MFC after: 1 month


# 693957f8 13-Aug-2016 Rick Macklem <rmacklem@FreeBSD.org>

Update nfsstat.c to use the new kernel nfsstat structure and
add the new "-d" flag from D1626.
The man page will be updated in a subsequent commit.

Submitted by: will (earlier version)
Reviewed by: ken
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D1626


# e05c3a9f 24-Dec-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Since removal of oldnfs support linking to kvm is not needed anymore


# 9181358e 24-Apr-2015 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make nfsstat(1) build with WARNS=6.

Sponsored by: The FreeBSD Foundation


# 722e2552 23-Apr-2015 Edward Tomasz Napierala <trasz@FreeBSD.org>

Remove oldnfs support from nfsstat(1).

Reviewed by: rmacklem@ (earlier version)
Sponsored by: The FreeBSD Foundation


# 4e25c86f 18-Apr-2015 Edward Tomasz Napierala <trasz@FreeBSD.org>

Remove some oldnfs remnants.

Differential Revision: https://reviews.freebsd.org/D2287
Reviewed by: rmacklem@
Sponsored by: The FreeBSD Foundation


# 1809b04b 05-Feb-2014 John Baldwin <jhb@FreeBSD.org>

Use the DELTA() macro to tidy the server-side interval stats code a bit.

MFC after: 2 weeks


# 2fdfccfd 05-Feb-2014 John Baldwin <jhb@FreeBSD.org>

Partially revert r52493 and change client side interval statistics to
report the actual number of RPCs issued, not the theoretical number
that would be issued if all caching was disabled.

Reviewed by: rmacklem
MFC after: 2 weeks


# 7c44c114 09-Jun-2013 Rick Macklem <rmacklem@FreeBSD.org>

Modify nfsstat.c so that it prints out an error when a non-root
user attempts to use the "-m" option and it fails.

Requested by: danny@cs.huji.ac.il
MFC after: 2 weeks


# a6c903b8 01-Dec-2012 Rick Macklem <rmacklem@FreeBSD.org>

Add a "-m" option to nfsstat, which dumps out the
actual options used by all NFS mounts. Works for
the new/default NFS client only.

Reviewed by: alfred
MFC after: 2 weeks


# 70a8f993 22-Jul-2012 Hiroki Sato <hrs@FreeBSD.org>

Fix a bug which prevents "nfsstat -W" for server statistics from working.


# 002c2778 23-Aug-2011 Rick Macklem <rmacklem@FreeBSD.org>

Fix nfsstat(1) so that it prints out correct stats for the
new NFS server when the "-e" option is not used. The bug was
that srvrpccnt[] was being indexed by NFSPROC_XXX when it needs
to be indexed by NFSV4OP_XXX.

Tested by: hrs
Approved by: re (bz)


# 806f9b42 23-Aug-2011 Rick Macklem <rmacklem@FreeBSD.org>

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


# 1f376590 15-May-2011 Rick Macklem <rmacklem@FreeBSD.org>

Change the sysctl naming for the old and new NFS clients
to vfs.oldnfs.xxx and vfs.nfs.xxx respectively. This makes
the default nfs client use vfs.nfs.xxx after r221124.


# 6d0d87ca 05-May-2011 Ruslan Ermilov <ru@FreeBSD.org>

- Add a forgotten -o to usage().
- Sync usage() with manpage's SYNOPSIS.


# e85b7d75 04-May-2011 Rick Macklem <rmacklem@FreeBSD.org>

Modify nfsstat(1) so that it reports statistics for the
new NFS client/server by default, in a format compatible
with the old NFS client/server. Also add a "-o" flag that
forces nfsstat(1) to get statistics for the old NFS
client/server.


# c01be3b7 04-May-2011 Rick Macklem <rmacklem@FreeBSD.org>

Modify nfsstat(1) so that it prints out the buffer cache
stats in the same way for the new client as the old one.

MFC after: 2 weeks


# 0e8f7d19 04-May-2011 Rick Macklem <rmacklem@FreeBSD.org>

Fix nfsstat.c so that the "-z" option works for the new
NFS subsystem.

MFC after: 2 weeks


# 785b2572 04-May-2011 Rick Macklem <rmacklem@FreeBSD.org>

Revert r221308, since it incorrectly zero'd both client and
server stats when "-c" or "-s" was specified.


# d380a59d 01-May-2011 Rick Macklem <rmacklem@FreeBSD.org>

Fix nfsstat so that the "-z" option works for the
new NFS subsystem.

MFC after: 2 weeks


# 4898f742 13-Apr-2011 Ruslan Ermilov <ru@FreeBSD.org>

Show client's access cache statistics.


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 821df508 12-Dec-2009 Xin LI <delphij@FreeBSD.org>

Revert most part of 200420 as requested, as more review and polish is
needed.


# 6f2d3221 11-Dec-2009 Xin LI <delphij@FreeBSD.org>

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# 0775314b 24-Jun-2009 Doug Rabson <dfr@FreeBSD.org>

Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.


# db995e00 23-Jun-2009 Xin LI <delphij@FreeBSD.org>

Use C99 initialization when necessary; apply static to internal rountines.
This makes nfsstat WARNS=3 clean.


# 33f5882e 13-Jun-2009 Ed Schouten <ed@FreeBSD.org>

Include <sys/module.h> for modfind().

Submitted by: Pawel Worach


# 61a2fc1f 01-Jun-2009 Rick Macklem <rmacklem@FreeBSD.org>

Change the "-4" option flag to "-e" since it does not refer to IPv4
and to make it consistent with the flag used by nfsd and mountd.

Approved by: kib (mentor)


# bcdaa850 25-May-2009 Rick Macklem <rmacklem@FreeBSD.org>

Add the "-4" option to nfsstat, so that it will reports stats
for the experimental nfs subsystem when that option is specified.

Approved by: kib (mentor)


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 813947b7 18-Oct-2007 John Baldwin <jhb@FreeBSD.org>

Add a -z flag to nfsstat which zeros the NFS statistics after displaying
them.

MFC after: 1 week
Requested by: ps
Submitted by: ps (6 years ago)


# 70c3c978 11-Jul-2004 Stefan Farfeleder <stefanf@FreeBSD.org>

Fix a few cases that relied on 'implicit int' (constraint violation in C99).


# d3cb5ded 21-Mar-2002 Warner Losh <imp@FreeBSD.org>

remove __P


# 91196234 18-Sep-2001 Peter Wemm <peter@FreeBSD.org>

Userland part of nfs client/server split and cleanup.


# 9c9f2eef 25-May-2001 Thomas Moestl <tmm@FreeBSD.org>

Fix the error buffer passed to kvm_openfiles to have a correct length
of _POSIX2_LINE_MAX.

MFC after: 3 days


# f8d15d52 22-Mar-2001 Thomas Moestl <tmm@FreeBSD.org>

Take setgid kmem away from nfsstat, it has not needed it for some time
now.

Approved by: rwatson


# 62f882d6 04-Sep-2000 Warner Losh <imp@FreeBSD.org>

getopt and friends are declared in <unistd.h>
getopt returns -1 not EOF.


# 6e0442de 16-Dec-1999 David E. O'Brien <obrien@FreeBSD.org>

Options added in rev 1.14 were not documented in usage().


# 4893ef0b 25-Oct-1999 Matthew Dillon <dillon@FreeBSD.org>

Add -c, -s, and -W options to nfsstat. Improve interval output and add
wide-format option to get client-side ops and cache statistics on a single
line.

Change client side ops to the number of attempted ops, whether cached or
not, rather then just the number of rpc's that went through to the server.
This brings nfsstat inline with systat -vm and vmstat and reduces
confusion. The combined cache percentage stats now available via
'nfsstat -cW 1' becomes very useful.


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 83d8891d 25-Oct-1998 Bruce Evans <bde@FreeBSD.org>

Backout out previous commit. The bug was in the kernel.


# d6324f51 24-Oct-1998 Mike Smith <msmith@FreeBSD.org>

Use sysctlbyname() to locate the vfs.nfs.nfsstats node.
Submitted by: Daniel Rock <rock@cs.uni-sb.de>


# eae79dd1 19-Jan-1998 Bruce Evans <bde@FreeBSD.org>

Merged from Lite2. This was mostly already done, mostly indirectly
via wollman's changes in rev.1.2 being adopted by Lite2 and the
nfsv3 changes in rev.1.3 being adopted by both FreeBSD and Lite2.
We were only missing lookup of the type number for nfs (MOUNT_NFS
doesn't exist in Lite2).


# c44252b6 06-Jul-1997 Bruce Evans <bde@FreeBSD.org>

Finish importing Lite2's src/usr.bin, except for ex, diff, grep, mail,
pascal and vmstat.sparc. All changed files on the vendor branch should
already have been imported.


# 1c8af878 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# c115df18 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 782ff9b2 10-Mar-1996 Jeffrey Hsu <hsu@FreeBSD.org>

From Lite2: rename fs to vfs.


# 5a4838fc 30-Oct-1995 Poul-Henning Kamp <phk@FreeBSD.org>

<sys/user.h> -> <sys/time.h>

Spotted by: bde


# 52a28d70 29-Oct-1995 Poul-Henning Kamp <phk@FreeBSD.org>

#include <sys/user.h>


# a62dc406 27-Jun-1995 Doug Rabson <dfr@FreeBSD.org>

Changes to support version 3 of the NFS protocol.
The version 2 support has been tested (client+server) against FreeBSD-2.0,
IRIX 5.3 and FreeBSD-current (using a loopback mount). The version 2 support
is stable AFAIK.
The version 3 support has been tested with a loopback mount and minimally
against an IRIX 5.3 server. It needs more testing and may have problems.
I have patched amd to support the new variable length filehandles although
it will still only use version 2 of the protocol.

Before booting a kernel with these changes, nfs clients will need to at least
build and install /usr/sbin/mount_nfs. Servers will need to build and
install /usr/sbin/mountd.

NFS diskless support is untested.

Obtained from: Rick Macklem <rick@snowhite.cis.uoguelph.ca>


# 07e532e7 23-Oct-1994 Garrett Wollman <wollman@FreeBSD.org>

Use new NFS sysctl interface to get statistics rather than reading /dev/kmem,
unless the user specifies a dead kernel to operate on.


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources