[v2,09/14] event/dsw: use a dynamic logtype

Message ID 20240912082643.1532679-10-david.marchand@redhat.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series Use RTE_LOG_LINE in drivers |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Sept. 12, 2024, 8:26 a.m. UTC
Register a logtype for this driver and stop logging as EVENTDEV.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/event/dsw/dsw_evdev.c | 1 +
 drivers/event/dsw/dsw_evdev.h | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c
index 0dea1091e3..8a1a2db8ac 100644
--- a/drivers/event/dsw/dsw_evdev.c
+++ b/drivers/event/dsw/dsw_evdev.c
@@ -493,3 +493,4 @@  static struct rte_vdev_driver evdev_dsw_pmd_drv = {
 };
 
 RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DSW_PMD, evdev_dsw_pmd_drv);
+RTE_LOG_REGISTER_DEFAULT(event_dsw_logtype, NOTICE);
diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h
index c9bf4f8b6b..fe4ddb3e30 100644
--- a/drivers/event/dsw/dsw_evdev.h
+++ b/drivers/event/dsw/dsw_evdev.h
@@ -302,9 +302,10 @@  dsw_pmd_priv(const struct rte_eventdev *eventdev)
 	return eventdev->data->dev_private;
 }
 
+extern int event_dsw_logtype;
+#define RTE_LOGTYPE_EVENT_DSW event_dsw_logtype
 #define DSW_LOG_DP(level, fmt, args...)					\
-	RTE_LOG_DP(level, EVENTDEV, "[%s] %s() line %u: " fmt,		\
-		   DSW_PMD_NAME,					\
+	RTE_LOG_DP(level, EVENT_DSW, "%s() line %u: " fmt,		\
 		   __func__, __LINE__, ## args)
 
 #define DSW_LOG_DP_PORT(level, port_id, fmt, args...)		\