stats: turn sync macros into functions

pull/9882/head
Victor Julien 2 years ago committed by Victor Julien
parent 3107a4953d
commit 74bc27ecd5

@ -453,6 +453,18 @@ static void *StatsMgmtThread(void *arg)
return NULL;
}
void StatsSyncCounters(ThreadVars *tv)
{
StatsUpdateCounterArray(&tv->perf_private_ctx, &tv->perf_public_ctx);
}
void StatsSyncCountersIfSignalled(ThreadVars *tv)
{
if (tv->perf_public_ctx.perf_flag == 1) {
StatsUpdateCounterArray(&tv->perf_private_ctx, &tv->perf_public_ctx);
}
}
/**
* \brief Wake up thread. This thread wakes up every TTS(time to sleep) seconds
* and sets the flag for every ThreadVars' StatsPublicThreadContext

@ -135,16 +135,8 @@ uint64_t StatsGetLocalCounterValue(struct ThreadVars_ *, uint16_t);
int StatsSetupPrivate(struct ThreadVars_ *);
void StatsThreadCleanup(struct ThreadVars_ *);
#define StatsSyncCounters(tv) \
StatsUpdateCounterArray(&(tv)->perf_private_ctx, &(tv)->perf_public_ctx); \
#define StatsSyncCountersIfSignalled(tv) \
do { \
if ((tv)->perf_public_ctx.perf_flag == 1) { \
StatsUpdateCounterArray(&(tv)->perf_private_ctx, \
&(tv)->perf_public_ctx); \
} \
} while (0)
void StatsSyncCounters(struct ThreadVars_ *tv);
void StatsSyncCountersIfSignalled(struct ThreadVars_ *tv);
#ifdef BUILD_UNIX_SOCKET
TmEcode StatsOutputCounterSocket(json_t *cmd,

Loading…
Cancel
Save