]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-rx-packet-count-debugging-20090104
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 5 Jan 2009 00:00:20 +0000 (00:00 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 5 Jan 2009 00:00:20 +0000 (00:00 +0000)
LICENSE MIT

change C preprocessor symbol required for packet count debugging
to RXDEBUG_PACKET

(cherry picked from commit 02cd4c510b2b9e2293e33372c39bd8b62089236b)

src/rx/rx.c
src/rx/rx.h
src/rx/rx_packet.c
src/rx/rx_packet.h
src/rx/rx_rdwr.c

index 8c04ba2ae3bad5dd99c66e6212542e91b75e0a0d..99575856575fb7c03e247367430750faef2ad867 100644 (file)
@@ -2013,9 +2013,9 @@ rx_EndCall(register struct rx_call *call, afs_int32 rc)
     call->nLeft = call->nFree = call->curlen = 0;
 
     /* Free any packets from the last call to ReadvProc/WritevProc */
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
         rxi_FreePackets(0, &call->iovq);
 
     CALL_RELE(call, RX_CALL_REFCOUNT_BEGIN);
@@ -2195,11 +2195,11 @@ rxi_NewCall(register struct rx_connection *conn, register int channel)
     } else {
 
        call = (struct rx_call *)rxi_Alloc(sizeof(struct rx_call));
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->allNextp = rx_allCallsp;
         rx_allCallsp = call;
         call->call_id = 
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rx_MutexIncrement(rx_stats.nCallStructs, rx_stats_mutex);
         
         MUTEX_EXIT(&rx_freeCallQueue_lock);
@@ -2213,9 +2213,9 @@ rxi_NewCall(register struct rx_connection *conn, register int channel)
        queue_Init(&call->tq);
        queue_Init(&call->rq);
        queue_Init(&call->iovq);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->rqc = call->tqc = call->iovqc = 0;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
        /* Bind the call to its connection structure (prereq for reset) */
        call->conn = conn;
        rxi_ResetCall(call, 1);
@@ -3297,9 +3297,9 @@ rxi_ReceiveDataPacket(register struct rx_call *call,
             * the reader once all packets have been processed */
            np->flags |= RX_PKTFLAG_RQ;
            queue_Prepend(&call->rq, np);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
             call->rqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
            call->nSoftAcks++;
            np = NULL;          /* We can't use this anymore */
            newPackets = 1;
@@ -3429,9 +3429,9 @@ rxi_ReceiveDataPacket(register struct rx_call *call,
             * queue head if the queue is empty or the packet should be
             * appended. */
             np->flags |= RX_PKTFLAG_RQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
             call->rqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
            queue_InsertBefore(tp, np);
            call->nSoftAcks++;
            np = NULL;
@@ -3750,9 +3750,9 @@ rxi_ReceiveAckPacket(register struct rx_call *call, struct rx_packet *np,
        {
            queue_Remove(tp);
            tp->flags &= ~RX_PKTFLAG_TQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
             call->tqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
            rxi_FreePacket(tp); /* rxi_FreePacket mustn't wake up anyone, preemptively. */
        }
     }
@@ -4366,9 +4366,9 @@ rxi_ClearTransmitQueue(register struct rx_call *call, register int force)
        }
     } else {
 #endif /* AFS_GLOBAL_RXLOCK_KERNEL */
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->tqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->tq);
 #ifdef AFS_GLOBAL_RXLOCK_KERNEL
        call->flags &= ~RX_CALL_TQ_CLEARME;
@@ -4398,7 +4398,7 @@ rxi_ClearReceiveQueue(register struct rx_call *call)
         
         count = rxi_FreePackets(0, &call->rq);
        rx_packetReclaims += count;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->rqc -= count;
         if ( call->rqc != 0 ) 
             dpf(("rxi_ClearReceiveQueue call %x rqc %u != 0", call, call->rqc));
@@ -4654,14 +4654,14 @@ rxi_ResetCall(register struct rx_call *call, register int newcall)
         call->currentPacket->flags &= ~RX_PKTFLAG_CP;
         call->currentPacket->flags |= RX_PKTFLAG_IOVQ;
         queue_Prepend(&call->iovq, call->currentPacket);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
         call->currentPacket = (struct rx_packet *)0;
     }
     call->curlen = call->nLeft = call->nFree = 0;
 
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     call->iovqc -= 
 #endif
         rxi_FreePackets(0, &call->iovq);
