From 2d381f93f3f215f54cc97cee624e31f1522bb4b4 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 28 Sep 2019 08:16:45 +0200 Subject: [PATCH] stats: add global way to check if API is enabled --- src/counters.c | 5 +++++ src/counters.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/counters.c b/src/counters.c index e7f624990d..0bc808dfd3 100644 --- a/src/counters.c +++ b/src/counters.c @@ -116,6 +116,11 @@ static int stats_loggers_active = 1; static uint16_t counters_global_id = 0; +bool StatsEnabled(void) +{ + return (stats_enabled == TRUE); +} + static void StatsPublicThreadContextInit(StatsPublicThreadContext *t) { SCMutexInit(&t->m, NULL); diff --git a/src/counters.h b/src/counters.h index 0035d20f71..d59cdbc581 100644 --- a/src/counters.h +++ b/src/counters.h @@ -109,6 +109,7 @@ void StatsSetupPostConfigPreOutput(void); void StatsSetupPostConfigPostOutput(void); void StatsSpawnThreads(void); void StatsRegisterTests(void); +bool StatsEnabled(void); /* functions used to free the resources alloted by the Stats API */ void StatsReleaseResources(void); -- 2.47.2