bus/dpaa: improve dynamic logging
authorHemant Agrawal <hemant.agrawal@nxp.com>
Wed, 25 Apr 2018 12:57:02 +0000 (18:27 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 13 May 2018 22:37:18 +0000 (00:37 +0200)
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/bus/dpaa/base/fman/fman.c
drivers/bus/dpaa/dpaa_bus.c
drivers/bus/dpaa/rte_dpaa_logs.h

index be91da4..bdb7004 100644 (file)
@@ -504,7 +504,7 @@ fman_if_init(const struct device_node *dpa_node)
 
        /* Parsing of the network interface is complete, add it to the list */
        DPAA_BUS_LOG(DEBUG, "Found %s, Tx Channel = %x, FMAN = %x,"
-                   "Port ID = %x\n",
+                   "Port ID = %x",
                    dname, __if->__if.tx_channel_id, __if->__if.fman_idx,
                    __if->__if.mac_idx);
 
index 2b85c9e..2046206 100644 (file)
@@ -178,7 +178,7 @@ dpaa_create_device_list(void)
                memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN);
                sprintf(dev->name, "fm%d-mac%d", (fman_intf->fman_idx + 1),
                        fman_intf->mac_idx);
-               DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name);
+               DPAA_BUS_LOG(INFO, "%s netdev added", dev->name);
                dev->device.name = dev->name;
                dev->device.devargs = dpaa_devargs_lookup(dev);
 
@@ -216,7 +216,7 @@ dpaa_create_device_list(void)
                 */
                memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN);
                sprintf(dev->name, "dpaa-sec%d", i);
-               DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name);
+               DPAA_BUS_LOG(INFO, "%s cryptodev added", dev->name);
                dev->device.name = dev->name;
                dev->device.devargs = dpaa_devargs_lookup(dev);
 
@@ -461,14 +461,11 @@ rte_dpaa_bus_scan(void)
                return 0;
        }
 
-       DPAA_BUS_LOG(DEBUG, "Bus: Address of netcfg=%p, Ethports=%d",
-                    dpaa_netcfg, dpaa_netcfg->num_ethports);
-
 #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER
        dump_netcfg(dpaa_netcfg);
 #endif
 
-       DPAA_BUS_LOG(DEBUG, "Number of devices = %d\n",
+       DPAA_BUS_LOG(DEBUG, "Number of ethernet devices = %d",
                     dpaa_netcfg->num_ethports);
        ret = dpaa_create_device_list();
        if (ret) {
@@ -486,9 +483,6 @@ rte_dpaa_bus_scan(void)
                return ret;
        }
 
-       DPAA_BUS_LOG(DEBUG, "dpaa_portal_key=%u, ret=%d\n",
-                   (unsigned int)dpaa_portal_key, ret);
-
        return 0;
 }
 
@@ -644,11 +638,11 @@ dpaa_init_log(void)
        if (dpaa_logtype_mempool >= 0)
                rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
 
-       dpaa_logtype_pmd = rte_log_register("pmd.dpaa");
+       dpaa_logtype_pmd = rte_log_register("pmd.net.dpaa");
        if (dpaa_logtype_pmd >= 0)
                rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE);
 
-       dpaa_logtype_eventdev = rte_log_register("eventdev.dpaa");
+       dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa");
        if (dpaa_logtype_eventdev >= 0)
                rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE);
 }
index 0fd70bb..e414354 100644 (file)
@@ -15,10 +15,7 @@ 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", \
-               __func__, ##args)
-
-#define BUS_INIT_FUNC_TRACE() DPAA_BUS_LOG(DEBUG, " >>")
+       rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "dpaa: " fmt "\n", ##args)
 
 #ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
 #define DPAA_BUS_HWWARN(cond, fmt, args...) \
@@ -31,7 +28,11 @@ extern int dpaa_logtype_eventdev;
 #endif
 
 #define DPAA_BUS_DEBUG(fmt, args...) \
-       DPAA_BUS_LOG(DEBUG, fmt, ## args)
+       rte_log(RTE_LOG_DEBUG, dpaa_logtype_bus, "dpaa: %s(): " fmt "\n", \
+               __func__, ##args)
+
+#define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>")
+
 #define DPAA_BUS_INFO(fmt, args...) \
        DPAA_BUS_LOG(INFO, fmt, ## args)
 #define DPAA_BUS_ERR(fmt, args...) \