diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-06-12 19:14:16 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-06-12 19:14:16 +0000 |
commit | 3d3206644e64e89ec391bfc42c96961e1bb9b527 (patch) | |
tree | f39a30ad8094bb56a7ef184f228dc9c1f7cbc6ab | |
parent | 251ec3348ff74e05e3b3031a9c76446282d245c4 (diff) |
add a statistic bit to count how often we change async to sync
you need to upgrade nfsstat and the relevant header files
ok beck@
-rw-r--r-- | sys/nfs/nfs.h | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_bio.c | 7 | ||||
-rw-r--r-- | usr.bin/nfsstat/nfsstat.c | 14 |
3 files changed, 15 insertions, 9 deletions
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h index 0e505e8b54b..437fced5ed0 100644 --- a/sys/nfs/nfs.h +++ b/sys/nfs/nfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs.h,v 1.30 2008/06/08 18:23:03 thib Exp $ */ +/* $OpenBSD: nfs.h,v 1.31 2008/06/12 19:14:15 thib Exp $ */ /* $NetBSD: nfs.h,v 1.10.4.1 1996/05/27 11:23:56 fvdl Exp $ */ /* @@ -198,6 +198,7 @@ struct nfsstats { uint64_t srvcache_idemdonehits; uint64_t srvcache_nonidemdonehits; uint64_t srvcache_misses; + uint64_t forcedsync; uint64_t srvnqnfs_leases; uint64_t srvnqnfs_maxleases; uint64_t srvnqnfs_getleases; diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index f03cb5fd64a..e71beddf1a8 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_bio.c,v 1.49 2008/06/12 16:04:37 art Exp $ */ +/* $OpenBSD: nfs_bio.c,v 1.50 2008/06/12 19:14:15 thib Exp $ */ /* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */ /* @@ -548,7 +548,8 @@ nfs_asyncio(bp) int i; if (nfs_numasync == 0) - return (EIO); + goto out; + for (i = 0; i < NFS_MAXASYNCDAEMON; i++) { if (nfs_iodwant[i]) { if ((bp->b_flags & B_READ) == 0) { @@ -562,6 +563,8 @@ nfs_asyncio(bp) } } +out: + nfsstats.forcedsync++; return (EIO); } diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index ac7aebff664..3b7992e156d 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfsstat.c,v 1.29 2006/04/03 06:40:14 deraadt Exp $ */ +/* $OpenBSD: nfsstat.c,v 1.30 2008/06/12 19:14:15 thib Exp $ */ /* $NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = static char sccsid[] = "from: @(#)nfsstat.c 8.1 (Berkeley) 6/6/93"; static char *rcsid = "$NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $"; #else -static char *rcsid = "$OpenBSD: nfsstat.c,v 1.29 2006/04/03 06:40:14 deraadt Exp $"; +static char *rcsid = "$OpenBSD: nfsstat.c,v 1.30 2008/06/12 19:14:15 thib Exp $"; #endif #endif /* not lint */ @@ -250,14 +250,16 @@ intpr(u_int display) nfsstats.rpccnt[NFSPROC_PATHCONF], nfsstats.rpccnt[NFSPROC_COMMIT]); printf("Rpc Info:\n"); - printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n", - "TimedOut", "Invalid", "X Replies", "Retries", "Requests"); - printf("%9llu %9llu %9llu %9llu %9llu\n", + printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", + "TimedOut", "Invalid", "X Replies", "Retries", "Requests", + "FrcSync"); + printf("%9llu %9llu %9llu %9llu %9llu %9llu\n", nfsstats.rpctimeouts, nfsstats.rpcinvalid, nfsstats.rpcunexpected, nfsstats.rpcretries, - nfsstats.rpcrequests); + nfsstats.rpcrequests, + nfsstats.forcedsync); printf("Cache Info:\n"); printf("%9.9s %9.9s %9.9s %9.9s", "Attr Hits", "Misses", "Lkup Hits", "Misses"); |