output-streaming: remove ThreadExitPrintStats callback

Not used.

Ticket: #7227
pull/11689/head
Jason Ish 11 months ago committed by Victor Julien
parent a93bd8a387
commit 07d4d08665

@ -44,12 +44,12 @@ static void LogTcpDataLogDeInitCtx(OutputCtx *);
int LogTcpDataLogger(ThreadVars *tv, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags); int LogTcpDataLogger(ThreadVars *tv, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags);
void LogTcpDataLogRegister (void) { void LogTcpDataLogRegister (void) {
OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "tcp-data", OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "tcp-data", LogTcpDataLogInitCtx,
LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_TCP_DATA, LogTcpDataLogger, STREAMING_TCP_DATA, LogTcpDataLogThreadInit,
LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, NULL); LogTcpDataLogThreadDeinit);
OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "http-body-data", OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "http-body-data",
LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_HTTP_BODIES, LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_HTTP_BODIES, LogTcpDataLogThreadInit,
LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, NULL); LogTcpDataLogThreadDeinit);
} }
typedef struct LogTcpDataFileCtx_ { typedef struct LogTcpDataFileCtx_ {

@ -56,16 +56,13 @@ typedef struct OutputStreamingLogger_ {
enum OutputStreamingType type; enum OutputStreamingType type;
ThreadInitFunc ThreadInit; ThreadInitFunc ThreadInit;
ThreadDeinitFunc ThreadDeinit; ThreadDeinitFunc ThreadDeinit;
ThreadExitPrintStatsFunc ThreadExitPrintStats;
} OutputStreamingLogger; } OutputStreamingLogger;
static OutputStreamingLogger *list = NULL; static OutputStreamingLogger *list = NULL;
int OutputRegisterStreamingLogger(LoggerId id, const char *name, int OutputRegisterStreamingLogger(LoggerId id, const char *name, StreamingLogger LogFunc,
StreamingLogger LogFunc, OutputCtx *output_ctx, OutputCtx *output_ctx, enum OutputStreamingType type, ThreadInitFunc ThreadInit,
enum OutputStreamingType type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
ThreadDeinitFunc ThreadDeinit,
ThreadExitPrintStatsFunc ThreadExitPrintStats)
{ {
OutputStreamingLogger *op = SCCalloc(1, sizeof(*op)); OutputStreamingLogger *op = SCCalloc(1, sizeof(*op));
if (op == NULL) if (op == NULL)
@ -78,7 +75,6 @@ int OutputRegisterStreamingLogger(LoggerId id, const char *name,
op->type = type; op->type = type;
op->ThreadInit = ThreadInit; op->ThreadInit = ThreadInit;
op->ThreadDeinit = ThreadDeinit; op->ThreadDeinit = ThreadDeinit;
op->ThreadExitPrintStats = ThreadExitPrintStats;
if (list == NULL) if (list == NULL)
list = op; list = op;
@ -425,22 +421,6 @@ static TmEcode OutputStreamingLogThreadDeinit(ThreadVars *tv, void *thread_data)
return TM_ECODE_OK; return TM_ECODE_OK;
} }
static void OutputStreamingLogExitPrintStats(ThreadVars *tv, void *thread_data) {
OutputStreamingLoggerThreadData *op_thread_data =
(OutputStreamingLoggerThreadData *)thread_data;
OutputLoggerThreadStore *store = op_thread_data->store;
OutputStreamingLogger *logger = list;
while (logger && store) {
if (logger->ThreadExitPrintStats) {
logger->ThreadExitPrintStats(tv, store->thread_data);
}
logger = logger->next;
store = store->next;
}
}
static uint32_t OutputStreamingLoggerGetActiveCount(void) static uint32_t OutputStreamingLoggerGetActiveCount(void)
{ {
uint32_t cnt = 0; uint32_t cnt = 0;
@ -451,9 +431,8 @@ static uint32_t OutputStreamingLoggerGetActiveCount(void)
} }
void OutputStreamingLoggerRegister(void) { void OutputStreamingLoggerRegister(void) {
OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputStreamingLogThreadDeinit, NULL,
OutputStreamingLogThreadDeinit, OutputStreamingLogExitPrintStats, OutputStreamingLog, OutputStreamingLoggerGetActiveCount);
OutputStreamingLog, OutputStreamingLoggerGetActiveCount);
} }
void OutputStreamingShutdown(void) void OutputStreamingShutdown(void)

@ -42,10 +42,9 @@ typedef int (*StreamingLogger)(ThreadVars *, void *thread_data,
const Flow *f, const uint8_t *data, uint32_t data_len, const Flow *f, const uint8_t *data, uint32_t data_len,
uint64_t tx_id, uint8_t flags); uint64_t tx_id, uint8_t flags);
int OutputRegisterStreamingLogger(LoggerId id, const char *name, int OutputRegisterStreamingLogger(LoggerId id, const char *name, StreamingLogger LogFunc,
StreamingLogger LogFunc, OutputCtx *, enum OutputStreamingType, OutputCtx *, enum OutputStreamingType, ThreadInitFunc ThreadInit,
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadDeinitFunc ThreadDeinit);
ThreadExitPrintStatsFunc ThreadExitPrintStats);
void OutputStreamingLoggerRegister (void); void OutputStreamingLoggerRegister (void);

