pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/27418 )
Change subject: Trace retransmit queues lifceycle through DEBUG log level ......................................................................
Trace retransmit queues lifceycle through DEBUG log level
Change-Id: I3e7658e882baf6425f8959ccb3c36e29b5be2dcd --- M gtp/gtp.c 1 file changed, 11 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/18/27418/1
diff --git a/gtp/gtp.c b/gtp/gtp.c index 9cbeaa8..672c5f0 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -400,15 +400,13 @@ time_t now; struct qmsg_t *qmsg; now = time(NULL); - /*printf("Retrans: New beginning %d\n", (int) now); */
/* get first element in queue, as long as the timeout of that * element has expired */ while ((!queue_getfirst(gsn->queue_req, &qmsg)) && (qmsg->timeout <= now)) { - /*printf("Retrans timeout found: %d\n", (int) time(NULL)); */ if (qmsg->retrans > N3_REQUESTS) { /* To many retrans */ - LOGP(DLGTP, LOGL_NOTICE, "Timeout of seq %" PRIu16 "\n", + LOGP(DLGTP, LOGL_NOTICE, "Retransmit req queue timeout of seq %" PRIu16 "\n", qmsg->seq); if (gsn->cb_conf) gsn->cb_conf(qmsg->type, EOF, NULL, qmsg->cbp); @@ -434,7 +432,8 @@ /* Also clean up reply timeouts */ while ((!queue_getfirst(gsn->queue_resp, &qmsg)) && (qmsg->timeout < now)) { - /*printf("Retrans (reply) timeout found: %d\n", (int) time(NULL)); */ + LOGP(DLGTP, LOGL_DEBUG, "Retransmit resp queue seq %" + PRIu16 " expired, removing from queue\n", qmsg->seq); queue_freemsg(gsn->queue_resp, qmsg); }
@@ -633,7 +632,7 @@ LOGP(DLGTP, LOGL_ERROR, "Retransmit req queue is full (seq=%" PRIu16 ")\n", gsn->seq_next); } else { - LOGP(DLGTP, LOGL_DEBUG, "Registering seq=% " PRIu16 + LOGP(DLGTP, LOGL_DEBUG, "Registering seq=%" PRIu16 " in restransmit req queue\n", gsn->seq_next); memcpy(&qmsg->p, packet, sizeof(union gtp_packet)); qmsg->l = len; @@ -662,6 +661,7 @@ { struct qmsg_t *qmsg;
+ LOGP(DLGTP, LOGL_INFO, "Clearing req & resp retransmit queues\n"); while (!queue_getfirst(gsn->queue_req, &qmsg)) { queue_freemsg(gsn->queue_req, qmsg); } @@ -691,10 +691,14 @@ return EOF; }
+ GTP_LOGPKG(LOGL_DEBUG, peer, packet, len, + "Freeing seq=%" PRIu16 " from retransmit req queue\n", + seq); if (queue_freemsg_seq(gsn->queue_req, peer, seq, type, cbp)) { gsn->err_seq++; GTP_LOGPKG(LOGL_ERROR, peer, packet, len, - "Confirmation packet not found in queue\n"); + "Confirmation packet not found in retransmit req queue (seq=%" + PRIu16 ")\n", seq); return EOF; }
@@ -763,7 +767,7 @@ LOGP(DLGTP, LOGL_ERROR, "Retransmit resp queue is full (seq=%" PRIu16 ")\n", seq); } else { - LOGP(DLGTP, LOGL_DEBUG, "Registering seq=% " PRIu16 + LOGP(DLGTP, LOGL_DEBUG, "Registering seq=%" PRIu16 " in restransmit resp queue\n", seq); memcpy(&qmsg->p, packet, sizeof(union gtp_packet)); qmsg->l = len;