[3/3] pipeline: convert to a dynamic logtype

Message ID 20231222174539.13431-4-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series Remove last library static logtypes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Stephen Hemminger Dec. 22, 2023, 5:44 p.m. UTC
  Replace RTE_LOGTYPE_PIPELINE static type with a dynamic one.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/log/log.c               | 1 -
 lib/log/rte_log.h           | 2 +-
 lib/pipeline/rte_pipeline.c | 3 +++
 3 files changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/lib/log/log.c b/lib/log/log.c
index 7ae798493e51..123510616455 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -353,7 +353,6 @@  struct logtype {
 static const struct logtype logtype_strings[] = {
 	{RTE_LOGTYPE_EAL,        "lib.eal"},
 	{RTE_LOGTYPE_PMD,        "pmd"},
-	{RTE_LOGTYPE_PIPELINE,   "lib.pipeline"},
 	{RTE_LOGTYPE_EVENTDEV,   "lib.eventdev"},
 	{RTE_LOGTYPE_USER1,      "user1"},
 	{RTE_LOGTYPE_USER2,      "user2"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 6bfa66dc8986..5f28c3832de9 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -42,7 +42,7 @@  extern "C" {
 				 /* was RTE_LOGTYPE_SCHED */
 				 /* was RTE_LOGTYPE_PORT */
 				 /* was RTE_LOGTYPE_TABLE */
-#define RTE_LOGTYPE_PIPELINE  15 /**< Log related to pipeline. */
+				 /* was RTE_LOGTYPE_PIPELINE */
 				 /* was RTE_LOGTYPE_MBUF */
 				 /* was RTE_LOGTYPE_CRYPTODEV */
 				 /* was RTE_LOGTYPE_EFD */
diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c
index b0aea4596daa..c9ed903d716b 100644
--- a/lib/pipeline/rte_pipeline.c
+++ b/lib/pipeline/rte_pipeline.c
@@ -12,6 +12,9 @@ 
 
 #include "rte_pipeline.h"
 
+RTE_LOG_REGISTER_DEFAULT(pipeline_logtype, INFO);
+#define RTE_LOGTYPE_PIPELINE pipeline_logtype
+
 #define PIPELINE_LOG(level, ...) \
 	RTE_LOG_LINE(level, PIPELINE, "" __VA_ARGS__)