@@ -5435,7 +5435,7 @@ rxi_Start(struct rxevent *event,
                            && (p->flags & RX_PKTFLAG_ACKED)) {
                            queue_Remove(p);
                            p->flags &= ~RX_PKTFLAG_TQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                             call->tqc--;
 #endif
                            rxi_FreePacket(p);
@@ -7987,7 +7987,7 @@ DllMain(HINSTANCE dllInstHandle,  /* instance handle for this DLL module */
 #ifdef AFS_NT40_ENV
 int rx_DumpCalls(FILE *outputFile, char *cookie)
 {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     int zilch;
 #ifdef KDUMP_RX_LOCK
     struct rx_call_rx_lock *c;
@@ -8040,7 +8040,7 @@ int rx_DumpCalls(FILE *outputFile, char *cookie)
     }
     sprintf(output, "%s - End dumping all Rx Calls\r\n", cookie);
     WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
     return 0;
 }
 #endif /* AFS_NT40_ENV */
index 3cc83d07a3c0fdcd06553d843574f5e3e7065f56..02240646a8b86dc23acb45e09bb8f7770688cdeb 100644 (file)
@@ -547,7 +547,7 @@ struct rx_call {
     afs_hyper_t bytesRcvd;     /* Number bytes received */
     u_short tqWaiters;
 
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     u_short tqc;                /* packet count in tq */
     u_short rqc;                /* packet count in rq */
     u_short iovqc;              /* packet count in iovq */
index 0d4747e4d711322313e4a30a6864c977f7cfc265..1113ba9e8c5e07e776687ea46563b80b3f415e55 100644 (file)
@@ -99,7 +99,7 @@ RCSID
 static int rxdb_fileID = RXDB_FILE_RX_PACKET;
 #endif /* RX_LOCKS_DB */
 static struct rx_packet *rx_mallocedP = 0;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
 static afs_uint32       rx_packet_id = 0;
 #endif
 
@@ -565,10 +565,10 @@ rxi_MorePackets(int apackets)
 
         NETPRI;
         MUTEX_ENTER(&rx_freePktQ_lock);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         p->packetId = rx_packet_id++;
         p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
         rx_mallocedP = p;
         MUTEX_EXIT(&rx_freePktQ_lock);
         USERPRI;
@@ -610,10 +610,10 @@ rxi_MorePackets(int apackets)
        p->niovecs = 2;
 
        queue_Append(&rx_freePacketQueue, p);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         p->packetId = rx_packet_id++;
         p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
        rx_mallocedP = p;
     }
 
@@ -656,10 +656,10 @@ rxi_MorePacketsTSFPQ(int apackets, int flush_global, int num_keep_local)
        
         NETPRI;
         MUTEX_ENTER(&rx_freePktQ_lock);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         p->packetId = rx_packet_id++;
         p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
         rx_mallocedP = p;
         MUTEX_EXIT(&rx_freePktQ_lock);
         USERPRI;
@@ -717,10 +717,10 @@ rxi_MorePacketsNoLock(int apackets)
        p->niovecs = 2;
 
        queue_Append(&rx_freePacketQueue, p);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         p->packetId = rx_packet_id++;
         p->allNextp = rx_mallocedP;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
        rx_mallocedP = p;
     }
 
