1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

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@
This commit is contained in:
thib 2008-06-12 19:14:15 +00:00
parent 37c260f458
commit 0d5eae4776
3 changed files with 15 additions and 9 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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");