diff mbox

[dpdk-dev,2/6] bus/dpaa: add dpaa eventdev dynamic log support

Message ID 20171215125933.14302-3-sunil.kori@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Sunil Kumar Kori Dec. 15, 2017, 12:59 p.m. UTC
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c               |  5 +++++
 drivers/bus/dpaa/rte_bus_dpaa_version.map |  1 +
 drivers/bus/dpaa/rte_dpaa_logs.h          | 16 ++++++++++++++++
 3 files changed, 22 insertions(+)
diff mbox

Patch

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 01b332a..60a1ad5 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -70,6 +70,7 @@ 
 int dpaa_logtype_bus;
 int dpaa_logtype_mempool;
 int dpaa_logtype_pmd;
+int dpaa_logtype_eventdev;
 
 struct rte_dpaa_bus rte_dpaa_bus;
 struct netcfg_info *dpaa_netcfg;
@@ -562,4 +563,8 @@  dpaa_init_log(void)
 	dpaa_logtype_pmd = rte_log_register("pmd.dpaa");
 	if (dpaa_logtype_pmd >= 0)
 		rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE);
+
+	dpaa_logtype_eventdev = rte_log_register("eventdev.dpaa");
+	if (dpaa_logtype_eventdev >= 0)
+		rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE);
 }
diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index afc40bc..93cd118 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -68,6 +68,7 @@  DPDK_17.11 {
 DPDK_18.02 {
 	global:
 
+	dpaa_logtype_eventdev;
 	dpaa_svr_family;
 	per_lcore_held_bufs;
 	qm_channel_pool1;
diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h
index 037c96b..f36aac1 100644
--- a/drivers/bus/dpaa/rte_dpaa_logs.h
+++ b/drivers/bus/dpaa/rte_dpaa_logs.h
@@ -38,6 +38,7 @@ 
 extern int dpaa_logtype_bus;
 extern int dpaa_logtype_mempool;
 extern int dpaa_logtype_pmd;
+extern int dpaa_logtype_eventdev;
 
 #define DPAA_BUS_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "%s(): " fmt "\n", \
@@ -100,6 +101,21 @@  extern int dpaa_logtype_pmd;
 #define DPAA_PMD_WARN(fmt, args...) \
 	DPAA_PMD_LOG(WARNING, fmt, ## args)
 
+#define DPAA_EVENTDEV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, dpaa_logtype_eventdev, "%s(): " fmt "\n", \
+		__func__, ##args)
+
+#define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>")
+
+#define DPAA_EVENTDEV_DEBUG(fmt, args...) \
+	DPAA_EVENTDEV_LOG(DEBUG, fmt, ## args)
+#define DPAA_EVENTDEV_ERR(fmt, args...) \
+	DPAA_EVENTDEV_LOG(ERR, fmt, ## args)
+#define DPAA_EVENTDEV_INFO(fmt, args...) \
+	DPAA_EVENTDEV_LOG(INFO, fmt, ## args)
+#define DPAA_EVENTDEV_WARN(fmt, args...) \
+	DPAA_EVENTDEV_LOG(WARNING, fmt, ## args)
+
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_DP_LOG(level, fmt, args...) \
 	RTE_LOG_DP(level, PMD, fmt, ## args)