From 0151cb9b67dfedba0b393f23a6bb2173c9d31d96 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 31 Jan 2005 04:14:45 +0000 Subject: [PATCH] STABLE14-fs-busy-stats-20050113 add support for counting number of vbusies returned (cherry picked from commit d9e55baca180891ef999919118a5ad2d73764abb) --- src/rx/rx.c | 3 +++ src/rx/rx.h | 3 ++- src/viced/afsfileprocs.c | 13 ++++++++++++- src/viced/fs_stats.h | 5 ++++- src/xstat/xstat_fs_test.c | 4 +++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 27adda19f..19b14fb89 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -2673,6 +2673,9 @@ rxi_ReceivePacket(register struct rx_packet *np, osi_socket socket, MUTEX_ENTER(&conn->conn_data_lock); conn->refCount--; MUTEX_EXIT(&conn->conn_data_lock); + MUTEX_ENTER(&rx_stats_mutex); + rx_stats.nBusies++; + MUTEX_EXIT(&rx_stats_mutex); return tp; } rxi_KeepAliveOn(call); diff --git a/src/rx/rx.h b/src/rx/rx.h index e34ff3ecf..03c035e32 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -804,7 +804,8 @@ struct rx_stats { /* General rx statistics */ int ignorePacketDally; /* packets dropped because call is in dally state */ int receiveCbufPktAllocFailures; int sendCbufPktAllocFailures; - int spares[5]; + int nBusies; + int spares[4]; }; /* structures for debug input and output packets */ diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index ac8fe9f73..4ce6a6995 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -483,11 +483,21 @@ CheckVnode(AFSFid * fid, Volume ** volptr, Vnode ** vptr, int lock) /* I'm not really worried about when we restarted, I'm */ /* just worried about when the first VBUSY was returned. */ TM_GetTimeOfDay(&restartedat, 0); + if (busyonrst) { + FS_LOCK; + afs_perfstats.fs_nBusies++; + FS_UNLOCK; + } return (busyonrst ? VBUSY : VRESTARTING); } else { struct timeval now; TM_GetTimeOfDay(&now, 0); if ((now.tv_sec - restartedat.tv_sec) < (11 * 60)) { + if (busyonrst) { + FS_LOCK; + afs_perfstats.fs_nBusies++; + FS_UNLOCK; + } return (busyonrst ? VBUSY : VRESTARTING); } else { return (VRESTARTING); @@ -5640,7 +5650,8 @@ FillPerfValues(struct afs_PerfStats *a_perfP) a_perfP->host_ClientBlocks = CEBlocks; a_perfP->sysname_ID = afs_perfstats.sysname_ID; - + a_perfP->rx_nBusies = (afs_int32) rx_stats.nBusies; + a_perfP->fs_nBusies = afs_perfstats.fs_nBusies; } /*FillPerfValues */ diff --git a/src/viced/fs_stats.h b/src/viced/fs_stats.h index fe13b539f..1e0309e03 100644 --- a/src/viced/fs_stats.h +++ b/src/viced/fs_stats.h @@ -123,10 +123,13 @@ struct afs_PerfStats { */ afs_int32 sysname_ID; /*Unique hardware/OS identifier */ + afs_int32 rx_nBusies; /*Ttl VBUSYs sent to shed load */ + afs_int32 fs_nBusies; /*Ttl VBUSYs sent during restart/vol clone */ + /* * Spares */ - afs_int32 spare[31]; + afs_int32 spare[29]; }; #if FS_STATS_DETAILED diff --git a/src/xstat/xstat_fs_test.c b/src/xstat/xstat_fs_test.c index cd57a4d4c..a1b490ecc 100644 --- a/src/xstat/xstat_fs_test.c +++ b/src/xstat/xstat_fs_test.c @@ -246,8 +246,10 @@ PrintOverallPerfInfo(struct afs_PerfStats *a_ovP) printf("\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns); printf("\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs); printf("\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs); - printf("\t%10d rx_nFreeCallStructs\n\n", a_ovP->rx_nFreeCallStructs); + printf("\t%10d rx_nFreeCallStructs\n", a_ovP->rx_nFreeCallStructs); + printf("\t%10d rx_nBusies\n\n", a_ovP->rx_nBusies); + printf("\t%10d fs_nBusies\n\n", a_ovP->fs_nBusies); /* * Host module fields. */ -- 2.39.5