]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
flowbits: remove unused debugging code
authorVictor Julien <victor@inliniac.net>
Wed, 24 Feb 2016 12:39:10 +0000 (13:39 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 24 Feb 2016 13:00:11 +0000 (14:00 +0100)
src/flow-bit.c
src/flow-private.h
src/flow.c

index 2b4ef5ccfa04a3754a0cb32edd763a607f3d9f75..188fc6aae36cefe835d4ea6817d10cbde5908057 100644 (file)
@@ -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 */
 }
 
 
index bd25960b2bf0c755e5d01c6ee9739da2a259655a..507b1aad7dd6678db60fcd8f2272bdaf159fb07c 100644 (file)
@@ -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__ */
 
index abd9e7e5fb771b2a248b919603437e840da1a35d..cae7c4c0442f71ce51ab99af96e7d47826ff7185 100644 (file)
@@ -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;
 }