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.
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);
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);
#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 */
#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 */
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 {
#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
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
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);
int withRxStats;
int withWaiters;
int withIdleThreads;
+ int withWaited;
int withPeers;
struct rx_debugStats tstats;
char *portName, *hostName;
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",
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) {