event/dlb2: add dynamic logging
This commit adds base support for dynamic logging. The default log level is NOTICE. Dynamic logging is used exclusively throughout this patchset. Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com> Reviewed-by: Gage Eads <gage.eads@intel.com>
This commit is contained in:
parent
166378a794
commit
ef3da1e767
7
drivers/event/dlb2/dlb2.c
Normal file
7
drivers/event/dlb2/dlb2.c
Normal file
@ -0,0 +1,7 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(c) 2016-2020 Intel Corporation
|
||||
*/
|
||||
|
||||
#include <rte_log.h>
|
||||
|
||||
RTE_LOG_REGISTER(eventdev_dlb2_log_level, pmd.event.dlb2, NOTICE);
|
25
drivers/event/dlb2/dlb2_log.h
Normal file
25
drivers/event/dlb2/dlb2_log.h
Normal file
@ -0,0 +1,25 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(c) 2016-2020 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _DLB2_EVDEV_LOG_H_
|
||||
#define _DLB2_EVDEV_LOG_H_
|
||||
|
||||
extern int eventdev_dlb2_log_level;
|
||||
|
||||
/* Dynamic logging */
|
||||
#define DLB2_LOG_IMPL(level, fmt, args...) \
|
||||
rte_log(RTE_LOG_ ## level, eventdev_dlb2_log_level, "%s" fmt "\n", \
|
||||
__func__, ##args)
|
||||
|
||||
#define DLB2_LOG_INFO(fmt, args...) \
|
||||
DLB2_LOG_IMPL(INFO, fmt, ## args)
|
||||
|
||||
#define DLB2_LOG_ERR(fmt, args...) \
|
||||
DLB2_LOG_IMPL(ERR, fmt, ## args)
|
||||
|
||||
/* remove debug logs at compile time unless actually debugging */
|
||||
#define DLB2_LOG_DBG(fmt, args...) \
|
||||
RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
|
||||
|
||||
#endif /* _DLB2_EVDEV_LOG_H_ */
|
@ -7,8 +7,7 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
|
||||
subdir_done()
|
||||
endif
|
||||
|
||||
sources = files(
|
||||
)
|
||||
sources = files('dlb2.c')
|
||||
|
||||
headers = files()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user