]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
counters: rename register API calls
authorVictor Julien <victor@inliniac.net>
Tue, 26 May 2015 12:33:21 +0000 (14:33 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 27 May 2015 12:14:45 +0000 (14:14 +0200)
Also remove 'type' parameter which was always the same.

15 files changed:
src/app-layer.c
src/counters.c
src/counters.h
src/decode.c
src/detect-engine.c
src/flow-manager.c
src/source-af-packet.c
src/source-erf-dag.c
src/source-mpipe.c
src/source-netmap.c
src/source-nflog.c
src/source-pcap.c
src/source-pfring.c
src/stream-tcp-reassemble.c
src/stream-tcp.c

index 1f8590f5132b9b8bef6c0733556dbb6ccd7c3442..5dfd433c61acbb6fd2b7dc0ae38a5b637d48ceff 100644 (file)
@@ -603,12 +603,9 @@ AppLayerThreadCtx *AppLayerGetCtxThread(ThreadVars *tv)
 
     /* tv is allowed to be NULL in unittests */
     if (tv != NULL) {
-        app_tctx->counter_dns_memuse = SCPerfTVRegisterCounter("dns.memuse", tv,
-                SC_PERF_TYPE_UINT64);
-        app_tctx->counter_dns_memcap_state = SCPerfTVRegisterCounter("dns.memcap_state", tv,
-                SC_PERF_TYPE_UINT64);
-        app_tctx->counter_dns_memcap_global = SCPerfTVRegisterCounter("dns.memcap_global", tv,
-                SC_PERF_TYPE_UINT64);
+        app_tctx->counter_dns_memuse = StatsRegisterCounter("dns.memuse", tv);
+        app_tctx->counter_dns_memcap_state = StatsRegisterCounter("dns.memcap_state", tv);
+        app_tctx->counter_dns_memcap_global = StatsRegisterCounter("dns.memcap_global", tv);
     }
 
     goto done;
index acf2a1c9baaef29cd34c50538efba03ad02916fb..0e686191cf2f042b52ad2b619f84abff764bbe7e 100644 (file)
@@ -496,7 +496,6 @@ static void SCPerfReleaseCounter(SCPerfCounter *pc)
  *
  * \param cname    Name of the counter, to be registered
  * \param tm_name  Thread module to which this counter belongs
- * \param type     Datatype of this counter variable
  * \param pctx     SCPerfPublicContext for this tm-tv instance
  * \param type_q   Qualifier describing the type of counter to be registered
  *
@@ -504,9 +503,9 @@ static void SCPerfReleaseCounter(SCPerfCounter *pc)
  *         present counter on success
  * \retval 0 on failure
  */
-static uint16_t SCPerfRegisterQualifiedCounter(char *cname, char *tm_name,
-                                               int type, SCPerfPublicContext *pctx,
-                                               int type_q, uint64_t (*Func)(void))
+static uint16_t StatsRegisterQualifiedCounter(char *cname, char *tm_name,
+                                              SCPerfPublicContext *pctx,
+                                              int type_q, uint64_t (*Func)(void))
 {
     SCPerfCounter **head = &pctx->head;
     SCPerfCounter *temp = NULL;
@@ -518,12 +517,6 @@ static uint16_t SCPerfRegisterQualifiedCounter(char *cname, char *tm_name,
         return 0;
     }
 
-    if ((type >= SC_PERF_TYPE_MAX) || (type < 0)) {
-        SCLogError(SC_ERR_INVALID_ARGUMENTS, "Counters of type %" PRId32 " can't "
-                   "be registered", type);
-        return 0;
-    }
-
     temp = prev = *head;
     while (temp != NULL) {
         prev = temp;
@@ -946,16 +939,14 @@ void SCPerfSpawnThreads(void)
  * \param cname Name of the counter, to be registered
  * \param tv    Pointer to the ThreadVars instance for which the counter would
  *              be registered
- * \param type  Datatype of this counter variable
  *
  * \retval id Counter id for the newly registered counter, or the already
  *            present counter
  */
-uint16_t SCPerfTVRegisterCounter(char *cname, struct ThreadVars_ *tv, int type)
+uint16_t StatsRegisterCounter(char *cname, struct ThreadVars_ *tv)
 {
-    uint16_t id = SCPerfRegisterQualifiedCounter(cname,
+    uint16_t id = StatsRegisterQualifiedCounter(cname,
                                                  (tv->thread_group_name != NULL) ? tv->thread_group_name : tv->name,
-                                                 type,
                                                  &tv->perf_public_ctx,
                                                  STATS_TYPE_NORMAL, NULL);
 
@@ -969,17 +960,14 @@ uint16_t SCPerfTVRegisterCounter(char *cname, struct ThreadVars_ *tv, int type)
  * \param cname Name of the counter, to be registered
  * \param tv    Pointer to the ThreadVars instance for which the counter would
  *              be registered
- * \param type  Datatype of this counter variable
  *
  * \retval id Counter id for the newly registered counter, or the already
  *            present counter
  */
-uint16_t SCPerfTVRegisterAvgCounter(char *cname, struct ThreadVars_ *tv,
-                                    int type)
+uint16_t StatsRegisterAvgCounter(char *cname, struct ThreadVars_ *tv)
 {
-    uint16_t id = SCPerfRegisterQualifiedCounter(cname,
+    uint16_t id = StatsRegisterQualifiedCounter(cname,
                                                  (tv->thread_group_name != NULL) ? tv->thread_group_name : tv->name,
-                                                 type,
                                                  &tv->perf_public_ctx,
                                                  STATS_TYPE_AVERAGE, NULL);
 
@@ -993,17 +981,14 @@ uint16_t SCPerfTVRegisterAvgCounter(char *cname, struct ThreadVars_ *tv,
  * \param cname Name of the counter, to be registered
  * \param tv    Pointer to the ThreadVars instance for which the counter would
  *              be registered
- * \param type  Datatype of this counter variable
  *
  * \retval the counter id for the newly registered counter, or the already
  *         present counter
  */
-uint16_t SCPerfTVRegisterMaxCounter(char *cname, struct ThreadVars_ *tv,
-                                    int type)
+uint16_t StatsRegisterMaxCounter(char *cname, struct ThreadVars_ *tv)
 {
-    uint16_t id = SCPerfRegisterQualifiedCounter(cname,
+    uint16_t id = StatsRegisterQualifiedCounter(cname,
                                                  (tv->thread_group_name != NULL) ? tv->thread_group_name : tv->name,
-                                                 type,
                                                  &tv->perf_public_ctx,
                                                  STATS_TYPE_MAXIMUM, NULL);
 
@@ -1019,7 +1004,7 @@ uint16_t SCPerfTVRegisterMaxCounter(char *cname, struct ThreadVars_ *tv,
  * \retval id Counter id for the newly registered counter, or the already
  *            present counter
  */
-uint16_t SCPerfTVRegisterGlobalCounter(char *cname, uint64_t (*Func)(void))
+uint16_t StatsRegisterGlobalCounter(char *cname, uint64_t (*Func)(void))
 {
 #ifdef UNITTESTS
     if (sc_perf_op_ctx == NULL)
@@ -1027,8 +1012,7 @@ uint16_t SCPerfTVRegisterGlobalCounter(char *cname, uint64_t (*Func)(void))
 #else
     BUG_ON(sc_perf_op_ctx == NULL);
 #endif
-    uint16_t id = SCPerfRegisterQualifiedCounter(cname, NULL,
-                                                 SC_PERF_TYPE_UINT64,
+    uint16_t id = StatsRegisterQualifiedCounter(cname, NULL,
                                                  &(sc_perf_op_ctx->global_counter_ctx),
                                                  STATS_TYPE_FUNC,
                                                  Func);
@@ -1048,11 +1032,11 @@ uint16_t SCPerfTVRegisterGlobalCounter(char *cname, uint64_t (*Func)(void))
  * \retval id Counter id for the newly registered counter, or the already
  *            present counter
  */
-static uint16_t SCPerfRegisterCounter(char *cname, char *tm_name, int type,
+static uint16_t SCPerfRegisterCounter(char *cname, char *tm_name,
                                SCPerfPublicContext *pctx)
 {
-    uint16_t id = SCPerfRegisterQualifiedCounter(cname, tm_name, type, pctx,
-                                                 STATS_TYPE_NORMAL, NULL);
+    uint16_t id = StatsRegisterQualifiedCounter(cname, tm_name, pctx,
+                                                STATS_TYPE_NORMAL, NULL);
 
     return id;
 }
@@ -1358,22 +1342,13 @@ void SCPerfReleasePCA(SCPerfPrivateContext *pca)
 /*----------------------------------Unit_Tests--------------------------------*/
 
 #ifdef UNITTESTS
-static int SCPerfTestCounterReg01()
-{
-    SCPerfPublicContext pctx;
-
-    memset(&pctx, 0, sizeof(SCPerfPublicContext));
-
-    return SCPerfRegisterCounter("t1", "c1", 5, &pctx);
-}
-
 static int SCPerfTestCounterReg02()
 {
     SCPerfPublicContext pctx;
 
     memset(&pctx, 0, sizeof(SCPerfPublicContext));
 
-    return SCPerfRegisterCounter(NULL, NULL, SC_PERF_TYPE_UINT64, &pctx);
+    return SCPerfRegisterCounter(NULL, NULL, &pctx);
 }
 
 static int SCPerfTestCounterReg03()
@@ -1383,7 +1358,7 @@ static int SCPerfTestCounterReg03()
 
     memset(&pctx, 0, sizeof(SCPerfPublicContext));
 
-    result = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64, &pctx);
+    result = SCPerfRegisterCounter("t1", "c1", &pctx);
 
     SCPerfReleasePerfCounterS(pctx.head);
 
@@ -1397,11 +1372,11 @@ static int SCPerfTestCounterReg04()
 
     memset(&pctx, 0, sizeof(SCPerfPublicContext));
 
-    SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64, &pctx);
-    SCPerfRegisterCounter("t2", "c2", SC_PERF_TYPE_UINT64, &pctx);
-    SCPerfRegisterCounter("t3", "c3", SC_PERF_TYPE_UINT64, &pctx);
+    SCPerfRegisterCounter("t1", "c1", &pctx);
+    SCPerfRegisterCounter("t2", "c2", &pctx);
+    SCPerfRegisterCounter("t3", "c3", &pctx);
 
-    result = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64, &pctx);
+    result = SCPerfRegisterCounter("t1", "c1", &pctx);
 
     SCPerfReleasePerfCounterS(pctx.head);
 
@@ -1415,8 +1390,7 @@ static int SCPerfTestGetCntArray05()
 
     memset(&tv, 0, sizeof(ThreadVars));
 
-    id = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64,
-                               &tv.perf_public_ctx);
+    id = SCPerfRegisterCounter("t1", "c1", &tv.perf_public_ctx);
     if (id != 1) {
         printf("id %d: ", id);
         return 0;
@@ -1434,8 +1408,7 @@ static int SCPerfTestGetCntArray06()
 
     memset(&tv, 0, sizeof(ThreadVars));
 
-    id = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64,
-                               &tv.perf_public_ctx);
+    id = SCPerfRegisterCounter("t1", "c1", &tv.perf_public_ctx);
     if (id != 1)
         return 0;
 
@@ -1459,10 +1432,8 @@ static int SCPerfTestCntArraySize07()
 
     //pca = (SCPerfPrivateContext *)&tv.perf_private_ctx;
 
-    SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64,
-                          &tv.perf_public_ctx);
-    SCPerfRegisterCounter("t2", "c2", SC_PERF_TYPE_UINT64,
-                          &tv.perf_public_ctx);
+    SCPerfRegisterCounter("t1", "c1", &tv.perf_public_ctx);
+    SCPerfRegisterCounter("t2", "c2", &tv.perf_public_ctx);
 
     SCPerfGetAllCountersArray(&tv.perf_public_ctx, &tv.perf_private_ctx);
     pca = &tv.perf_private_ctx;
@@ -1487,8 +1458,7 @@ static int SCPerfTestUpdateCounter08()
 
     memset(&tv, 0, sizeof(ThreadVars));
 
-    id = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64,
-                               &tv.perf_public_ctx);
+    id = SCPerfRegisterCounter("t1", "c1", &tv.perf_public_ctx);
 
     SCPerfGetAllCountersArray(&tv.perf_public_ctx, &tv.perf_private_ctx);
     pca = &tv.perf_private_ctx;
@@ -1513,16 +1483,11 @@ static int SCPerfTestUpdateCounter09()
 
     memset(&tv, 0, sizeof(ThreadVars));
 
-    id1 = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
-    SCPerfRegisterCounter("t2", "c2", SC_PERF_TYPE_UINT64,
-                          &tv.perf_public_ctx);
-    SCPerfRegisterCounter("t3", "c3", SC_PERF_TYPE_UINT64,
-                          &tv.perf_public_ctx);
-    SCPerfRegisterCounter("t4", "c4", SC_PERF_TYPE_UINT64,
-                          &tv.perf_public_ctx);
-    id2 = SCPerfRegisterCounter("t5", "c5", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
+    id1 = SCPerfRegisterCounter("t1", "c1", &tv.perf_public_ctx);
+    SCPerfRegisterCounter("t2", "c2", &tv.perf_public_ctx);
+    SCPerfRegisterCounter("t3", "c3", &tv.perf_public_ctx);
+    SCPerfRegisterCounter("t4", "c4", &tv.perf_public_ctx);
+    id2 = SCPerfRegisterCounter("t5", "c5", &tv.perf_public_ctx);
 
     SCPerfGetAllCountersArray(&tv.perf_public_ctx, &tv.perf_private_ctx);
     pca = &tv.perf_private_ctx;
@@ -1548,12 +1513,9 @@ static int SCPerfTestUpdateGlobalCounter10()
 
     memset(&tv, 0, sizeof(ThreadVars));
 
-    id1 = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
-    id2 = SCPerfRegisterCounter("t2", "c2", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
-    id3 = SCPerfRegisterCounter("t3", "c3", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
+    id1 = SCPerfRegisterCounter("t1", "c1", &tv.perf_public_ctx);
+    id2 = SCPerfRegisterCounter("t2", "c2", &tv.perf_public_ctx);
+    id3 = SCPerfRegisterCounter("t3", "c3", &tv.perf_public_ctx);
 
     SCPerfGetAllCountersArray(&tv.perf_public_ctx, &tv.perf_private_ctx);
     pca = &tv.perf_private_ctx;
@@ -1585,14 +1547,10 @@ static int SCPerfTestCounterValues11()
 
     memset(&tv, 0, sizeof(ThreadVars));
 
-    id1 = SCPerfRegisterCounter("t1", "c1", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
-    id2 = SCPerfRegisterCounter("t2", "c2", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
-    id3 = SCPerfRegisterCounter("t3", "c3", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
-    id4 = SCPerfRegisterCounter("t4", "c4", SC_PERF_TYPE_UINT64,
-                                &tv.perf_public_ctx);
+    id1 = SCPerfRegisterCounter("t1", "c1", &tv.perf_public_ctx);
+    id2 = SCPerfRegisterCounter("t2", "c2", &tv.perf_public_ctx);
+    id3 = SCPerfRegisterCounter("t3", "c3", &tv.perf_public_ctx);
+    id4 = SCPerfRegisterCounter("t4", "c4", &tv.perf_public_ctx);
 
     SCPerfGetAllCountersArray(&tv.perf_public_ctx, &tv.perf_private_ctx);
     pca = &tv.perf_private_ctx;
@@ -1623,7 +1581,6 @@ static int SCPerfTestCounterValues11()
 void SCPerfRegisterTests()
 {
 #ifdef UNITTESTS
-    UtRegisterTest("SCPerfTestCounterReg01", SCPerfTestCounterReg01, 0);
     UtRegisterTest("SCPerfTestCounterReg02", SCPerfTestCounterReg02, 0);
     UtRegisterTest("SCPerfTestCounterReg03", SCPerfTestCounterReg03, 1);
     UtRegisterTest("SCPerfTestCounterReg04", SCPerfTestCounterReg04, 1);
index 8d9113f68490e5ff471cf92ee9a5b9aa9fc424ed..82378c02fec0488cee241697ce325325fac32ca8 100644 (file)
 /* forward declaration of the ThreadVars structure */
 struct ThreadVars_;
 
-/**
- * \brief Data type for different kind of Perf counters that can be registered
- */
-enum {
-    SC_PERF_TYPE_UINT64,
-    SC_PERF_TYPE_MAX,
-};
-
 /**
  * \brief Container to hold the counter variable
  */
@@ -117,10 +109,10 @@ void SCPerfSpawnThreads(void);
 void SCPerfRegisterTests(void);
 
 /* counter registration functions */
-uint16_t SCPerfTVRegisterCounter(char *, struct ThreadVars_ *, int);
-uint16_t SCPerfTVRegisterAvgCounter(char *, struct ThreadVars_ *, int);
-uint16_t SCPerfTVRegisterMaxCounter(char *, struct ThreadVars_ *, int);
-uint16_t SCPerfTVRegisterGlobalCounter(char *cname, uint64_t (*Func)(void));
+uint16_t StatsRegisterCounter(char *, struct ThreadVars_ *);
+uint16_t StatsRegisterAvgCounter(char *, struct ThreadVars_ *);
+uint16_t StatsRegisterMaxCounter(char *, struct ThreadVars_ *);
+uint16_t StatsRegisterGlobalCounter(char *cname, uint64_t (*Func)(void));
 
 /* utility functions */
 int SCPerfUpdateCounterArray(SCPerfPrivateContext *, SCPerfPublicContext *);
index 4e2613e79fd08a18dc4233d5550412c107910f05..b096bf5753ee03374ef87902d2e638f393a74469 100644 (file)
@@ -370,78 +370,46 @@ void PacketDefragPktSetupParent(Packet *parent)
 void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
 {
     /* register counters */
-    dtv->counter_pkts = SCPerfTVRegisterCounter("decoder.pkts", tv,
-                                                SC_PERF_TYPE_UINT64);
-    dtv->counter_bytes = SCPerfTVRegisterCounter("decoder.bytes", tv,
-                                                 SC_PERF_TYPE_UINT64);
-    dtv->counter_invalid = SCPerfTVRegisterCounter("decoder.invalid", tv,
-                                                 SC_PERF_TYPE_UINT64);
-    dtv->counter_ipv4 = SCPerfTVRegisterCounter("decoder.ipv4", tv,
-                                                SC_PERF_TYPE_UINT64);
-    dtv->counter_ipv6 = SCPerfTVRegisterCounter("decoder.ipv6", tv,
-                                                SC_PERF_TYPE_UINT64);
-    dtv->counter_eth = SCPerfTVRegisterCounter("decoder.ethernet", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_raw = SCPerfTVRegisterCounter("decoder.raw", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_null = SCPerfTVRegisterCounter("decoder.null", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_sll = SCPerfTVRegisterCounter("decoder.sll", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_tcp = SCPerfTVRegisterCounter("decoder.tcp", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_udp = SCPerfTVRegisterCounter("decoder.udp", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_sctp = SCPerfTVRegisterCounter("decoder.sctp", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_icmpv4 = SCPerfTVRegisterCounter("decoder.icmpv4", tv,
-                                                  SC_PERF_TYPE_UINT64);
-    dtv->counter_icmpv6 = SCPerfTVRegisterCounter("decoder.icmpv6", tv,
-                                                  SC_PERF_TYPE_UINT64);
-    dtv->counter_ppp = SCPerfTVRegisterCounter("decoder.ppp", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_pppoe = SCPerfTVRegisterCounter("decoder.pppoe", tv,
-                                                 SC_PERF_TYPE_UINT64);
-    dtv->counter_gre = SCPerfTVRegisterCounter("decoder.gre", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_vlan = SCPerfTVRegisterCounter("decoder.vlan", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_vlan_qinq = SCPerfTVRegisterCounter("decoder.vlan_qinq", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_teredo = SCPerfTVRegisterCounter("decoder.teredo", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_ipv4inipv6 = SCPerfTVRegisterCounter("decoder.ipv4_in_ipv6", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_ipv6inipv6 = SCPerfTVRegisterCounter("decoder.ipv6_in_ipv6", tv,
-                                               SC_PERF_TYPE_UINT64);
-    dtv->counter_mpls = SCPerfTVRegisterCounter("decoder.mpls", tv,
-                                                SC_PERF_TYPE_UINT64);
-    dtv->counter_avg_pkt_size = SCPerfTVRegisterAvgCounter("decoder.avg_pkt_size", tv,
-                                                           SC_PERF_TYPE_UINT64);
-    dtv->counter_max_pkt_size = SCPerfTVRegisterMaxCounter("decoder.max_pkt_size", tv,
-                                                           SC_PERF_TYPE_UINT64);
+    dtv->counter_pkts = StatsRegisterCounter("decoder.pkts", tv);
+    dtv->counter_bytes = StatsRegisterCounter("decoder.bytes", tv);
+    dtv->counter_invalid = StatsRegisterCounter("decoder.invalid", tv);
+    dtv->counter_ipv4 = StatsRegisterCounter("decoder.ipv4", tv);
+    dtv->counter_ipv6 = StatsRegisterCounter("decoder.ipv6", tv);
+    dtv->counter_eth = StatsRegisterCounter("decoder.ethernet", tv);
+    dtv->counter_raw = StatsRegisterCounter("decoder.raw", tv);
+    dtv->counter_null = StatsRegisterCounter("decoder.null", tv);
+    dtv->counter_sll = StatsRegisterCounter("decoder.sll", tv);
+    dtv->counter_tcp = StatsRegisterCounter("decoder.tcp", tv);
+    dtv->counter_udp = StatsRegisterCounter("decoder.udp", tv);
+    dtv->counter_sctp = StatsRegisterCounter("decoder.sctp", tv);
+    dtv->counter_icmpv4 = StatsRegisterCounter("decoder.icmpv4", tv);
+    dtv->counter_icmpv6 = StatsRegisterCounter("decoder.icmpv6", tv);
+    dtv->counter_ppp = StatsRegisterCounter("decoder.ppp", tv);
+    dtv->counter_pppoe = StatsRegisterCounter("decoder.pppoe", tv);
+    dtv->counter_gre = StatsRegisterCounter("decoder.gre", tv);
+    dtv->counter_vlan = StatsRegisterCounter("decoder.vlan", tv);
+    dtv->counter_vlan_qinq = StatsRegisterCounter("decoder.vlan_qinq", tv);
+    dtv->counter_teredo = StatsRegisterCounter("decoder.teredo", tv);
+    dtv->counter_ipv4inipv6 = StatsRegisterCounter("decoder.ipv4_in_ipv6", tv);
+    dtv->counter_ipv6inipv6 = StatsRegisterCounter("decoder.ipv6_in_ipv6", tv);
+    dtv->counter_mpls = StatsRegisterCounter("decoder.mpls", tv);
+    dtv->counter_avg_pkt_size = StatsRegisterAvgCounter("decoder.avg_pkt_size", tv);
+    dtv->counter_max_pkt_size = StatsRegisterMaxCounter("decoder.max_pkt_size", tv);
 
     dtv->counter_defrag_ipv4_fragments =
-        SCPerfTVRegisterCounter("defrag.ipv4.fragments", tv,
-            SC_PERF_TYPE_UINT64);
+        StatsRegisterCounter("defrag.ipv4.fragments", tv);
     dtv->counter_defrag_ipv4_reassembled =
-        SCPerfTVRegisterCounter("defrag.ipv4.reassembled", tv,
-            SC_PERF_TYPE_UINT64);
+        StatsRegisterCounter("defrag.ipv4.reassembled", tv);
     dtv->counter_defrag_ipv4_timeouts =
-        SCPerfTVRegisterCounter("defrag.ipv4.timeouts", tv,
-            SC_PERF_TYPE_UINT64);
+        StatsRegisterCounter("defrag.ipv4.timeouts", tv);
     dtv->counter_defrag_ipv6_fragments =
-        SCPerfTVRegisterCounter("defrag.ipv6.fragments", tv,
-            SC_PERF_TYPE_UINT64);
+        StatsRegisterCounter("defrag.ipv6.fragments", tv);
     dtv->counter_defrag_ipv6_reassembled =
-        SCPerfTVRegisterCounter("defrag.ipv6.reassembled", tv,
-            SC_PERF_TYPE_UINT64);
+        StatsRegisterCounter("defrag.ipv6.reassembled", tv);
     dtv->counter_defrag_ipv6_timeouts =
-        SCPerfTVRegisterCounter("defrag.ipv6.timeouts", tv,
-            SC_PERF_TYPE_UINT64);
+        StatsRegisterCounter("defrag.ipv6.timeouts", tv);
     dtv->counter_defrag_max_hit =
-        SCPerfTVRegisterCounter("defrag.max_frag_hits", tv,
-            SC_PERF_TYPE_UINT64);
+        StatsRegisterCounter("defrag.max_frag_hits", tv);
 
     return;
 }
index 355cdef9d141f0a4450ee84ec00afacaec3a95bd..6c27b76da0a72bba51710f164de58368ac4686ac 100644 (file)
@@ -1347,17 +1347,12 @@ TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data)
 {
     /* first register the counter. In delayed detect mode we exit right after if the
      * rules haven't been loaded yet. */
-    uint16_t counter_alerts = SCPerfTVRegisterCounter("detect.alert", tv,
-                                                      SC_PERF_TYPE_UINT64);
+    uint16_t counter_alerts = StatsRegisterCounter("detect.alert", tv);
 #ifdef PROFILING
-    uint16_t counter_mpm_list = SCPerfTVRegisterAvgCounter("detect.mpm_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
-    uint16_t counter_nonmpm_list = SCPerfTVRegisterAvgCounter("detect.nonmpm_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
-    uint16_t counter_fnonmpm_list = SCPerfTVRegisterAvgCounter("detect.fnonmpm_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
-    uint16_t counter_match_list = SCPerfTVRegisterAvgCounter("detect.match_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
+    uint16_t counter_mpm_list = StatsRegisterAvgCounter("detect.mpm_list", tv);
+    uint16_t counter_nonmpm_list = StatsRegisterAvgCounter("detect.nonmpm_list", tv);
+    uint16_t counter_fnonmpm_list = StatsRegisterAvgCounter("detect.fnonmpm_list", tv);
+    uint16_t counter_match_list = StatsRegisterAvgCounter("detect.match_list", tv);
 #endif
     DetectEngineThreadCtx *det_ctx = SCMalloc(sizeof(DetectEngineThreadCtx));
     if (unlikely(det_ctx == NULL))
@@ -1431,17 +1426,12 @@ static DetectEngineThreadCtx *DetectEngineThreadCtxInitForReload(
     }
 
     /** alert counter setup */
-    det_ctx->counter_alerts = SCPerfTVRegisterCounter("detect.alert", tv,
-                                                      SC_PERF_TYPE_UINT64);
+    det_ctx->counter_alerts = StatsRegisterCounter("detect.alert", tv);
 #ifdef PROFILING
-    uint16_t counter_mpm_list = SCPerfTVRegisterAvgCounter("detect.mpm_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
-    uint16_t counter_nonmpm_list = SCPerfTVRegisterAvgCounter("detect.nonmpm_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
-    uint16_t counter_fnonmpm_list = SCPerfTVRegisterAvgCounter("detect.fnonmpm_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
-    uint16_t counter_match_list = SCPerfTVRegisterAvgCounter("detect.match_list", tv,
-                                                      SC_PERF_TYPE_UINT64);
+    uint16_t counter_mpm_list = StatsRegisterAvgCounter("detect.mpm_list", tv);
+    uint16_t counter_nonmpm_list = StatsRegisterAvgCounter("detect.nonmpm_list", tv);
+    uint16_t counter_fnonmpm_list = StatsRegisterAvgCounter("detect.fnonmpm_list", tv);
+    uint16_t counter_match_list = StatsRegisterAvgCounter("detect.match_list", tv);
     det_ctx->counter_mpm_list = counter_mpm_list;
     det_ctx->counter_nonmpm_list = counter_nonmpm_list;
     det_ctx->counter_fnonmpm_list = counter_fnonmpm_list;
index 71bdef657237917c34b0fc17f2e787243689123e..1b5b24c4965e7ee7be0384a979b78ed07075e18f 100644 (file)
@@ -524,22 +524,14 @@ static TmEcode FlowManagerThreadInit(ThreadVars *t, void *initdata, void **data)
     /* pass thread data back to caller */
     *data = ftd;
 
-    ftd->flow_mgr_cnt_clo = SCPerfTVRegisterCounter("flow_mgr.closed_pruned", t,
-            SC_PERF_TYPE_UINT64);
-    ftd->flow_mgr_cnt_new = SCPerfTVRegisterCounter("flow_mgr.new_pruned", t,
-            SC_PERF_TYPE_UINT64);
-    ftd->flow_mgr_cnt_est = SCPerfTVRegisterCounter("flow_mgr.est_pruned", t,
-            SC_PERF_TYPE_UINT64);
-    ftd->flow_mgr_memuse = SCPerfTVRegisterCounter("flow.memuse", t,
-            SC_PERF_TYPE_UINT64);
-    ftd->flow_mgr_spare = SCPerfTVRegisterCounter("flow.spare", t,
-            SC_PERF_TYPE_UINT64);
-    ftd->flow_emerg_mode_enter = SCPerfTVRegisterCounter("flow.emerg_mode_entered", t,
-            SC_PERF_TYPE_UINT64);
-    ftd->flow_emerg_mode_over = SCPerfTVRegisterCounter("flow.emerg_mode_over", t,
-            SC_PERF_TYPE_UINT64);
-    ftd->flow_tcp_reuse = SCPerfTVRegisterCounter("flow.tcp_reuse", t,
-            SC_PERF_TYPE_UINT64);
+    ftd->flow_mgr_cnt_clo = StatsRegisterCounter("flow_mgr.closed_pruned", t);
+    ftd->flow_mgr_cnt_new = StatsRegisterCounter("flow_mgr.new_pruned", t);
+    ftd->flow_mgr_cnt_est = StatsRegisterCounter("flow_mgr.est_pruned", t);
+    ftd->flow_mgr_memuse = StatsRegisterCounter("flow.memuse", t);
+    ftd->flow_mgr_spare = StatsRegisterCounter("flow.spare", t);
+    ftd->flow_emerg_mode_enter = StatsRegisterCounter("flow.emerg_mode_entered", t);
+    ftd->flow_emerg_mode_over = StatsRegisterCounter("flow.emerg_mode_over", t);
+    ftd->flow_tcp_reuse = StatsRegisterCounter("flow.tcp_reuse", t);
 
     PacketPoolInit();
     return TM_ECODE_OK;
@@ -575,12 +567,9 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
     int flow_update_delay_nsec = FLOW_NORMAL_MODE_UPDATE_DELAY_NSEC;
 /* VJ leaving disabled for now, as hosts are only used by tags and the numbers
  * are really low. Might confuse ppl
-    uint16_t flow_mgr_host_prune = SCPerfTVRegisterCounter("hosts.pruned", th_v,
-            SC_PERF_TYPE_UINT64);
-    uint16_t flow_mgr_host_active = SCPerfTVRegisterCounter("hosts.active", th_v,
-            SC_PERF_TYPE_UINT64);
-    uint16_t flow_mgr_host_spare = SCPerfTVRegisterCounter("hosts.spare", th_v,
-            SC_PERF_TYPE_UINT64);
+    uint16_t flow_mgr_host_prune = StatsRegisterCounter("hosts.pruned", th_v);
+    uint16_t flow_mgr_host_active = StatsRegisterCounter("hosts.active", th_v);
+    uint16_t flow_mgr_host_spare = StatsRegisterCounter("hosts.spare", th_v);
 */
     memset(&ts, 0, sizeof(ts));
 
index 3b50ba8f31673d1253f3ec6b40e402ab5851c434..5fdaa80317621b4b7d60fc645b4a763e46a462c2 100644 (file)
@@ -1714,10 +1714,10 @@ TmEcode ReceiveAFPThreadInit(ThreadVars *tv, void *initdata, void **data)
     }
 
 #ifdef PACKET_STATISTICS
-    ptv->capture_kernel_packets = SCPerfTVRegisterCounter("capture.kernel_packets",
-            ptv->tv, SC_PERF_TYPE_UINT64);
-    ptv->capture_kernel_drops = SCPerfTVRegisterCounter("capture.kernel_drops",
-            ptv->tv, SC_PERF_TYPE_UINT64);
+    ptv->capture_kernel_packets = StatsRegisterCounter("capture.kernel_packets",
+            ptv->tv);
+    ptv->capture_kernel_drops = StatsRegisterCounter("capture.kernel_drops",
+            ptv->tv);
 #endif
 
     char *active_runmode = RunmodeGetActive();
index 55b273e0aa9bb1a2574a4ea18601f887af21bec2..0854a87c57981392b6f6c0e1109f3b6a9eadfdc9 100644 (file)
@@ -304,10 +304,8 @@ ReceiveErfDagThreadInit(ThreadVars *tv, void *initdata, void **data)
         SCReturnInt(TM_ECODE_FAILED);
     }
 
-    ewtn->packets = SCPerfTVRegisterCounter("capture.dag_packets",
-        tv, SC_PERF_TYPE_UINT64);
-    ewtn->drops = SCPerfTVRegisterCounter("capture.dag_drops",
-        tv, SC_PERF_TYPE_UINT64);
+    ewtn->packets = StatsRegisterCounter("capture.dag_packets", tv);
+    ewtn->drops = StatsRegisterCounter("capture.dag_drops", tv);
 
     ewtn->tv = tv;
     *data = (void *)ewtn;
index 665282605e9f318f6e692d0e5a99f82c1ae53cd4..bb3655afdb39a0d3695626685570dbf4c3904766 100644 (file)
@@ -436,28 +436,16 @@ TmEcode ReceiveMpipeLoop(ThreadVars *tv, void *data, void *slot)
 static void MpipeRegisterPerfCounters(MpipeThreadVars *ptv, ThreadVars *tv)
 {
     /* register counters */
-    ptv->max_mpipe_depth = SCPerfTVRegisterCounter("mpipe.max_mpipe_depth",
-                                                    tv,
-                                                    SC_PERF_TYPE_UINT64);
-    ptv->mpipe_drop = SCPerfTVRegisterCounter("mpipe.drop",
-                                              tv,
-                                              SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_0 = SCPerfTVRegisterCounter("mpipe.no_buf0", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_1 = SCPerfTVRegisterCounter("mpipe.no_buf1", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_2 = SCPerfTVRegisterCounter("mpipe.no_buf2", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_3 = SCPerfTVRegisterCounter("mpipe.no_buf3", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_4 = SCPerfTVRegisterCounter("mpipe.no_buf4", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_5 = SCPerfTVRegisterCounter("mpipe.no_buf5", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_6 = SCPerfTVRegisterCounter("mpipe.no_buf6", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    ptv->counter_no_buffers_7 = SCPerfTVRegisterCounter("mpipe.no_buf7", tv,
-                                                        SC_PERF_TYPE_UINT64);
+    ptv->max_mpipe_depth = StatsRegisterCounter("mpipe.max_mpipe_depth", tv);
+    ptv->mpipe_drop = StatsRegisterCounter("mpipe.drop", tv);
+    ptv->counter_no_buffers_0 = StatsRegisterCounter("mpipe.no_buf0", tv);
+    ptv->counter_no_buffers_1 = StatsRegisterCounter("mpipe.no_buf1", tv);
+    ptv->counter_no_buffers_2 = StatsRegisterCounter("mpipe.no_buf2", tv);
+    ptv->counter_no_buffers_3 = StatsRegisterCounter("mpipe.no_buf3", tv);
+    ptv->counter_no_buffers_4 = StatsRegisterCounter("mpipe.no_buf4", tv);
+    ptv->counter_no_buffers_5 = StatsRegisterCounter("mpipe.no_buf5", tv);
+    ptv->counter_no_buffers_6 = StatsRegisterCounter("mpipe.no_buf6", tv);
+    ptv->counter_no_buffers_7 = StatsRegisterCounter("mpipe.no_buf7", tv);
 }
 
 static const gxio_mpipe_buffer_size_enum_t gxio_buffer_sizes[] = {
index adf330fc67f7aa4e6e2e628e7b0dea10059732d1..0b70c6a6c6d6d46c105a9075d30a2546594dbb0d 100644 (file)
@@ -554,10 +554,10 @@ static TmEcode ReceiveNetmapThreadInit(ThreadVars *tv, void *initdata, void **da
     }
 
     /* basic counters */
-    ntv->capture_kernel_packets = SCPerfTVRegisterCounter("capture.kernel_packets",
-            ntv->tv, SC_PERF_TYPE_UINT64);
-    ntv->capture_kernel_drops = SCPerfTVRegisterCounter("capture.kernel_drops",
-            ntv->tv, SC_PERF_TYPE_UINT64);
+    ntv->capture_kernel_packets = StatsRegisterCounter("capture.kernel_packets",
+            ntv->tv);
+    ntv->capture_kernel_drops = StatsRegisterCounter("capture.kernel_drops",
+            ntv->tv);
 
     char const *active_runmode = RunmodeGetActive();
     if (active_runmode && !strcmp("workers", active_runmode)) {
index 98406ed504befc088b9ff8c1620b5ed6d1bfa6da..cb462af57e82666d0671c163f8c33b376aa7f838 100644 (file)
@@ -307,12 +307,10 @@ TmEcode ReceiveNFLOGThreadInit(ThreadVars *tv, void *initdata, void **data)
     }
 
 #ifdef PACKET_STATISTICS
-    ntv->capture_kernel_packets = SCPerfTVRegisterCounter("capture.kernel_packets",
-                                                           ntv->tv,
-                                                           SC_PERF_TYPE_UINT64);
-    ntv->capture_kernel_drops = SCPerfTVRegisterCounter("capture.kernel_drops",
-                                                        ntv->tv,
-                                                        SC_PERF_TYPE_UINT64);
+    ntv->capture_kernel_packets = StatsRegisterCounter("capture.kernel_packets",
+                                                       ntv->tv);
+    ntv->capture_kernel_drops = StatsRegisterCounter("capture.kernel_drops",
+                                                     ntv->tv);
 #endif
 
     char *active_runmode = RunmodeGetActive();
index 57237fed14409e25bd743392d102b162f644cf61..a092a7599e2f914fb338f068549e8b407e82bb63 100644 (file)
@@ -521,12 +521,12 @@ TmEcode ReceivePcapThreadInit(ThreadVars *tv, void *initdata, void **data)
 
     pcapconfig->DerefFunc(pcapconfig);
 
-    ptv->capture_kernel_packets = SCPerfTVRegisterCounter("capture.kernel_packets",
-            ptv->tv, SC_PERF_TYPE_UINT64);
-    ptv->capture_kernel_drops = SCPerfTVRegisterCounter("capture.kernel_drops",
-            ptv->tv, SC_PERF_TYPE_UINT64);
-    ptv->capture_kernel_ifdrops = SCPerfTVRegisterCounter("capture.kernel_ifdrops",
-            ptv->tv, SC_PERF_TYPE_UINT64);
+    ptv->capture_kernel_packets = StatsRegisterCounter("capture.kernel_packets",
+            ptv->tv);
+    ptv->capture_kernel_drops = StatsRegisterCounter("capture.kernel_drops",
+            ptv->tv);
+    ptv->capture_kernel_ifdrops = StatsRegisterCounter("capture.kernel_ifdrops",
+            ptv->tv);
 
     *data = (void *)ptv;
     SCReturnInt(TM_ECODE_OK);
@@ -620,12 +620,12 @@ TmEcode ReceivePcapThreadInit(ThreadVars *tv, void *initdata, void **data)
 
     ptv->datalink = pcap_datalink(ptv->pcap_handle);
 
-    ptv->capture_kernel_packets = SCPerfTVRegisterCounter("capture.kernel_packets",
-            ptv->tv, SC_PERF_TYPE_UINT64);
-    ptv->capture_kernel_drops = SCPerfTVRegisterCounter("capture.kernel_drops",
-            ptv->tv, SC_PERF_TYPE_UINT64);
-    ptv->capture_kernel_ifdrops = SCPerfTVRegisterCounter("capture.kernel_ifdrops",
-            ptv->tv, SC_PERF_TYPE_UINT64);
+    ptv->capture_kernel_packets = StatsRegisterCounter("capture.kernel_packets",
+            ptv->tv);
+    ptv->capture_kernel_drops = StatsRegisterCounter("capture.kernel_drops",
+            ptv->tv);
+    ptv->capture_kernel_ifdrops = StatsRegisterCounter("capture.kernel_ifdrops",
+            ptv->tv);
 
     *data = (void *)ptv;
 
index a7f1342a5c711313fa3fda9a2982465aba842e1f..a9fff4cbe22ede6a1e2ea7ac27aa8aa74510afa2 100644 (file)
@@ -497,10 +497,10 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data)
         }
     }
 
-    ptv->capture_kernel_packets = SCPerfTVRegisterCounter("capture.kernel_packets",
-            ptv->tv, SC_PERF_TYPE_UINT64);
-    ptv->capture_kernel_drops = SCPerfTVRegisterCounter("capture.kernel_drops",
-            ptv->tv, SC_PERF_TYPE_UINT64);
+    ptv->capture_kernel_packets = StatsRegisterCounter("capture.kernel_packets",
+            ptv->tv);
+    ptv->capture_kernel_drops = StatsRegisterCounter("capture.kernel_drops",
+            ptv->tv);
 
     /* A bit strange to have this here but we only have vlan information
      * during reading so we need to know if we want to keep vlan during
index 7331db1bd3b7a7932aac9b621a2cac25cc314b87..839a9ccd55f4a57032954f01c041a44e9c28b0ad 100644 (file)
@@ -514,7 +514,7 @@ int StreamTcpReassembleInit(char quiet)
     SCMutexInit(&segment_pool_cnt_mutex, NULL);
 #endif
 
-    SCPerfTVRegisterGlobalCounter("tcp.reassembly_memuse",
+    StatsRegisterGlobalCounter("tcp.reassembly_memuse",
             StreamTcpReassembleMemuseGlobalCounter);
     return 0;
 }
index 2136a8f5d525425e0715896cafa2b6c92ff332de..00e1e423a53f07814beb6303b985faad5eb2904a 100644 (file)
@@ -5073,43 +5073,28 @@ TmEcode StreamTcpThreadInit(ThreadVars *tv, void *initdata, void **data)
 
     *data = (void *)stt;
 
-    stt->counter_tcp_sessions = SCPerfTVRegisterCounter("tcp.sessions", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_ssn_memcap = SCPerfTVRegisterCounter("tcp.ssn_memcap_drop", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_pseudo = SCPerfTVRegisterCounter("tcp.pseudo", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_pseudo_failed = SCPerfTVRegisterCounter("tcp.pseudo_failed", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_invalid_checksum = SCPerfTVRegisterCounter("tcp.invalid_checksum", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_no_flow = SCPerfTVRegisterCounter("tcp.no_flow", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_memuse = SCPerfTVRegisterCounter("tcp.memuse", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_syn = SCPerfTVRegisterCounter("tcp.syn", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_synack = SCPerfTVRegisterCounter("tcp.synack", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->counter_tcp_rst = SCPerfTVRegisterCounter("tcp.rst", tv,
-                                                        SC_PERF_TYPE_UINT64);
+    stt->counter_tcp_sessions = StatsRegisterCounter("tcp.sessions", tv);
+    stt->counter_tcp_ssn_memcap = StatsRegisterCounter("tcp.ssn_memcap_drop", tv);
+    stt->counter_tcp_pseudo = StatsRegisterCounter("tcp.pseudo", tv);
+    stt->counter_tcp_pseudo_failed = StatsRegisterCounter("tcp.pseudo_failed", tv);
+    stt->counter_tcp_invalid_checksum = StatsRegisterCounter("tcp.invalid_checksum", tv);
+    stt->counter_tcp_no_flow = StatsRegisterCounter("tcp.no_flow", tv);
+    stt->counter_tcp_memuse = StatsRegisterCounter("tcp.memuse", tv);
+    stt->counter_tcp_syn = StatsRegisterCounter("tcp.syn", tv);
+    stt->counter_tcp_synack = StatsRegisterCounter("tcp.synack", tv);
+    stt->counter_tcp_rst = StatsRegisterCounter("tcp.rst", tv);
 
     /* init reassembly ctx */
     stt->ra_ctx = StreamTcpReassembleInitThreadCtx(tv);
     if (stt->ra_ctx == NULL)
         SCReturnInt(TM_ECODE_FAILED);
 
-    stt->ra_ctx->counter_tcp_segment_memcap = SCPerfTVRegisterCounter("tcp.segment_memcap_drop", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->ra_ctx->counter_tcp_stream_depth = SCPerfTVRegisterCounter("tcp.stream_depth_reached", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->ra_ctx->counter_tcp_reass_gap = SCPerfTVRegisterCounter("tcp.reassembly_gap", tv,
-                                                        SC_PERF_TYPE_UINT64);
+    stt->ra_ctx->counter_tcp_segment_memcap = StatsRegisterCounter("tcp.segment_memcap_drop", tv);
+    stt->ra_ctx->counter_tcp_stream_depth = StatsRegisterCounter("tcp.stream_depth_reached", tv);
+    stt->ra_ctx->counter_tcp_reass_gap = StatsRegisterCounter("tcp.reassembly_gap", tv);
     /** \fixme Find a better place in 2.1 as it is linked with app layer */
-    stt->ra_ctx->counter_htp_memuse = SCPerfTVRegisterCounter("http.memuse", tv,
-                                                        SC_PERF_TYPE_UINT64);
-    stt->ra_ctx->counter_htp_memcap = SCPerfTVRegisterCounter("http.memcap", tv,
-                                                        SC_PERF_TYPE_UINT64);
+    stt->ra_ctx->counter_htp_memuse = StatsRegisterCounter("http.memuse", tv);
+    stt->ra_ctx->counter_htp_memcap = StatsRegisterCounter("http.memcap", tv);
 
     SCLogDebug("StreamTcp thread specific ctx online at %p, reassembly ctx %p",
                 stt, stt->ra_ctx);