From 36a03bdfcb059ef22d7d2a52c5093194b5c12574 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 28 Aug 2014 16:25:09 +0200 Subject: osmux: display statistics once osmux input handle is released --- openbsc/src/libmgcp/osmux.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openbsc/src/libmgcp/osmux.c b/openbsc/src/libmgcp/osmux.c index c64578bce..c9f344def 100644 --- a/openbsc/src/libmgcp/osmux.c +++ b/openbsc/src/libmgcp/osmux.c @@ -12,6 +12,7 @@ #include /* for printf */ #include /* for memcpy */ #include /* for abs */ +#include /* for PRIu64 */ #include #include #include @@ -86,10 +87,17 @@ static void osmux_handle_put(struct osmux_in_handle *in) llist_for_each_entry(h, &osmux_handle_list, head) { if (h->in == in) { if (--h->refcnt == 0) { - LOGP(DMGCP, LOGL_DEBUG, + LOGP(DMGCP, LOGL_INFO, "Releasing unused osmux handle for %s:%d\n", inet_ntoa(h->rem_addr), ntohs(h->rem_port)); + LOGP(DMGCP, LOGL_INFO, "Stats: " + "input RTP msgs: %u bytes: %"PRIu64" " + "output osmux msgs: %u bytes: %"PRIu64"\n", + in->stats.input_rtp_msgs, + in->stats.input_rtp_bytes, + in->stats.output_osmux_msgs, + in->stats.output_osmux_bytes); llist_del(&h->head); osmux_xfrm_input_fini(h->in); talloc_free(h); -- cgit v1.2.3