Skip to content

Commit

Permalink
logging: remove unused print stats callbacks
Browse files Browse the repository at this point in the history
Remove the ThreadExitPrintStats callback from logging modules
that weren't doing anything with it.
  • Loading branch information
jasonish authored and victorjulien committed Feb 21, 2017
1 parent 0c3f1e2 commit 6585ac4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 73 deletions.
11 changes: 1 addition & 10 deletions src/alert-debuglog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -490,6 +482,5 @@ void AlertDebugLogRegister(void)
{
OutputRegisterPacketModule(LOGGER_ALERT_DEBUG, MODULE_NAME, "alert-debug",
AlertDebugLogInitCtx, AlertDebugLogLogger, AlertDebugLogCondition,
AlertDebugLogThreadInit, AlertDebugLogThreadDeinit,
AlertDebugLogExitPrintStats);
AlertDebugLogThreadInit, AlertDebugLogThreadDeinit, NULL);
}
14 changes: 1 addition & 13 deletions src/alert-fastlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@

TmEcode AlertFastLogThreadInit(ThreadVars *, void *, void **);
TmEcode AlertFastLogThreadDeinit(ThreadVars *, void *);
void AlertFastLogExitPrintStats(ThreadVars *, void *);
void AlertFastLogRegisterTests(void);
static void AlertFastLogDeInitCtx(OutputCtx *);

Expand All @@ -80,8 +79,7 @@ void AlertFastLogRegister(void)
{
OutputRegisterPacketModule(LOGGER_ALERT_FAST, MODULE_NAME, "fast",
AlertFastLogInitCtx, AlertFastLogger, AlertFastLogCondition,
AlertFastLogThreadInit, AlertFastLogThreadDeinit,
AlertFastLogExitPrintStats);
AlertFastLogThreadInit, AlertFastLogThreadDeinit, NULL);
AlertFastLogRegisterTests();
}

Expand Down Expand Up @@ -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.
Expand Down
17 changes: 1 addition & 16 deletions src/alert-syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 */
}
13 changes: 1 addition & 12 deletions src/log-httplog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 1 addition & 10 deletions src/log-stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

TmEcode LogStatsLogThreadInit(ThreadVars *, void *, void **);
TmEcode LogStatsLogThreadDeinit(ThreadVars *, void *);
void LogStatsLogExitPrintStats(ThreadVars *, void *);
static void LogStatsLogDeInitCtx(OutputCtx *);

typedef struct LogStatsFileCtx_ {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -296,5 +287,5 @@ void LogStatsLogRegister (void)
{
OutputRegisterStatsModule(LOGGER_STATS, MODULE_NAME, "stats",
LogStatsLogInitCtx, LogStatsLogger, LogStatsLogThreadInit,
LogStatsLogThreadDeinit, LogStatsLogExitPrintStats);
LogStatsLogThreadDeinit, NULL);
}
14 changes: 2 additions & 12 deletions src/log-tcp-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,17 @@

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);

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_ {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6585ac4

Please sign in to comment.