From: Victor Julien Date: Sun, 24 May 2015 16:32:58 +0000 (+0200) Subject: counters: remove threadvars arg from SCPerfAddToClubbedTMTable X-Git-Tag: suricata-3.0RC1~380 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0478407833fe1328fa2014804c89fec87c44da1b;p=thirdparty%2Fsuricata.git counters: remove threadvars arg from SCPerfAddToClubbedTMTable --- diff --git a/src/counters.c b/src/counters.c index a74f99efb8..309a290da1 100644 --- a/src/counters.c +++ b/src/counters.c @@ -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; }