]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
counters: remove thread module name from counters API
authorVictor Julien <victor@inliniac.net>
Sun, 24 May 2015 15:58:13 +0000 (17:58 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 26 May 2015 20:05:44 +0000 (22:05 +0200)
src/counters.c
src/counters.h

index a0e13f93e6700a391ccd7dc84805c2cba18c084f..a74f99efb80ddab6d70fe0bdfbf0b1a946c87256 100644 (file)
@@ -499,9 +499,6 @@ static void SCPerfReleaseCounter(SCPerfCounter *pc)
         if (pc->cname != NULL)
             SCFree(pc->cname);
 
-        if (pc->tm_name != NULL)
-            SCFree(pc->tm_name);
-
         SCFree(pc);
     }
 
@@ -545,8 +542,7 @@ static uint16_t SCPerfRegisterQualifiedCounter(char *cname, char *tm_name,
     while (temp != NULL) {
         prev = temp;
 
-        if (strcmp(cname, temp->cname) == 0 &&
-            strcmp(tm_name, temp->tm_name) == 0) {
+        if (strcmp(cname, temp->cname) == 0) {
             break;
         }
 
@@ -567,11 +563,6 @@ static uint16_t SCPerfRegisterQualifiedCounter(char *cname, char *tm_name,
         exit(EXIT_FAILURE);
     }
 
-    if ( (pc->tm_name = SCStrdup(tm_name)) == NULL) {
-        SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory");
-        exit(EXIT_FAILURE);
-    }
-
     /* assign a unique id to this SCPerfCounter.  The id is local to this
      * PerfContext.  Please note that the id start from 1, and not 0 */
     pc->id = ++(pctx->curr_id);
@@ -1099,16 +1090,6 @@ static int SCPerfAddToClubbedTMTable(ThreadVars *tv, SCPerfPublicContext *pctx)
         return 0;
     }
 
-    if (tv->thread_group_name != NULL) {
-        temp->tm_name = SCStrdup(tv->thread_group_name);
-        if (unlikely(temp->tm_name == NULL)) {
-            SCFree(temp->name);
-            SCFree(temp);
-            SCMutexUnlock(&sc_perf_op_ctx->pctmi_lock);
-            return 0;
-        }
-    }
-
     temp->next = sc_perf_op_ctx->pctmi;
     sc_perf_op_ctx->pctmi = temp;
     SCLogInfo("sc_perf_op_ctx->pctmi %p", sc_perf_op_ctx->pctmi);
index 30f44d4cfea7620856451a235f73e7f78de89aad..527c011be9dcc2dad9b5c5a0e2aa81fb596f09ff 100644 (file)
@@ -58,8 +58,6 @@ typedef struct SCPerfCounter_ {
 
     /* name of the counter */
     char *cname;
-    /* name of the thread module this counter is registered to */
-    char *tm_name;
 
     /* the next perfcounter for this tv's tm instance */
     struct SCPerfCounter_ *next;