Commit graph

71 commits

Author SHA1 Message Date
Lexi Winter f79b200b6a nfsstat: make -q work without -e/-E
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/961
2023-12-28 13:27:07 -07:00
Lexi Winter 30ce26cacf 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
2023-12-27 10:57:59 -07:00
Warner Losh 0b8224d1cc 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
2023-11-26 22:23:58 -07:00
Warner Losh bdcbfde31e 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
2023-11-26 22:23:30 -07:00
John Baldwin eba230afba 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
2023-09-25 07:54:56 -07:00
Alfonso Gregory 1a7ac2bd24 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
2023-07-07 10:45:18 -06:00
Rick Macklem d92dc803f6 nfsstat: Add an entry to output NFSPROC_APPENDWRITE count
Commit 5218d82c81 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.
2022-05-28 16:27:02 -07:00
Rick Macklem 75c666197c 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
2021-11-14 13:36:14 -08:00
Gordon Bergling 72a92f91f4 nfsstat(1): Fix a typo in an error message
- s/priviledged/privileged/

MFC after:	1 week
2021-08-23 09:21:28 +02:00
Alan Somers b3baff23fe 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
2020-10-24 05:52:29 +00:00
Alan Somers dc2541703c 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
2020-09-02 17:36:30 +00:00
Rick Macklem 28a04da3d7 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.
2019-12-31 22:19:33 +00:00
Rick Macklem 29001a810a 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.
2019-12-31 00:07:10 +00:00
Rick Macklem 309c8f7673 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.
2019-12-22 00:12:22 +00:00
Rick Macklem b5965b56e8 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
2019-07-28 21:44:01 +00:00
Rick Macklem a16e0d4468 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
2019-04-13 23:26:02 +00:00
Emmanuel Vadot 2145d321ac 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
2018-01-30 09:59:52 +00:00
Rick Macklem 2d44649837 Add RPC count reporting for the two new RPCs added by r320322.
This is a content change.

PR:		219550
MFC after:	2 weeks
2017-06-24 20:09:23 +00:00
Warner Losh fbbd9655e5 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
2017-02-28 23:42:47 +00:00
Rick Macklem 0744a2b00e 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
2016-11-26 20:47:11 +00:00
Rick Macklem 684d18c9ae Fix r304026 so that it builds for gcc.
Reported by:	np
Tested by:	np
MFC after:	1 month
2016-08-16 00:48:13 +00:00
Rick Macklem 693957f886 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
2016-08-13 20:14:44 +00:00
Baptiste Daroussin e05c3a9f6a Since removal of oldnfs support linking to kvm is not needed anymore 2015-12-24 11:41:21 +00:00
Edward Tomasz Napierala 9181358e8a Make nfsstat(1) build with WARNS=6.
Sponsored by:	The FreeBSD Foundation
2015-04-24 07:57:59 +00:00
Edward Tomasz Napierala 722e25522e Remove oldnfs support from nfsstat(1).
Reviewed by:	rmacklem@ (earlier version)
Sponsored by:	The FreeBSD Foundation
2015-04-23 14:36:01 +00:00
Edward Tomasz Napierala 4e25c86f4c Remove some oldnfs remnants.
Differential Revision:	https://reviews.freebsd.org/D2287
Reviewed by:	rmacklem@
Sponsored by:	The FreeBSD Foundation
2015-04-18 16:08:06 +00:00
John Baldwin 1809b04b69 Use the DELTA() macro to tidy the server-side interval stats code a bit.
MFC after:	2 weeks
2014-02-05 14:44:59 +00:00
John Baldwin 2fdfccfd7c 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
2014-02-05 14:33:22 +00:00
Rick Macklem 7c44c1146b 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
2013-06-09 21:54:19 +00:00
Rick Macklem a6c903b8d4 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
2012-12-02 01:20:43 +00:00
Hiroki Sato 70a8f993c0 Fix a bug which prevents "nfsstat -W" for server statistics from working. 2012-07-22 18:59:31 +00:00
Rick Macklem 002c2778b1 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)
2011-08-23 13:44:56 +00:00
Rick Macklem 806f9b4262 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
2011-08-23 13:17:09 +00:00
Rick Macklem 1f3765902c 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.
2011-05-15 20:52:43 +00:00
Ruslan Ermilov 6d0d87ca78 - Add a forgotten -o to usage().
- Sync usage() with manpage's SYNOPSIS.
2011-05-05 10:17:49 +00:00
Rick Macklem e85b7d75a4 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.
2011-05-04 20:13:26 +00:00
Rick Macklem c01be3b713 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
2011-05-04 19:28:44 +00:00
Rick Macklem 0e8f7d1995 Fix nfsstat.c so that the "-z" option works for the new
NFS subsystem.

MFC after:	2 weeks
2011-05-04 13:50:37 +00:00
Rick Macklem 785b257239 Revert r221308, since it incorrectly zero'd both client and
server stats when "-c" or "-s" was specified.
2011-05-04 13:20:44 +00:00
Rick Macklem d380a59d3d Fix nfsstat so that the "-z" option works for the
new NFS subsystem.

MFC after:	2 weeks
2011-05-01 23:41:35 +00:00
Ruslan Ermilov 4898f742c7 Show client's access cache statistics. 2011-04-13 13:05:48 +00:00
Joel Dahl da52b4caaf 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
2010-12-11 08:32:16 +00:00
Xin LI 821df508e8 Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
Xin LI 6f2d322192 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
Doug Rabson 0775314b63 Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.
2009-06-24 18:42:21 +00:00
Xin LI db995e0027 Use C99 initialization when necessary; apply static to internal rountines.
This makes nfsstat WARNS=3 clean.
2009-06-23 23:18:19 +00:00
Ed Schouten 33f5882ec0 Include <sys/module.h> for modfind().
Submitted by:	Pawel Worach
2009-06-14 12:47:27 +00:00
Rick Macklem 61a2fc1fbb 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)
2009-06-01 20:34:00 +00:00
Rick Macklem bcdaa85069 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)
2009-05-25 15:48:10 +00:00
John Baldwin 813947b737 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)
2007-10-18 16:38:07 +00:00