From: Victor Julien Date: Mon, 31 Aug 2020 13:00:28 +0000 (+0200) Subject: flow: suppress noisy messages X-Git-Tag: suricata-6.0.0-rc1~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5346%2Fhead;p=thirdparty%2Fsuricata.git flow: suppress noisy messages --- diff --git a/src/flow-manager.c b/src/flow-manager.c index eacf7fe3fe..593167092b 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -802,8 +802,8 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data) return TM_ECODE_OK; } - SCLogNotice("FM %s/%d starting. min_timeout %us. Full hash pass in %us", - th_v->name, ftd->instance, min_timeout, pass_in_sec); + SCLogDebug("FM %s/%d starting. min_timeout %us. Full hash pass in %us", th_v->name, + ftd->instance, min_timeout, pass_in_sec); #ifdef FM_PROFILE struct timeval endts; @@ -1295,8 +1295,12 @@ void FlowDisableFlowRecyclerThread(void) int cnt = 0; /* move all flows still in the hash to the recycler queue */ +#ifndef DEBUG + (void)FlowCleanupHash(); +#else uint32_t flows = FlowCleanupHash(); - SCLogNotice("flows to progress: %u", flows); + SCLogDebug("flows to progress: %u", flows); +#endif /* make sure all flows are processed */ do { diff --git a/src/flow.c b/src/flow.c index 42c6fb8b93..14b32f4cc2 100644 --- a/src/flow.c +++ b/src/flow.c @@ -537,7 +537,8 @@ void FlowInitConfig(char quiet) if (val <= 100 && val >= 1) { flow_config.emergency_recovery = (uint8_t)val; } else { - SCLogError(SC_ERR_INVALID_VALUE, "flow.emergency-recovery must be in the range of 1 and 100 (as percentage)"); + SCLogError(SC_ERR_INVALID_VALUE, "flow.emergency-recovery must be in the range of " + "1 and 100 (as percentage)"); flow_config.emergency_recovery = FLOW_DEFAULT_EMERGENCY_RECOVERY; } } else { @@ -550,7 +551,7 @@ void FlowInitConfig(char quiet) uint32_t configval = 0; /** set config values for memcap, prealloc and hash_size */ - uint64_t flow_memcap_copy; + uint64_t flow_memcap_copy = 0; if ((ConfGet("flow.memcap", &conf_val)) == 1) { if (conf_val == NULL) { @@ -632,7 +633,9 @@ void FlowInitConfig(char quiet) FlowInitFlowProto(); uint32_t sz = sizeof(Flow) + FlowStorageSize(); - SCLogNotice("flow size %u, memcap allows for %"PRIu64" flows. Per hash row in perfect conditions %"PRIu64, sz, flow_memcap_copy/sz, (flow_memcap_copy/sz)/flow_config.hash_size); + SCLogConfig("flow size %u, memcap allows for %" PRIu64 " flows. Per hash row in perfect " + "conditions %" PRIu64, + sz, flow_memcap_copy / sz, (flow_memcap_copy / sz) / flow_config.hash_size); return; }