bus/dpaa: add DPAA PMD logging macros

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
This commit is contained in:
Shreyansh Jain 2017-09-28 17:59:41 +05:30 committed by Ferruh Yigit
parent 107fd30eb3
commit a960306c06
3 changed files with 28 additions and 0 deletions

View File

@ -71,6 +71,7 @@
int dpaa_logtype_bus;
int dpaa_logtype_mempool;
int dpaa_logtype_pmd;
struct rte_dpaa_bus rte_dpaa_bus;
struct netcfg_info *dpaa_netcfg;
@ -457,4 +458,8 @@ dpaa_init_log(void)
dpaa_logtype_mempool = rte_log_register("mempool.dpaa");
if (dpaa_logtype_mempool >= 0)
rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
dpaa_logtype_pmd = rte_log_register("pmd.dpaa");
if (dpaa_logtype_pmd >= 0)
rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE);
}

View File

@ -9,6 +9,7 @@ DPDK_17.11 {
bman_query_free_buffers;
bman_release;
dpaa_logtype_mempool;
dpaa_logtype_pmd;
dpaa_netcfg;
fman_ccsr_map_fd;
fman_dealloc_bufs_mask_hi;

View File

@ -37,6 +37,7 @@
extern int dpaa_logtype_bus;
extern int dpaa_logtype_mempool;
extern int dpaa_logtype_pmd;
#define DPAA_BUS_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "%s(): " fmt "\n", \
@ -82,4 +83,25 @@ extern int dpaa_logtype_mempool;
#define DPAA_MEMPOOL_WARN(fmt, args...) \
DPAA_MEMPOOL_LOG(WARNING, fmt, ## args)
/* PMD related logs */
#define DPAA_PMD_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
__func__, ##args)
#define PMD_INIT_FUNC_TRACE() DPAA_PMD_LOG(DEBUG, " >>")
#define DPAA_PMD_DEBUG(fmt, args...) \
DPAA_PMD_LOG(DEBUG, fmt, ## args)
#define DPAA_PMD_ERR(fmt, args...) \
DPAA_PMD_LOG(ERR, fmt, ## args)
#define DPAA_PMD_INFO(fmt, args...) \
DPAA_PMD_LOG(INFO, fmt, ## args)
#define DPAA_PMD_WARN(fmt, args...) \
DPAA_PMD_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)
#endif /* _DPAA_LOGS_H_ */