]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
counters: remove threadvars arg from SCPerfAddToClubbedTMTable
authorVictor Julien <victor@inliniac.net>
Sun, 24 May 2015 16:32:58 +0000 (18:32 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 26 May 2015 20:05:44 +0000 (22:05 +0200)
src/counters.c

index a74f99efb80ddab6d70fe0bdfbf0b1a946c87256..309a290da1ce4a41ff12e43d9e46dbce5010cc04 100644 (file)
@@ -1038,7 +1038,7 @@ void CountersIdHashFreeFunc(void *data)
  *
  *  \retval 1 on success, 0 on failure
  */
-static int SCPerfAddToClubbedTMTable(ThreadVars *tv, SCPerfPublicContext *pctx)
+static int SCPerfAddToClubbedTMTable(const char *thread_name, SCPerfPublicContext *pctx)
 {
     if (sc_perf_op_ctx == NULL) {
         SCLogDebug("Counter module has been disabled");
@@ -1047,7 +1047,7 @@ static int SCPerfAddToClubbedTMTable(ThreadVars *tv, SCPerfPublicContext *pctx)
 
     SCPerfClubTMInst *temp = NULL;
 
-    if (tv == NULL || pctx == NULL) {
+    if (thread_name == NULL || pctx == NULL) {
         SCLogDebug("supplied argument(s) to SCPerfAddToClubbedTMTable NULL");
         return 0;
     }
@@ -1083,7 +1083,7 @@ static int SCPerfAddToClubbedTMTable(ThreadVars *tv, SCPerfPublicContext *pctx)
 
     temp->ctx = pctx;
 
-    temp->name = SCStrdup(tv->name);
+    temp->name = SCStrdup(thread_name);
     if (unlikely(temp->name == NULL)) {
         SCFree(temp);
         SCMutexUnlock(&sc_perf_op_ctx->pctmi_lock);
@@ -1173,7 +1173,7 @@ int SCPerfSetupPrivate(ThreadVars *tv)
 {
     SCPerfGetAllCountersArray(&(tv)->perf_public_ctx, &(tv)->perf_private_ctx);
 
-    SCPerfAddToClubbedTMTable(tv, &(tv)->perf_public_ctx);
+    SCPerfAddToClubbedTMTable(tv->name, &(tv)->perf_public_ctx);
     return 0;
 }