[v2] eventdev: replace RTE_LOGTYPE_EVENTDEV with a dynamic type

Message ID 20231212170255.173813-1-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] eventdev: replace RTE_LOGTYPE_EVENTDEV with a dynamic type |

Checks

Context Check Description
ci/checkpatch warning coding style issues
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-mellanox-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-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. 12, 2023, 5:02 p.m. UTC
  With a little setup in eventdev_pmd.h the eventdev drivers
and API can be converted to dynamic log type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2 - logtpe can be internal

 lib/eventdev/eventdev_pmd.h | 3 +++
 lib/eventdev/rte_eventdev.c | 2 ++
 lib/eventdev/version.map    | 1 +
 lib/log/log.c               | 1 -
 lib/log/rte_log.h           | 2 +-
 5 files changed, 7 insertions(+), 2 deletions(-)
  

Patch

diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
index 30bd90085c44..52dc1a1d79fb 100644
--- a/lib/eventdev/eventdev_pmd.h
+++ b/lib/eventdev/eventdev_pmd.h
@@ -31,6 +31,9 @@  extern "C" {
 #include "event_timer_adapter_pmd.h"
 #include "rte_eventdev.h"
 
+extern int rte_event_logtype;
+#define RTE_LOGTYPE_EVENTDEV rte_event_logtype
+
 /* Logging Macros */
 #define RTE_EDEV_LOG_ERR(...) \
 	RTE_LOG(ERR, EVENTDEV, \
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 0ca32d672175..10ea7f626e66 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -28,6 +28,8 @@ 
 #include "eventdev_pmd.h"
 #include "eventdev_trace.h"
 
+RTE_LOG_REGISTER_DEFAULT(rte_event_logtype, INFO);
+
 static struct rte_eventdev rte_event_devices[RTE_EVENT_MAX_DEVS];
 
 struct rte_eventdev *rte_eventdevs = rte_event_devices;
diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
index 3d5c6c2b835c..520b190bb84c 100644
--- a/lib/eventdev/version.map
+++ b/lib/eventdev/version.map
@@ -155,6 +155,7 @@  INTERNAL {
 	event_dev_fp_ops_reset;
 	event_dev_fp_ops_set;
 	event_dev_probing_finish;
+	rte_event_logtype;
 	rte_event_pmd_allocate;
 	rte_event_pmd_get_named_dev;
 	rte_event_pmd_is_valid_dev;
diff --git a/lib/log/log.c b/lib/log/log.c
index ab06132a98a1..641b4884aad2 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -356,7 +356,6 @@  static const struct logtype logtype_strings[] = {
 	{RTE_LOGTYPE_PORT,       "lib.port"},
 	{RTE_LOGTYPE_TABLE,      "lib.table"},
 	{RTE_LOGTYPE_PIPELINE,   "lib.pipeline"},
-	{RTE_LOGTYPE_EVENTDEV,   "lib.eventdev"},
 	{RTE_LOGTYPE_USER1,      "user1"},
 	{RTE_LOGTYPE_USER2,      "user2"},
 	{RTE_LOGTYPE_USER3,      "user3"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 3394746103d4..b955adff7bac 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -45,7 +45,7 @@  extern "C" {
 				 /* was RTE_LOGTYPE_MBUF */
 				 /* was RTE_LOGTYPE_CRYPTODEV */
 				 /* was RTE_LOGTYPE_EFD */
-#define RTE_LOGTYPE_EVENTDEV  19 /**< Log related to eventdev. */
+				 /* was RTE_LOGTYPE_EVENTDEV */
 				 /* was RTE_LOGTYPE_GSO */
 
 /* these log types can be used in an application */