From 9fefc6ef53142faac984dacdb288dd49e62697d7 Mon Sep 17 00:00:00 2001 From: Jessica Castelino Date: Tue, 25 May 2021 17:18:30 -0400 Subject: [PATCH] Reduce recurring log messages in sm-scheduler.log sm-schedule.log contains a recurring log message "no scheduling changes required." The amount of those log entries is huge and in a large environment, it adds a significant burden for the monitoring elements, while providing no apparent value. This commit fixes the issue. Change-Id: Ia03bc7161d5b6a8059fd8daba5e40450711f2830 Signed-off-by: Jessica Castelino Closes-Bug: 1929618 --- service-mgmt/sm-common/src/sm_debug.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/service-mgmt/sm-common/src/sm_debug.c b/service-mgmt/sm-common/src/sm_debug.c index 93b52bdb..b85f91cb 100644 --- a/service-mgmt/sm-common/src/sm_debug.c +++ b/service-mgmt/sm-common/src/sm_debug.c @@ -46,6 +46,7 @@ typedef SmDebugThreadMsgT SmDebugSchedLogSetT[SCHED_LOGS_MAX]; static int _sched_log_set = 0; static int _sched_log_num = 0; +static bool _print_sched_log = true; static SmDebugSchedLogSetT _sched_logs[2]; // **************************************************************************** @@ -231,9 +232,13 @@ void sm_debug_sched_log_done( char* domain ) send( _client_fd, msg, sizeof(SmDebugThreadMsgLogT), 0 ); } - } else { - sm_debug_log( SM_DEBUG_SCHED_LOG, "%s: no scheduling changes " - "required.", domain ); + _print_sched_log = true; + } + else { + if (_print_sched_log) + sm_debug_log( SM_DEBUG_SCHED_LOG, "%s: no scheduling changes " + "required.", domain ); + _print_sched_log = false; } } }