From ad6628ac9b28e3a35abb4dd7935df0f4d4f45b09 Mon Sep 17 00:00:00 2001 From: Sunil Kumar Kori Date: Wed, 17 Jan 2018 02:13:56 +0530 Subject: [PATCH] bus/dpaa: support dynamic logging Signed-off-by: Sunil Kumar Kori Acked-by: Hemant Agrawal --- 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 --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 78d60be7e9..4c2854f090 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -44,6 +44,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; @@ -536,4 +537,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 f5c291f0b4..925cf91881 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 5429864d05..0fd70bbfe3 100644 --- a/drivers/bus/dpaa/rte_dpaa_logs.h +++ b/drivers/bus/dpaa/rte_dpaa_logs.h @@ -12,6 +12,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", \ @@ -74,6 +75,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) -- 2.20.1