From 4b9a62d1fe571cf9a3b63382e5751b2e97f17b4c Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 31 May 2016 14:41:31 +0200 Subject: [PATCH] profiling: fix compilation if libjansson is missing --- src/detect-engine-profile.c | 2 ++ src/detect.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/detect-engine-profile.c b/src/detect-engine-profile.c index f512765723..c602417929 100644 --- a/src/detect-engine-profile.c +++ b/src/detect-engine-profile.c @@ -32,6 +32,7 @@ #include "util-print.h" #ifdef PROFILING +#ifdef HAVE_LIBJANSSON static void DumpFp(const SigMatch *sm, char *pat_orig, uint32_t pat_orig_sz, char *pat_chop, uint32_t pat_chop_sz) { int fast_pattern_chop_set = 0; @@ -133,4 +134,5 @@ void RulesDumpMatchArray(const DetectEngineThreadCtx *det_ctx, const Packet *p) json_object_clear(js); json_decref(js); } +#endif /* HAVE_LIBJANSSON */ #endif /* PROFILING */ diff --git a/src/detect.c b/src/detect.c index 9fb005fcf1..f6296044e8 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1516,8 +1516,10 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh SGH_PROFILING_RECORD(det_ctx, det_ctx->sgh); #ifdef PROFILING +#ifdef HAVE_LIBJANSSON if (match_cnt >= de_ctx->profile_match_logging_threshold) RulesDumpMatchArray(det_ctx, p); +#endif #endif uint32_t sflags, next_sflags = 0;