From: Derrick Brashear Date: Fri, 17 Sep 2004 14:35:51 +0000 (+0000) Subject: rx-stats-calls-waited-ever-20040917 X-Git-Tag: BP-disconnected~247 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=cbe0d7cc1daca4a2d9a634f7cdb8da8d01ad050d rx-stats-calls-waited-ever-20040917 keep track of the number of calls which have waited for a thread ever (not just those waiting now) update rxdebug to be able to print it. --- diff --git a/src/rx/rx.c b/src/rx/rx.c index 2ae09e0..ff61760 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -3984,6 +3984,7 @@ rxi_AttachServerProc(register struct rx_call *call, call->flags |= RX_CALL_WAIT_PROC; MUTEX_ENTER(&rx_stats_mutex); rx_nWaiting++; + rx_nWaited++; MUTEX_EXIT(&rx_stats_mutex); rxi_calltrace(RX_CALL_ARRIVAL, call); SET_CALL_QUEUE_LOCK(call, &rx_serverPool_lock); @@ -6218,6 +6219,9 @@ rx_GetServerDebug(osi_socket socket, afs_uint32 remoteAddr, if (stat->version >= RX_DEBUGI_VERSION_W_GETPEER) { *supportedValues |= RX_SERVER_DEBUG_ALL_PEER; } + if (stat->version >= RX_DEBUGI_VERSION_W_WAITED) { + *supportedValues |= RX_SERVER_DEBUG_WAITED_CNT; + } stat->nFreePackets = ntohl(stat->nFreePackets); stat->packetReclaims = ntohl(stat->packetReclaims); diff --git a/src/rx/rx.h b/src/rx/rx.h index c4da375..c27fbdb 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -817,7 +817,7 @@ struct rx_debugIn { #define RX_DEBUGI_BADTYPE (-8) #define RX_DEBUGI_VERSION_MINIMUM ('L') /* earliest real version */ -#define RX_DEBUGI_VERSION ('Q') /* Latest version */ +#define RX_DEBUGI_VERSION ('R') /* Latest version */ /* first version w/ secStats */ #define RX_DEBUGI_VERSION_W_SECSTATS ('L') /* version M is first supporting GETALLCONN and RXSTATS type */ @@ -829,6 +829,7 @@ struct rx_debugIn { #define RX_DEBUGI_VERSION_W_IDLETHREADS ('O') #define RX_DEBUGI_VERSION_W_NEWPACKETTYPES ('P') #define RX_DEBUGI_VERSION_W_GETPEER ('Q') +#define RX_DEBUGI_VERSION_W_WAITED ('R') #define RX_DEBUGI_GETSTATS 1 /* get basic rx stats */ #define RX_DEBUGI_GETCONN 2 /* get connection info */ @@ -846,7 +847,8 @@ struct rx_debugStats { char spare1; afs_int32 nWaiting; afs_int32 idleThreads; /* Number of server threads that are idle */ - afs_int32 spare2[8]; + afs_int32 nWaited; + afs_int32 spare2[7]; }; struct rx_debugConn_vL { @@ -971,6 +973,7 @@ extern int rx_callHoldType; #define RX_SERVER_DEBUG_OLD_CONN 0x20 #define RX_SERVER_DEBUG_NEW_PACKETS 0x40 #define RX_SERVER_DEBUG_ALL_PEER 0x80 +#define RX_SERVER_DEBUG_WAITED_CNT 0x100 #define AFS_RX_STATS_CLEAR_ALL 0xffffffff #define AFS_RX_STATS_CLEAR_INVOCATIONS 0x1 diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index a492d11..b47f4a8 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -151,6 +151,7 @@ EXT afs_kmutex_t rx_freePktQ_lock; EXT int rx_nFreePackets INIT(0); EXT int rxi_NeedMorePackets INIT(0); EXT int rx_nWaiting INIT(0); +EXT int rx_nWaited INIT(0); EXT int rx_packetReclaims INIT(0); /* largest packet which we can safely receive, initialized to AFS 3.2 value diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 7497774..298cf20 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -1160,6 +1160,7 @@ rxi_ReceiveDebugPacket(register struct rx_packet *ap, osi_socket asocket, tstat.packetReclaims = htonl(rx_packetReclaims); tstat.usedFDs = CountFDs(64); tstat.nWaiting = htonl(rx_nWaiting); + tstat.nWaited = htonl(rx_nWaited); queue_Count(&rx_idleServerQueue, np, nqe, rx_serverQueueEntry, tstat.idleThreads); MUTEX_EXIT(&rx_serverPool_lock); diff --git a/src/rx/rxdebug.c b/src/rx/rxdebug.c index db94347..587e80c 100644 --- a/src/rx/rxdebug.c +++ b/src/rx/rxdebug.c @@ -109,6 +109,7 @@ MainCommand(as, arock) int withRxStats; int withWaiters; int withIdleThreads; + int withWaited; int withPeers; struct rx_debugStats tstats; char *portName, *hostName; @@ -253,6 +254,7 @@ MainCommand(as, arock) withRxStats = (supportedDebugValues & RX_SERVER_DEBUG_RX_STATS); withWaiters = (supportedDebugValues & RX_SERVER_DEBUG_WAITER_CNT); withIdleThreads = (supportedDebugValues & RX_SERVER_DEBUG_IDLE_THREADS); + withIdleThreads = (supportedDebugValues & RX_SERVER_DEBUG_WAITED_CNT); withPeers = (supportedDebugValues & RX_SERVER_DEBUG_ALL_PEER); printf("Free packets: %d, packet reclaims: %d, calls: %d, used FDs: %d\n", @@ -265,6 +267,8 @@ MainCommand(as, arock) printf("%d calls waiting for a thread\n", tstats.nWaiting); if (withIdleThreads) printf("%d threads are idle\n", tstats.idleThreads); + if (withWaited) + printf("%d calls have waited for a thread\n", tstats.nWaited); if (rxstats) { if (!withRxStats) {