flowbits: remove unused debugging code

pull/1872/head
Victor Julien 10 years ago
parent 53af48f021
commit 3c788a8c17

@ -68,16 +68,6 @@ static void FlowBitAdd(Flow *f, uint16_t idx)
fb->idx = idx;
fb->next = NULL;
GenericVarAppend(&f->flowvar, (GenericVar *)fb);
//printf("FlowBitAdd: adding flowbit with idx %" PRIu32 "\n", idx);
#ifdef FLOWBITS_STATS
SCMutexLock(&flowbits_mutex);
flowbits_added++;
flowbits_memuse += sizeof(FlowBit);
if (flowbits_memuse > flowbits_memuse_max)
flowbits_memuse_max = flowbits_memuse;
SCMutexUnlock(&flowbits_mutex);
#endif /* FLOWBITS_STATS */
}
}
@ -89,19 +79,6 @@ static void FlowBitRemove(Flow *f, uint16_t idx)
GenericVarRemove(&f->flowvar, (GenericVar *)fb);
FlowBitFree(fb);
//printf("FlowBitRemove: remove flowbit with idx %" PRIu32 "\n", idx);
#ifdef FLOWBITS_STATS
SCMutexLock(&flowbits_mutex);
flowbits_removed++;
if (flowbits_memuse >= sizeof(FlowBit))
flowbits_memuse -= sizeof(FlowBit);
else {
printf("ERROR: flowbits memory usage going below 0!\n");
flowbits_memuse = 0;
}
SCMutexUnlock(&flowbits_mutex);
#endif /* FLOWBITS_STATS */
}
void FlowBitSetNoLock(Flow *f, uint16_t idx)
@ -179,18 +156,6 @@ void FlowBitFree(FlowBit *fb)
return;
SCFree(fb);
#ifdef FLOWBITS_STATS
SCMutexLock(&flowbits_mutex);
flowbits_removed++;
if (flowbits_memuse >= sizeof(FlowBit))
flowbits_memuse -= sizeof(FlowBit);
else {
printf("ERROR: flowbits memory usage going below 0!\n");
flowbits_memuse = 0;
}
SCMutexUnlock(&flowbits_mutex);
#endif /* FLOWBITS_STATS */
}

@ -87,14 +87,5 @@ FlowConfig flow_config;
/** flow memuse counter (atomic), for enforcing memcap limit */
SC_ATOMIC_DECLARE(long long unsigned int, flow_memuse);
//#define FLOWBITS_STATS
#ifdef FLOWBITS_STATS
uint64_t flowbits_memuse;
uint64_t flowbits_memuse_max;
uint32_t flowbits_added;
uint32_t flowbits_removed;
SCMutex flowbits_mutex;
#endif /* FLOWBITS_STATS */
#endif /* __FLOW_PRIVATE_H__ */

@ -476,10 +476,6 @@ void FlowInitConfig(char quiet)
* \warning Not thread safe */
static void FlowPrintStats (void)
{
#ifdef FLOWBITS_STATS
SCLogInfo("flowbits added: %" PRIu32 ", removed: %" PRIu32 ", max memory usage: %" PRIu32 "",
flowbits_added, flowbits_removed, flowbits_memuse_max);
#endif /* FLOWBITS_STATS */
return;
}

Loading…
Cancel
Save