From: Jason Ish Date: Mon, 20 Feb 2017 18:00:15 +0000 (-0600) Subject: logging: remove unused print stats callbacks X-Git-Tag: suricata-4.0.0-beta1~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2606%2Fhead;p=thirdparty%2Fsuricata.git logging: remove unused print stats callbacks Remove the ThreadExitPrintStats callback from logging modules that weren't doing anything with it. --- diff --git a/src/alert-debuglog.c b/src/alert-debuglog.c index 6c56f69973..74ff011280 100644 --- a/src/alert-debuglog.c +++ b/src/alert-debuglog.c @@ -412,14 +412,6 @@ static TmEcode AlertDebugLogThreadDeinit(ThreadVars *t, void *data) return TM_ECODE_OK; } -static void AlertDebugLogExitPrintStats(ThreadVars *tv, void *data) -{ - AlertDebugLogThread *aft = (AlertDebugLogThread *)data; - if (aft == NULL) { - return; - } -} - static void AlertDebugLogDeInitCtx(OutputCtx *output_ctx) { if (output_ctx != NULL) { @@ -490,6 +482,5 @@ void AlertDebugLogRegister(void) { OutputRegisterPacketModule(LOGGER_ALERT_DEBUG, MODULE_NAME, "alert-debug", AlertDebugLogInitCtx, AlertDebugLogLogger, AlertDebugLogCondition, - AlertDebugLogThreadInit, AlertDebugLogThreadDeinit, - AlertDebugLogExitPrintStats); + AlertDebugLogThreadInit, AlertDebugLogThreadDeinit, NULL); } diff --git a/src/alert-fastlog.c b/src/alert-fastlog.c index d3f2455085..d475a6a38c 100644 --- a/src/alert-fastlog.c +++ b/src/alert-fastlog.c @@ -69,7 +69,6 @@ TmEcode AlertFastLogThreadInit(ThreadVars *, void *, void **); TmEcode AlertFastLogThreadDeinit(ThreadVars *, void *); -void AlertFastLogExitPrintStats(ThreadVars *, void *); void AlertFastLogRegisterTests(void); static void AlertFastLogDeInitCtx(OutputCtx *); @@ -80,8 +79,7 @@ void AlertFastLogRegister(void) { OutputRegisterPacketModule(LOGGER_ALERT_FAST, MODULE_NAME, "fast", AlertFastLogInitCtx, AlertFastLogger, AlertFastLogCondition, - AlertFastLogThreadInit, AlertFastLogThreadDeinit, - AlertFastLogExitPrintStats); + AlertFastLogThreadInit, AlertFastLogThreadDeinit, NULL); AlertFastLogRegisterTests(); } @@ -217,16 +215,6 @@ TmEcode AlertFastLogThreadDeinit(ThreadVars *t, void *data) return TM_ECODE_OK; } -void AlertFastLogExitPrintStats(ThreadVars *tv, void *data) -{ - AlertFastLogThread *aft = (AlertFastLogThread *)data; - if (aft == NULL) { - return; - } - - //SCLogInfo("Fast log output wrote %" PRIu64 " alerts", aft->file_ctx->alerts); -} - /** * \brief Create a new LogFileCtx for "fast" output style. * \param conf The configuration node for this output. diff --git a/src/alert-syslog.c b/src/alert-syslog.c index 47aca2afc1..8de1d3a9c2 100644 --- a/src/alert-syslog.c +++ b/src/alert-syslog.c @@ -367,20 +367,6 @@ static TmEcode AlertSyslogDecoderEvent(ThreadVars *tv, const Packet *p, void *da return TM_ECODE_OK; } -/** - * \brief Function to print the total alert while closing the engine - * - * \param tv Pointer to the output threadvars - * \param data Pointer to the AlertSyslogThread data - */ -static void AlertSyslogExitPrintStats(ThreadVars *tv, void *data) -{ - AlertSyslogThread *ast = (AlertSyslogThread *)data; - if (ast == NULL) { - return; - } -} - static int AlertSyslogCondition(ThreadVars *tv, const Packet *p) { return (p->alerts.cnt > 0 ? TRUE : FALSE); @@ -407,7 +393,6 @@ void AlertSyslogRegister (void) #ifndef OS_WIN32 OutputRegisterPacketModule(LOGGER_ALERT_SYSLOG, MODULE_NAME, "syslog", AlertSyslogInitCtx, AlertSyslogLogger, AlertSyslogCondition, - AlertSyslogThreadInit, AlertSyslogThreadDeinit, - AlertSyslogExitPrintStats); + AlertSyslogThreadInit, AlertSyslogThreadDeinit, NULL); #endif /* !OS_WIN32 */ } diff --git a/src/log-httplog.c b/src/log-httplog.c index 94800005cf..a825ae4023 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -58,7 +58,6 @@ TmEcode LogHttpLogThreadInit(ThreadVars *, void *, void **); TmEcode LogHttpLogThreadDeinit(ThreadVars *, void *); -void LogHttpLogExitPrintStats(ThreadVars *, void *); static void LogHttpLogDeInitCtx(OutputCtx *); int LogHttpLogger(ThreadVars *tv, void *thread_data, const Packet *, Flow *f, void *state, void *tx, uint64_t tx_id); @@ -67,7 +66,7 @@ void LogHttpLogRegister (void) { OutputRegisterTxModule(LOGGER_HTTP, MODULE_NAME, "http-log", LogHttpLogInitCtx, ALPROTO_HTTP, LogHttpLogger, LogHttpLogThreadInit, - LogHttpLogThreadDeinit, LogHttpLogExitPrintStats); + LogHttpLogThreadDeinit, NULL); } #define LOG_HTTP_MAXN_NODES 64 @@ -566,16 +565,6 @@ TmEcode LogHttpLogThreadDeinit(ThreadVars *t, void *data) return TM_ECODE_OK; } -void LogHttpLogExitPrintStats(ThreadVars *tv, void *data) -{ - LogHttpLogThread *aft = (LogHttpLogThread *)data; - if (aft == NULL) { - return; - } - - //SCLogInfo("HTTP logger logged %" PRIu32 " requests", aft->uri_cnt); -} - /** \brief Create a new http log LogFileCtx. * \param conf Pointer to ConfNode containing this loggers configuration. * \return NULL if failure, LogFileCtx* to the file_ctx if succesful diff --git a/src/log-stats.c b/src/log-stats.c index 7eb7c2444a..69fe82d205 100644 --- a/src/log-stats.c +++ b/src/log-stats.c @@ -55,7 +55,6 @@ TmEcode LogStatsLogThreadInit(ThreadVars *, void *, void **); TmEcode LogStatsLogThreadDeinit(ThreadVars *, void *); -void LogStatsLogExitPrintStats(ThreadVars *, void *); static void LogStatsLogDeInitCtx(OutputCtx *); typedef struct LogStatsFileCtx_ { @@ -206,14 +205,6 @@ TmEcode LogStatsLogThreadDeinit(ThreadVars *t, void *data) return TM_ECODE_OK; } -void LogStatsLogExitPrintStats(ThreadVars *tv, void *data) -{ - LogStatsLogThread *aft = (LogStatsLogThread *)data; - if (aft == NULL) { - return; - } -} - /** \brief Create a new http log LogFileCtx. * \param conf Pointer to ConfNode containing this loggers configuration. * \return NULL if failure, LogFileCtx* to the file_ctx if succesful @@ -296,5 +287,5 @@ void LogStatsLogRegister (void) { OutputRegisterStatsModule(LOGGER_STATS, MODULE_NAME, "stats", LogStatsLogInitCtx, LogStatsLogger, LogStatsLogThreadInit, - LogStatsLogThreadDeinit, LogStatsLogExitPrintStats); + LogStatsLogThreadDeinit, NULL); } diff --git a/src/log-tcp-data.c b/src/log-tcp-data.c index 00e18eec85..c2faa046ee 100644 --- a/src/log-tcp-data.c +++ b/src/log-tcp-data.c @@ -55,7 +55,6 @@ TmEcode LogTcpDataLogThreadInit(ThreadVars *, void *, void **); TmEcode LogTcpDataLogThreadDeinit(ThreadVars *, void *); -void LogTcpDataLogExitPrintStats(ThreadVars *, void *); 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); @@ -63,12 +62,10 @@ int LogTcpDataLogger(ThreadVars *tv, void *thread_data, const Flow *f, const uin void LogTcpDataLogRegister (void) { OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "tcp-data", LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_TCP_DATA, - LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, - LogTcpDataLogExitPrintStats); + LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, NULL); OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "http-body-data", LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_HTTP_BODIES, - LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, - LogTcpDataLogExitPrintStats); + LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, NULL); } typedef struct LogTcpDataFileCtx_ { @@ -224,13 +221,6 @@ TmEcode LogTcpDataLogThreadDeinit(ThreadVars *t, void *data) return TM_ECODE_OK; } -void LogTcpDataLogExitPrintStats(ThreadVars *tv, void *data) { - LogTcpDataLogThread *aft = (LogTcpDataLogThread *)data; - if (aft == NULL) { - return; - } -} - /** \brief Create a new http log LogFileCtx. * \param conf Pointer to ConfNode containing this loggers configuration. * \return NULL if failure, LogFileCtx* to the file_ctx if succesful