From: Jason Ish Date: Fri, 30 Aug 2024 14:11:07 +0000 (-0600) Subject: output: remove remaining ThreadExitPrintStats callbacks X-Git-Tag: suricata-8.0.0-beta1~905 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe69dd972a4bfaae48a013937ed6cacd0066ab33;p=thirdparty%2Fsuricata.git output: remove remaining ThreadExitPrintStats callbacks Not used in output modules. Ticket: #7227 --- diff --git a/src/flow-worker.c b/src/flow-worker.c index 331f6ea708..63de42a266 100644 --- a/src/flow-worker.c +++ b/src/flow-worker.c @@ -742,12 +742,6 @@ const char *ProfileFlowWorkerIdToString(enum ProfileFlowWorkerId fwi) return "error"; } -static void FlowWorkerExitPrintStats(ThreadVars *tv, void *data) -{ - FlowWorkerThreadData *fw = data; - OutputLoggerExitPrintStats(tv, fw->output_thread); -} - static bool FlowWorkerIsBusy(ThreadVars *tv, void *flow_worker) { FlowWorkerThreadData *fw = flow_worker; @@ -775,7 +769,6 @@ void TmModuleFlowWorkerRegister (void) tmm_modules[TMM_FLOWWORKER].Func = FlowWorker; tmm_modules[TMM_FLOWWORKER].ThreadBusy = FlowWorkerIsBusy; tmm_modules[TMM_FLOWWORKER].ThreadDeinit = FlowWorkerThreadDeinit; - tmm_modules[TMM_FLOWWORKER].ThreadExitPrintStats = FlowWorkerExitPrintStats; tmm_modules[TMM_FLOWWORKER].cap_flags = 0; tmm_modules[TMM_FLOWWORKER].flags = TM_FLAG_STREAM_TM|TM_FLAG_DETECT_TM; } diff --git a/src/output-packet.c b/src/output-packet.c index 14dabe7c69..d6b22783ec 100644 --- a/src/output-packet.c +++ b/src/output-packet.c @@ -193,7 +193,7 @@ static uint32_t OutputPacketLoggerGetActiveCount(void) void OutputPacketLoggerRegister(void) { - OutputRegisterRootLogger(OutputPacketLogThreadInit, OutputPacketLogThreadDeinit, NULL, + OutputRegisterRootLogger(OutputPacketLogThreadInit, OutputPacketLogThreadDeinit, OutputPacketLog, OutputPacketLoggerGetActiveCount); } diff --git a/src/output-streaming.c b/src/output-streaming.c index 8c1d54888f..2c24a8c3d7 100644 --- a/src/output-streaming.c +++ b/src/output-streaming.c @@ -431,7 +431,7 @@ static uint32_t OutputStreamingLoggerGetActiveCount(void) } void OutputStreamingLoggerRegister(void) { - OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputStreamingLogThreadDeinit, NULL, + OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputStreamingLogThreadDeinit, OutputStreamingLog, OutputStreamingLoggerGetActiveCount); } diff --git a/src/output-tx.c b/src/output-tx.c index 3a870529c1..40b8877067 100644 --- a/src/output-tx.c +++ b/src/output-tx.c @@ -654,7 +654,7 @@ void OutputTxLoggerRegister (void) if (unlikely(list == NULL)) { FatalError("Failed to allocate OutputTx list"); } - OutputRegisterRootLogger(OutputTxLogThreadInit, OutputTxLogThreadDeinit, NULL, OutputTxLog, + OutputRegisterRootLogger(OutputTxLogThreadInit, OutputTxLogThreadDeinit, OutputTxLog, OutputTxLoggerGetActiveCount); } diff --git a/src/output.c b/src/output.c index 3d1a9edd2d..db399e25a6 100644 --- a/src/output.c +++ b/src/output.c @@ -87,7 +87,6 @@ typedef struct RootLogger_ { OutputLogFunc LogFunc; ThreadInitFunc ThreadInit; ThreadDeinitFunc ThreadDeinit; - ThreadExitPrintStatsFunc ThreadExitPrintStats; OutputGetActiveCountFunc ActiveCntFunc; TAILQ_ENTRY(RootLogger_) entries; @@ -777,24 +776,8 @@ TmEcode OutputLoggerThreadDeinit(ThreadVars *tv, void *thread_data) return TM_ECODE_OK; } -void OutputLoggerExitPrintStats(ThreadVars *tv, void *thread_data) -{ - LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data; - RootLogger *logger = TAILQ_FIRST(&active_loggers); - LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store); - while (logger && thread_store_node) { - if (logger->ThreadExitPrintStats != NULL) { - logger->ThreadExitPrintStats(tv, thread_store_node->thread_data); - } - logger = TAILQ_NEXT(logger, entries); - thread_store_node = TAILQ_NEXT(thread_store_node, entries); - } -} - -void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats, - OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc) +void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, + OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc) { BUG_ON(LogFunc == NULL); @@ -804,7 +787,6 @@ void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, } logger->ThreadInit = ThreadInit; logger->ThreadDeinit = ThreadDeinit; - logger->ThreadExitPrintStats = ThreadExitPrintStats; logger->LogFunc = LogFunc; logger->ActiveCntFunc = ActiveCntFunc; TAILQ_INSERT_TAIL(®istered_loggers, logger, entries); @@ -818,7 +800,6 @@ static void OutputRegisterActiveLogger(RootLogger *reg) } logger->ThreadInit = reg->ThreadInit; logger->ThreadDeinit = reg->ThreadDeinit; - logger->ThreadExitPrintStats = reg->ThreadExitPrintStats; logger->LogFunc = reg->LogFunc; logger->ActiveCntFunc = reg->ActiveCntFunc; TAILQ_INSERT_TAIL(&active_loggers, logger, entries); diff --git a/src/output.h b/src/output.h index 966b9a07c6..a7652f8d9d 100644 --- a/src/output.h +++ b/src/output.h @@ -63,7 +63,6 @@ typedef struct OutputModule_ { ThreadInitFunc ThreadInit; ThreadDeinitFunc ThreadDeinit; - ThreadExitPrintStatsFunc ThreadExitPrintStats; PacketLogger PacketLogFunc; PacketLogCondition PacketConditionFunc; @@ -150,10 +149,8 @@ void OutputRegisterFileRotationFlag(int *flag); void OutputUnregisterFileRotationFlag(int *flag); void OutputNotifyFileRotation(void); -void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats, - OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc); +void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, + OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc); void TmModuleLoggerRegister(void); TmEcode OutputLoggerLog(ThreadVars *, Packet *, void *);