From a684025f078d3fecbeb6c160ffce7da91503a25a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 12 Jan 2022 12:27:08 -0500 Subject: [PATCH] TT#14008 avoid pointless open/close of kernel list If there's no calls active then there's no point in checking the kernel status. Change-Id: I84418b38f8976c9f4e29ea725e9cd1eab7306298 --- daemon/call.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index 69267e1ae..4ebc49f97 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -53,6 +53,7 @@ struct iterator_helper { + uint64_t count; GSList *del_timeout; GSList *del_scheduled; GHashTable *addr_sfd; @@ -153,6 +154,8 @@ static void call_timer_iterator(struct call *c, struct iterator_helper *hlp) { enum call_stream_state css; atomic64 *timestamp; + hlp->count++; + rwlock_lock_r(&c->master_lock); log_info_call(c); @@ -582,7 +585,7 @@ void call_timer(void *ptr) { // stats derived while iterating calls RTPE_GAUGE_SET(transcoded_media, hlp.transcoded_media); - i = kernel_list(); + i = hlp.count ? kernel_list() : NULL; while (i) { ke = i->data;