@@ -2749,7 +2749,7 @@ rxi_AdjustDgramPackets(int frags, int mtu)
  */
 int rx_DumpPackets(FILE *outputFile, char *cookie)
 {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     int zilch;
     struct rx_packet *p;
     char output[2048];
@@ -2774,7 +2774,7 @@ int rx_DumpPackets(FILE *outputFile, char *cookie)
 
     MUTEX_EXIT(&rx_freePktQ_lock);
     USERPRI;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
     return 0;
 }
 #endif /* AFS_NT40_ENV */
index cdaedbf873fcf0f6b61c8214072075ae13aeee7e..dad44b94f763a303defbf2b9375c01b9818437c5 100644 (file)
@@ -271,7 +271,7 @@ struct rx_packet {
     afs_uint32 wirehead[RX_HEADER_SIZE / sizeof(afs_int32)];
     afs_uint32 localdata[RX_CBUFFERSIZE / sizeof(afs_int32)];
     afs_uint32 extradata[RX_EXTRABUFFERSIZE / sizeof(afs_int32)];
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     /* For debugging */
     struct rx_packet *allNextp; /* A list of all packets */
     afs_uint32  packetId;       /* An unique id number for debugging */
index db5fb779bce19bd508832b25ae3e497ebef72fcd..3ded6c30e9b60288614b9cad1995442e1dfcf581 100644 (file)
@@ -114,9 +114,9 @@ rxi_ReadProc(register struct rx_call *call, register char *buf,
 
     /* Free any packets from the last call to ReadvProc/WritevProc */
     if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -141,9 +141,9 @@ rxi_ReadProc(register struct rx_call *call, register char *buf,
                        register struct rx_connection *conn = call->conn;
                        queue_Remove(rp);
                        rp->flags &= ~RX_PKTFLAG_RQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                         call->rqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
 
                        /* RXS_CheckPacket called to undo RXS_PreparePacket's
                         * work.  It may reduce the length of the packet by up
@@ -317,9 +317,9 @@ rx_ReadProc(struct rx_call *call, char *buf, int nbytes)
      * ReadvProc/WritevProc.
      */
     if (!queue_IsEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -377,9 +377,9 @@ rx_ReadProc32(struct rx_call *call, afs_int32 * value)
      * ReadvProc/WritevProc.
      */
     if (!queue_IsEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -453,9 +453,9 @@ rxi_FillReadVec(struct rx_call *call, afs_uint32 serial)
                    register struct rx_connection *conn = call->conn;
                    queue_Remove(rp);
                    rp->flags &= ~RX_PKTFLAG_RQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                     call->rqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
 
                    /* RXS_CheckPacket called to undo RXS_PreparePacket's
                     * work.  It may reduce the length of the packet by up
@@ -537,9 +537,9 @@ rxi_FillReadVec(struct rx_call *call, afs_uint32 serial)
                 curp->flags &= ~RX_PKTFLAG_CP;
                 curp->flags |= RX_PKTFLAG_IOVQ;
                queue_Append(&call->iovq, curp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                 call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
                curp = call->currentPacket = (struct rx_packet *)0;
            } else if (!call->curlen) {
                /* need to get another struct iov */
@@ -549,9 +549,9 @@ rxi_FillReadVec(struct rx_call *call, afs_uint32 serial)
                    curp->flags &= ~RX_PKTFLAG_CP;
                    curp->flags |= RX_PKTFLAG_IOVQ;
                    queue_Append(&call->iovq, curp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                     call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
                    curp = call->currentPacket = (struct rx_packet *)0;
                    call->nLeft = 0;
                } else {
@@ -611,9 +611,9 @@ rxi_ReadvProc(struct rx_call *call, struct iovec *iov, int *nio, int maxio,
 
     /* Free any packets from the last call to ReadvProc/WritevProc */
     if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -696,9 +696,9 @@ rxi_WriteProc(register struct rx_call *call, register char *buf,
 
     /* Free any packets from the last call to ReadvProc/WritevProc */
     if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -754,9 +754,9 @@ rxi_WriteProc(register struct rx_call *call, register char *buf,
                rxi_PrepareSendPacket(call, cp, 0);
                cp->flags |= RX_PKTFLAG_TQ;
                queue_Append(&call->tq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                 call->tqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
                 cp = (struct rx_packet *)0;
                if (!
                    (call->
@@ -884,9 +884,9 @@ rx_WriteProc(struct rx_call *call, char *buf, int nbytes)
      * ReadvProc/WritevProc.
      */
     if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -934,9 +934,9 @@ rx_WriteProc32(register struct rx_call *call, register afs_int32 * value)
      * ReadvProc/WritevProc.
      */
     if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -997,9 +997,9 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio,
 
     /* Free any packets from the last call to ReadvProc/WritevProc */
     if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -1037,9 +1037,9 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio,
            }
            cp->flags |= RX_PKTFLAG_IOVQ;
            queue_Append(&call->iovq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
             call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
            tnFree = cp->length;
            tcurvec = 1;
            tcurpos =
@@ -1121,7 +1121,7 @@ rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
     int nextio;
     int requestCount;
     struct rx_queue tmpq;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     u_short tmpqc;
 #endif
 
@@ -1149,14 +1149,14 @@ rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
             cp->flags &= ~RX_PKTFLAG_CP;
             cp->flags |= RX_PKTFLAG_IOVQ;
            queue_Prepend(&call->iovq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
             call->iovqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
            cp = call->currentPacket = (struct rx_packet *)0;
        }
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
        return 0;
     }
@@ -1168,9 +1168,9 @@ rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
      * a zero length write will push a short packet. */
     nextio = 0;
     queue_Init(&tmpq);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
     tmpqc = 0;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
     do {
        if (call->nFree == 0 && cp) {
            clock_NewTime();    /* Bogus:  need new time package */
@@ -1181,27 +1181,27 @@ rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
            hadd32(call->bytesSent, cp->length);
            rxi_PrepareSendPacket(call, cp, 0);
            queue_Append(&tmpq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
             tmpqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             cp = call->currentPacket = (struct rx_packet *)0;
 
            /* The head of the iovq is now the current packet */
            if (nbytes) {
                if (queue_IsEmpty(&call->iovq)) {
                    call->error = RX_PROTOCOL_ERROR;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                     tmpqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
                         rxi_FreePackets(0, &tmpq);
                    return 0;
                }
                cp = queue_First(&call->iovq, rx_packet);
                queue_Remove(cp);
                 cp->flags &= ~RX_PKTFLAG_IOVQ;
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                 call->iovqc--;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
                 cp->flags |= RX_PKTFLAG_CP;
                call->currentPacket = cp;
                call->nFree = cp->length;
@@ -1222,14 +1222,14 @@ rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
                if (cp) {
                    cp->flags &= ~RX_PKTFLAG_CP;
                     queue_Prepend(&tmpq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                     tmpqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
                     cp = call->currentPacket = (struct rx_packet *)0;
                }
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
                 tmpqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
                     rxi_FreePackets(0, &tmpq);
                return 0;
            }
@@ -1314,9 +1314,9 @@ rxi_FlushWrite(register struct rx_call *call)
 
     /* Free any packets from the last call to ReadvProc/WritevProc */
     if (queue_IsNotEmpty(&call->iovq)) {
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->iovqc -=
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
             rxi_FreePackets(0, &call->iovq);
     }
 
@@ -1377,9 +1377,9 @@ rxi_FlushWrite(register struct rx_call *call)
        rxi_PrepareSendPacket(call, cp, 1);
        cp->flags |= RX_PKTFLAG_TQ;
        queue_Append(&call->tq, cp);
-#ifdef DEBUG
+#ifdef RXDEBUG_PACKET
         call->tqc++;
-#endif /* DEBUG */
+#endif /* RXDEBUG_PACKET */
        if (!
            (call->
             flags & (RX_CALL_FAST_RECOVER | RX_CALL_FAST_RECOVER_WAIT))) {