Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,12 @@ jobs:
working-directory: examples/plugins/c-custom-loggers
run: make clean all

- name: Test library bench content inspect tool
working-directory: tools/benches/bench-content-inspect
run: |
make clean all
./bench_content_inspect ci-run

- name: Install Suricata and library
run: make install install-headers install-library

Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ EXTRA_DIST = ChangeLog COPYING LICENSE suricata.yaml.in \
examples/plugins
SUBDIRS = rust src plugins qa rules doc etc python ebpf \
$(SURICATA_UPDATE_DIR)
DIST_SUBDIRS = $(SUBDIRS) examples/lib/simple examples/lib/custom
DIST_SUBDIRS = $(SUBDIRS) examples/lib/simple examples/lib/custom tools/benches/bench-content-inspect

CLEANFILES = stamp-h[0-9]*

Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,7 @@ AC_CONFIG_FILES(examples/plugins/ci-capture/Makefile)
AC_CONFIG_FILES(examples/lib/simple/Makefile examples/lib/simple/Makefile.example)
AC_CONFIG_FILES(examples/lib/custom/Makefile examples/lib/custom/Makefile.example)
AC_CONFIG_FILES(examples/lib/cplusplus/Makefile.example)
AC_CONFIG_FILES(tools/benches/bench-content-inspect/Makefile)
AC_CONFIG_FILES(plugins/Makefile)
AC_CONFIG_FILES(plugins/pfring/Makefile)
AC_CONFIG_FILES(plugins/napatech/Makefile)
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,12 @@ noinst_HEADERS = \
util-runmodes.h \
util-running-modes.h \
util-signal.h \
util-spm.h \
util-spm-bm.h \
util-spm-bs.h \
util-spm-bs2bm.h \
util-spm-hs.h \
util-spm.h \
util-spm-mm.h \
util-storage.h \
util-streaming-buffer.h \
util-sysfs.h \
Expand Down Expand Up @@ -1179,11 +1180,12 @@ libsuricata_c_a_SOURCES = \
util-runmodes.c \
util-running-modes.c \
util-signal.c \
util-spm.c \
util-spm-bm.c \
util-spm-bs.c \
util-spm-bs2bm.c \
util-spm-hs.c \
util-spm.c \
util-spm-mm.c \
util-storage.c \
util-streaming-buffer.c \
util-strlcatu.c \
Expand Down
65 changes: 30 additions & 35 deletions src/detect-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -3344,6 +3344,34 @@ static TmEcode ThreadCtxDoInit (DetectEngineCtx *de_ctx, DetectEngineThreadCtx *
return TM_ECODE_OK;
}

static void DetectEngineThreadCtxInitRegisterCounters(
ThreadVars *tv, DetectEngineThreadCtx *det_ctx)
{
/** alert counter setup */
det_ctx->counter_alerts = StatsRegisterCounter("detect.alert", tv);
det_ctx->counter_alerts_overflow = StatsRegisterCounter("detect.alert_queue_overflow", tv);
det_ctx->counter_alerts_suppressed = StatsRegisterCounter("detect.alerts_suppressed", tv);

/* Register counter for Lua rule errors. */
det_ctx->lua_rule_errors = StatsRegisterCounter("detect.lua.errors", tv);

/* Register a counter for Lua blocked function attempts. */
det_ctx->lua_blocked_function_errors =
StatsRegisterCounter("detect.lua.blocked_function_errors", tv);

/* Register a counter for Lua instruction limit errors. */
det_ctx->lua_instruction_limit_errors =
StatsRegisterCounter("detect.lua.instruction_limit_errors", tv);

/* Register a counter for Lua memory limit errors. */
det_ctx->lua_memory_limit_errors = StatsRegisterCounter("detect.lua.memory_limit_errors", tv);

#ifdef PROFILING
det_ctx->counter_mpm_list = StatsRegisterAvgCounter("detect.mpm_list", tv);
det_ctx->counter_match_list = StatsRegisterAvgCounter("detect.match_list", tv);
#endif
}

/** \brief initialize thread specific detection engine context
*
* \note there is a special case when using delayed detect. In this case the
Expand Down Expand Up @@ -3392,33 +3420,7 @@ TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data)
}
}

/** alert counter setup */
det_ctx->counter_alerts = StatsRegisterCounter("detect.alert", tv);
det_ctx->counter_alerts_overflow = StatsRegisterCounter("detect.alert_queue_overflow", tv);
det_ctx->counter_alerts_suppressed = StatsRegisterCounter("detect.alerts_suppressed", tv);

/* Register counter for Lua rule errors. */
det_ctx->lua_rule_errors = StatsRegisterCounter("detect.lua.errors", tv);

/* Register a counter for Lua blocked function attempts. */
det_ctx->lua_blocked_function_errors =
StatsRegisterCounter("detect.lua.blocked_function_errors", tv);

/* Register a counter for Lua instruction limit errors. */
det_ctx->lua_instruction_limit_errors =
StatsRegisterCounter("detect.lua.instruction_limit_errors", tv);

/* Register a counter for Lua memory limit errors. */
det_ctx->lua_memory_limit_errors = StatsRegisterCounter("detect.lua.memory_limit_errors", tv);

det_ctx->json_content = NULL;
det_ctx->json_content_capacity = 0;
det_ctx->json_content_len = 0;

#ifdef PROFILING
det_ctx->counter_mpm_list = StatsRegisterAvgCounter("detect.mpm_list", tv);
det_ctx->counter_match_list = StatsRegisterAvgCounter("detect.match_list", tv);
#endif
DetectEngineThreadCtxInitRegisterCounters(tv, det_ctx);

if (DetectEngineMultiTenantEnabled()) {
DetectEngineMasterCtx *master = &g_master_de_ctx;
Expand Down Expand Up @@ -3472,14 +3474,7 @@ DetectEngineThreadCtx *DetectEngineThreadCtxInitForReload(
}
}

/** alert counter setup */
det_ctx->counter_alerts = StatsRegisterCounter("detect.alert", tv);
det_ctx->counter_alerts_overflow = StatsRegisterCounter("detect.alert_queue_overflow", tv);
det_ctx->counter_alerts_suppressed = StatsRegisterCounter("detect.alerts_suppressed", tv);
#ifdef PROFILING
det_ctx->counter_mpm_list = StatsRegisterAvgCounter("detect.mpm_list", tv);
det_ctx->counter_match_list = StatsRegisterAvgCounter("detect.match_list", tv);
#endif
DetectEngineThreadCtxInitRegisterCounters(tv, det_ctx);

if (mt && DetectEngineMultiTenantEnabledWithLock()) {
if (DetectEngineThreadCtxInitForMT(tv, det_ctx) != TM_ECODE_OK) {
Expand Down
9 changes: 9 additions & 0 deletions src/suricata.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,15 @@ static void PrintBuildInfo(void)

/* SIMD stuff */
memset(features, 0x00, sizeof(features));
#if defined(__AVX512VL__)
strlcat(features, "AVX512VL ", sizeof(features));
#endif
#if defined(__AVX512BW__)
strlcat(features, "AVX512BW ", sizeof(features));
#endif
#if defined(__AVX2__)
strlcat(features, "AVX2 ", sizeof(features));
#endif
#if defined(__SSE4_2__)
strlcat(features, "SSE_4_2 ", sizeof(features));
#endif
Expand Down
Loading
Loading