Fix small memuse counter issue in flow subsys, remove emergency printfs

remotes/origin/master-1.0.x
Victor Julien 15 years ago
parent 00974d157b
commit fc2029ef58

@ -497,12 +497,12 @@ void FlowInitConfig (char quiet)
memset(flow_hash, 0, flow_config.hash_size * sizeof(FlowBucket)); memset(flow_hash, 0, flow_config.hash_size * sizeof(FlowBucket));
for (i = 0; i < flow_config.hash_size; i++) for (i = 0; i < flow_config.hash_size; i++)
SCMutexInit(&flow_hash[i].m, NULL); SCMutexInit(&flow_hash[i].m, NULL);
flow_config.memuse += (flow_config.hash_size * sizeof(FlowBucket)); flow_memuse += (flow_config.hash_size * sizeof(FlowBucket));
if (quiet == FALSE) if (quiet == FALSE)
SCLogInfo("allocated %" PRIu32 " bytes of memory for the flow hash... " SCLogInfo("allocated %" PRIu32 " bytes of memory for the flow hash... "
"%" PRIu32 " buckets of size %" PRIuMAX "", "%" PRIu32 " buckets of size %" PRIuMAX "",
flow_config.memuse, flow_config.hash_size, flow_memuse, flow_config.hash_size,
(uintmax_t)sizeof(FlowBucket)); (uintmax_t)sizeof(FlowBucket));
/* pre allocate flows */ /* pre allocate flows */
@ -519,7 +519,7 @@ void FlowInitConfig (char quiet)
SCLogInfo("preallocated %" PRIu32 " flows of size %" PRIuMAX "", SCLogInfo("preallocated %" PRIu32 " flows of size %" PRIuMAX "",
flow_spare_q.len, (uintmax_t)sizeof(Flow)); flow_spare_q.len, (uintmax_t)sizeof(Flow));
SCLogInfo("flow memory usage: %" PRIu32 " bytes, maximum: %" PRIu32 "", SCLogInfo("flow memory usage: %" PRIu32 " bytes, maximum: %" PRIu32 "",
flow_config.memuse, flow_config.memcap); flow_memuse, flow_config.memcap);
} }
FlowInitFlowProto(); FlowInitFlowProto();
@ -664,7 +664,7 @@ void *FlowManagerThread(void *td)
PRIu32"\n", timeout_est, timeout_new);*/ PRIu32"\n", timeout_est, timeout_new);*/
if (flow_flags & FLOW_EMERGENCY) { if (flow_flags & FLOW_EMERGENCY) {
emerg = TRUE; emerg = TRUE;
printf("Flow emergency mode entered...\n"); SCLogDebug("Flow emergency mode entered...");
} }
/* Get the time */ /* Get the time */
@ -706,7 +706,7 @@ void *FlowManagerThread(void *td)
if (emerg == TRUE) { if (emerg == TRUE) {
flow_flags &= ~FLOW_EMERGENCY; flow_flags &= ~FLOW_EMERGENCY;
emerg = FALSE; emerg = FALSE;
printf("Flow emergency mode over, back to normal...\n"); SCLogDebug("Flow emergency mode over, back to normal...");
} }
} }

@ -53,7 +53,6 @@ typedef struct FlowCnf_
uint32_t hash_size; uint32_t hash_size;
uint32_t max_flows; uint32_t max_flows;
uint32_t memcap; uint32_t memcap;
uint32_t memuse;
uint32_t prealloc; uint32_t prealloc;
uint32_t timeout_new; uint32_t timeout_new;

Loading…
Cancel
Save