Not used.
Ticket: #7227
void LogStatsLogRegister (void)
{
- OutputRegisterStatsModule(LOGGER_STATS, MODULE_NAME, "stats",
- LogStatsLogInitCtx, LogStatsLogger, LogStatsLogThreadInit,
- LogStatsLogThreadDeinit, NULL);
+ OutputRegisterStatsModule(LOGGER_STATS, MODULE_NAME, "stats", LogStatsLogInitCtx,
+ LogStatsLogger, LogStatsLogThreadInit, LogStatsLogThreadDeinit);
}
void JsonStatsLogRegister(void) {
/* register as child of eve-log */
- OutputRegisterStatsSubModule(LOGGER_JSON_STATS, "eve-log", MODULE_NAME,
- "eve-log.stats", OutputStatsLogInitSub, JsonStatsLogger,
- JsonStatsLogThreadInit, JsonStatsLogThreadDeinit, NULL);
+ OutputRegisterStatsSubModule(LOGGER_JSON_STATS, "eve-log", MODULE_NAME, "eve-log.stats",
+ OutputStatsLogInitSub, JsonStatsLogger, JsonStatsLogThreadInit,
+ JsonStatsLogThreadDeinit);
}
#ifdef UNITTESTS
const char *name;
ThreadInitFunc ThreadInit;
ThreadDeinitFunc ThreadDeinit;
- ThreadExitPrintStatsFunc ThreadExitPrintStats;
} OutputStatsLogger;
static OutputStatsLogger *list = NULL;
-int OutputRegisterStatsLogger(const char *name, StatsLogger LogFunc,
- OutputCtx *output_ctx, ThreadInitFunc ThreadInit,
- ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats)
+int OutputRegisterStatsLogger(const char *name, StatsLogger LogFunc, OutputCtx *output_ctx,
+ ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
{
OutputStatsLogger *op = SCCalloc(1, sizeof(*op));
if (op == NULL)
op->name = name;
op->ThreadInit = ThreadInit;
op->ThreadDeinit = ThreadDeinit;
- op->ThreadExitPrintStats = ThreadExitPrintStats;
if (list == NULL)
list = op;
return TM_ECODE_OK;
}
-static void OutputStatsLogExitPrintStats(ThreadVars *tv, void *thread_data)
-{
- OutputStatsLoggerThreadData *op_thread_data = (OutputStatsLoggerThreadData *)thread_data;
- OutputLoggerThreadStore *store = op_thread_data->store;
- OutputStatsLogger *logger = list;
-
- while (logger && store) {
- if (logger->ThreadExitPrintStats) {
- logger->ThreadExitPrintStats(tv, store->thread_data);
- }
-
- logger = logger->next;
- store = store->next;
- }
-}
-
void TmModuleStatsLoggerRegister (void)
{
tmm_modules[TMM_STATSLOGGER].name = "__stats_logger__";
tmm_modules[TMM_STATSLOGGER].ThreadInit = OutputStatsLogThreadInit;
- tmm_modules[TMM_STATSLOGGER].ThreadExitPrintStats = OutputStatsLogExitPrintStats;
tmm_modules[TMM_STATSLOGGER].ThreadDeinit = OutputStatsLogThreadDeinit;
tmm_modules[TMM_STATSLOGGER].cap_flags = 0;
}
typedef int (*StatsLogger)(ThreadVars *, void *thread_data, const StatsTable *);
-int OutputRegisterStatsLogger(const char *name, StatsLogger LogFunc,
- OutputCtx *, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats);
+int OutputRegisterStatsLogger(const char *name, StatsLogger LogFunc, OutputCtx *,
+ ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
void TmModuleStatsLoggerRegister (void);
*
* \retval Returns 0 on success, -1 on failure.
*/
-void OutputRegisterStatsModule(LoggerId id, const char *name,
- const char *conf_name, OutputInitFunc InitFunc, StatsLogger StatsLogFunc,
- ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name,
+ OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
+ ThreadDeinitFunc ThreadDeinit)
{
if (unlikely(StatsLogFunc == NULL)) {
goto error;
module->StatsLogFunc = StatsLogFunc;
module->ThreadInit = ThreadInit;
module->ThreadDeinit = ThreadDeinit;
- module->ThreadExitPrintStats = ThreadExitPrintStats;
TAILQ_INSERT_TAIL(&output_modules, module, entries);
SCLogDebug("Stats logger \"%s\" registered.", name);
*
* \retval Returns 0 on success, -1 on failure.
*/
-void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name,
- const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
- StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
- ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name, const char *name,
+ const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc,
+ ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
{
if (unlikely(StatsLogFunc == NULL)) {
goto error;
module->StatsLogFunc = StatsLogFunc;
module->ThreadInit = ThreadInit;
module->ThreadDeinit = ThreadDeinit;
- module->ThreadExitPrintStats = ThreadExitPrintStats;
TAILQ_INSERT_TAIL(&output_modules, module, entries);
SCLogDebug("Stats logger \"%s\" registered.", name);
enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit,
ThreadDeinitFunc ThreadDeinit);
-void OutputRegisterStatsModule(LoggerId id, const char *name,
- const char *conf_name, OutputInitFunc InitFunc,
- StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
- ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats);
-void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name,
- const char *name, const char *conf_name,
- OutputInitSubFunc InitFunc,
- StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
- ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats);
+void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name,
+ OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
+ ThreadDeinitFunc ThreadDeinit);
+void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name, const char *name,
+ const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc,
+ ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
OutputModule *OutputGetModuleByConfName(const char *name);
void OutputDeregisterAll(void);
}
/* stats logger doesn't run in the packet path */
if (module->StatsLogFunc) {
- OutputRegisterStatsLogger(module->name, module->StatsLogFunc,
- output_ctx,module->ThreadInit, module->ThreadDeinit,
- module->ThreadExitPrintStats);
+ OutputRegisterStatsLogger(module->name, module->StatsLogFunc, output_ctx,
+ module->ThreadInit, module->ThreadDeinit);
return;
}