@ -501,12 +501,10 @@ error:
* *
* \retval Returns 0 on success, -1 on failure. * \retval Returns 0 on success, -1 on failure.
*/ */
void OutputRegisterStreamingModule(LoggerId id, const char *name, void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name,
const char *conf_name, OutputInitFunc InitFunc, OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc,
StreamingLogger StreamingLogFunc, enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit,
enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
ThreadDeinitFunc ThreadDeinit,
ThreadExitPrintStatsFunc ThreadExitPrintStats)
{ {
if (unlikely(StreamingLogFunc == NULL)) { if (unlikely(StreamingLogFunc == NULL)) {
goto error; goto error;
@ -525,7 +523,6 @@ void OutputRegisterStreamingModule(LoggerId id, const char *name,
module->stream_type = stream_type; module->stream_type = stream_type;
module->ThreadInit = ThreadInit; module->ThreadInit = ThreadInit;
module->ThreadDeinit = ThreadDeinit; module->ThreadDeinit = ThreadDeinit;
module->ThreadExitPrintStats = ThreadExitPrintStats;
TAILQ_INSERT_TAIL(&output_modules, module, entries); TAILQ_INSERT_TAIL(&output_modules, module, entries);
SCLogDebug("Streaming logger \"%s\" registered.", name); SCLogDebug("Streaming logger \"%s\" registered.", name);

@ -131,7 +131,7 @@ void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const cha
void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name, void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name,
OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc, OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc,
enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit, enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit,
ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats); ThreadDeinitFunc ThreadDeinit);
void OutputRegisterStatsModule(LoggerId id, const char *name, void OutputRegisterStatsModule(LoggerId id, const char *name,
const char *conf_name, OutputInitFunc InitFunc, const char *conf_name, OutputInitFunc InitFunc,

@ -641,10 +641,8 @@ static void SetupOutput(
file_logger_count++; file_logger_count++;
} else if (module->StreamingLogFunc) { } else if (module->StreamingLogFunc) {
SCLogDebug("%s is a streaming logger", module->name); SCLogDebug("%s is a streaming logger", module->name);
OutputRegisterStreamingLogger(module->logger_id, module->name, OutputRegisterStreamingLogger(module->logger_id, module->name, module->StreamingLogFunc,
module->StreamingLogFunc, output_ctx, module->stream_type, output_ctx, module->stream_type, module->ThreadInit, module->ThreadDeinit);
module->ThreadInit, module->ThreadDeinit,
module->ThreadExitPrintStats);
} else { } else {
SCLogError("Unknown logger type: name=%s", module->name); SCLogError("Unknown logger type: name=%s", module->name);
} }

Loading…
Cancel
Save