From: Victor Julien Date: Mon, 23 Oct 2017 08:48:56 +0000 (+0200) Subject: detect/profiling: postpone setup X-Git-Tag: suricata-4.1.0-beta1~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31648913e6c6763ba13f1aa0c50684f8dc06cbdc;p=thirdparty%2Fsuricata.git detect/profiling: postpone setup Do this to allow for including of runtime buffer registrations. --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index 9fa32c2f6e..f035325a23 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -1904,6 +1904,13 @@ int SigGroupBuild(DetectEngineCtx *de_ctx) } #ifdef PROFILING + SCProfilingKeywordInitCounters(de_ctx); + de_ctx->profile_match_logging_threshold = UINT_MAX; // disabled + + intmax_t v = 0; + if (ConfGetInt("detect.profiling.inspect-logging-threshold", &v) == 1) + de_ctx->profile_match_logging_threshold = (uint32_t)v; + SCProfilingRuleInitCounters(de_ctx); #endif SCFree(de_ctx->app_mpms); diff --git a/src/detect-engine.c b/src/detect-engine.c index c162600dd5..f0d7dc9498 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -1067,15 +1067,6 @@ static DetectEngineCtx *DetectEngineCtxInitReal(int minimal, const char *prefix) /* init iprep... ignore errors for now */ (void)SRepInit(de_ctx); -#ifdef PROFILING - SCProfilingKeywordInitCounters(de_ctx); - de_ctx->profile_match_logging_threshold = UINT_MAX; // disabled - - intmax_t v = 0; - if (ConfGetInt("detect.profiling.inspect-logging-threshold", &v) == 1) - de_ctx->profile_match_logging_threshold = (uint32_t)v; -#endif - SCClassConfLoadClassficationConfigFile(de_ctx, NULL); SCRConfLoadReferenceConfigFile(de_ctx, NULL);