From: Jason Ish Date: Wed, 28 Aug 2024 14:55:35 +0000 (-0600) Subject: profiling: create a LOGGER_USER id X-Git-Tag: suricata-8.0.0-beta1~923 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d2820ba39015d9485cef9cbcdb0d02242c7c718;p=thirdparty%2Fsuricata.git profiling: create a LOGGER_USER id Loggers need an ID uniquely identify them for profiling. To help with loggers registered at runtime (library, plugins), provide a LOGGER_USER that can be used. It won't provide per-logger details if they have more than one, but will provide a total for all their registered loggers. Ticket: #7227 --- diff --git a/src/suricata-common.h b/src/suricata-common.h index 3a6c281cab..51af99a023 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -493,6 +493,10 @@ typedef enum { LOGGER_JSON_STREAM, LOGGER_JSON_ARP, + /* An ID that can be used by loggers registered by plugins and/or + * library users. */ + LOGGER_USER, + /* Must come last. */ LOGGER_SIZE, } LoggerId; diff --git a/src/util-profiling.c b/src/util-profiling.c index f5efc45876..56c3155728 100644 --- a/src/util-profiling.c +++ b/src/util-profiling.c @@ -1298,6 +1298,7 @@ const char *PacketProfileLoggerIdToString(LoggerId id) CASE_CODE(LOGGER_JSON_FRAME); CASE_CODE(LOGGER_JSON_STREAM); CASE_CODE(LOGGER_JSON_ARP); + CASE_CODE(LOGGER_USER); case LOGGER_SIZE: return "UNKNOWN";