]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: remove remaining ThreadExitPrintStats callbacks
authorJason Ish <jason.ish@oisf.net>
Fri, 30 Aug 2024 14:11:07 +0000 (08:11 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 31 Aug 2024 08:53:59 +0000 (10:53 +0200)
Not used in output modules.

Ticket: #7227

src/flow-worker.c
src/output-packet.c
src/output-streaming.c
src/output-tx.c
src/output.c
src/output.h

index 331f6ea7086aac604bb69acbf3d4531ea2ff50db..63de42a26650b4381b01f5c1128c7478a462dab9 100644 (file)
@@ -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;
 }
index 14dabe7c699d93e42964923d8e3121451abf7ab6..d6b22783ecd51d465226785299650bd6ede5bcef 100644 (file)
@@ -193,7 +193,7 @@ static uint32_t OutputPacketLoggerGetActiveCount(void)
 
 void OutputPacketLoggerRegister(void)
 {
-    OutputRegisterRootLogger(OutputPacketLogThreadInit, OutputPacketLogThreadDeinit, NULL,
+    OutputRegisterRootLogger(OutputPacketLogThreadInit, OutputPacketLogThreadDeinit,
             OutputPacketLog, OutputPacketLoggerGetActiveCount);
 }
 
index 8c1d54888f8dd75e24648b26190c85d673e56cac..2c24a8c3d7a6ae81f4b430459e5471611ab10962 100644 (file)
@@ -431,7 +431,7 @@ static uint32_t OutputStreamingLoggerGetActiveCount(void)
 }
 
 void OutputStreamingLoggerRegister(void) {
-    OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputStreamingLogThreadDeinit, NULL,
+    OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputStreamingLogThreadDeinit,
             OutputStreamingLog, OutputStreamingLoggerGetActiveCount);
 }
 
index 3a870529c1b867b00ad18a43c86d74651c982215..40b8877067701b2e26c15001dbe53604302bab21 100644 (file)
@@ -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);
 }
 
index 3d1a9edd2d612e551ddcce14bae80280adbd502a..db399e25a65594aad55a05fc8f025a2227d74afb 100644 (file)
@@ -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(&registered_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);
index 966b9a07c64d8b3965020223174606c3b8105a8a..a7652f8d9d0fd09b3620324c3131101b3f7c1501 100644 (file)
@@ -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 *);