Date: Fri, 19 Jan 2024 20:24:20 GMT From: Alan Somers <asomers@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 1726e4ced900 - stable/13 - nfsstat: make -q work without -e/-E Message-ID: <202401192024.40JKOK7l017258@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1726e4ced9009b516bdb276234718489c1a0e05f commit 1726e4ced9009b516bdb276234718489c1a0e05f Author: Lexi Winter <lexi@le-fay.org> AuthorDate: 2023-12-28 12:56:57 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2024-01-19 20:23:42 +0000 nfsstat: make -q work without -e/-E Pull Request: https://github.com/freebsd/freebsd-src/pull/961 (cherry picked from commit f79b200b6aefb9bdcbe931c5b7ea604e259beee0) --- usr.bin/nfsstat/nfsstat.1 | 4 ++-- usr.bin/nfsstat/nfsstat.c | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.1 b/usr.bin/nfsstat/nfsstat.1 index f51e2662636d..200b2fc2f6ef 100644 --- a/usr.bin/nfsstat/nfsstat.1 +++ b/usr.bin/nfsstat/nfsstat.1 @@ -27,7 +27,7 @@ .\" .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" -.Dd December 27, 2023 +.Dd December 28, 2023 .Dt NFSSTAT 1 .Os .Sh NAME @@ -119,7 +119,7 @@ second intervals. .It Fl z Reset statistics after displaying them. .It Fl q -Do not print header +Do not print headers. .It Fl -libxo Generate output via .Xr libxo 3 diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index e7e9850eb943..ebe1e21cccc5 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -282,7 +282,8 @@ intpr(int clientOnly, int serverOnly) xo_emit("{T:Client Info:\n"); xo_open_container("operations"); - xo_emit("{T:Rpc Counts:}\n"); + if (printtitle) + xo_emit("{T:Rpc Counts:}\n"); xo_emit("{T:Getattr/%13.13s}{T:Setattr/%13.13s}" "{T:Lookup/%13.13s}{T:Readlink/%13.13s}" @@ -333,7 +334,8 @@ intpr(int clientOnly, int serverOnly) xo_close_container("operations"); xo_open_container("rpcs"); - xo_emit("{T:Rpc Info:}\n"); + if (printtitle) + xo_emit("{T:Rpc Info:}\n"); xo_emit("{T:TimedOut/%13.13s}{T:Invalid/%13.13s}" "{T:X Replies/%13.13s}{T:Retries/%13.13s}" @@ -349,7 +351,8 @@ intpr(int clientOnly, int serverOnly) xo_close_container("rpcs"); xo_open_container("cache"); - xo_emit("{T:Cache Info:}\n"); + if (printtitle) + xo_emit("{T:Cache Info:}\n"); xo_emit("{T:Attr Hits/%13.13s}{T:Attr Misses/%13.13s}" "{T:Lkup Hits/%13.13s}{T:Lkup Misses/%13.13s}" @@ -396,7 +399,8 @@ intpr(int clientOnly, int serverOnly) if (serverOnly) { xo_open_container("serverstats"); - xo_emit("{T:Server Info:}\n"); + if (printtitle) + xo_emit("{T:Server Info:}\n"); xo_open_container("operations"); xo_emit("{T:Getattr/%13.13s}{T:Setattr/%13.13s}" @@ -449,7 +453,8 @@ intpr(int clientOnly, int serverOnly) xo_open_container("server"); - xo_emit("{T:Server Write Gathering:/%13.13s}\n"); + if (printtitle) + xo_emit("{T:Server Write Gathering:/%13.13s}\n"); xo_emit("{T:WriteOps/%13.13s}{T:WriteRPC/%13.13s}" "{T:Opsaved/%13.13s}\n"); @@ -465,7 +470,8 @@ intpr(int clientOnly, int serverOnly) xo_close_container("server"); xo_open_container("cache"); - xo_emit("{T:Server Cache Stats:/%13.13s}\n"); + if (printtitle) + xo_emit("{T:Server Cache Stats:/%13.13s}\n"); xo_emit("{T:Inprog/%13.13s}" "{T:Non-Idem/%13.13s}{T:Misses/%13.13s}\n"); xo_emit("{:inprog/%13ju}{:nonidem/%13ju}{:misses/%13ju}\n",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401192024.40JKOK7l017258>