xref: /dpdk/drivers/event/dlb2/dlb2_log.h (revision fd51012de5369679e807be1d6a81d63ef15015ce)
1ef3da1e7STimothy McDaniel /* SPDX-License-Identifier: BSD-3-Clause
2ef3da1e7STimothy McDaniel  * Copyright(c) 2016-2020 Intel Corporation
3ef3da1e7STimothy McDaniel  */
4ef3da1e7STimothy McDaniel 
5ef3da1e7STimothy McDaniel #ifndef _DLB2_EVDEV_LOG_H_
6ef3da1e7STimothy McDaniel #define _DLB2_EVDEV_LOG_H_
7ef3da1e7STimothy McDaniel 
8ef3da1e7STimothy McDaniel extern int eventdev_dlb2_log_level;
96a41e607SDavid Marchand #define RTE_LOGTYPE_EVENTDEV_DLB2 eventdev_dlb2_log_level
10ef3da1e7STimothy McDaniel 
11ef3da1e7STimothy McDaniel /* Dynamic logging */
122b843cacSDavid Marchand #define DLB2_LOG_IMPL(level, ...) \
132b843cacSDavid Marchand 	RTE_LOG_LINE_PREFIX(level, EVENTDEV_DLB2, "%s", __func__, __VA_ARGS__)
14ef3da1e7STimothy McDaniel 
15*fd51012dSAndre Muezerie #define DLB2_LOG_INFO(fmt, ...) \
16*fd51012dSAndre Muezerie 	DLB2_LOG_IMPL(INFO, fmt, ## __VA_ARGS__)
17ef3da1e7STimothy McDaniel 
18*fd51012dSAndre Muezerie #define DLB2_LOG_ERR(fmt, ...) \
19*fd51012dSAndre Muezerie 	DLB2_LOG_IMPL(ERR, fmt, ## __VA_ARGS__)
20ef3da1e7STimothy McDaniel 
21ef3da1e7STimothy McDaniel /* remove debug logs at compile time unless actually debugging */
222b843cacSDavid Marchand #define DLB2_LOG_LINE_DBG(...) \
232b843cacSDavid Marchand 	RTE_LOG_DP_LINE(DEBUG, EVENTDEV_DLB2, __VA_ARGS__)
24ef3da1e7STimothy McDaniel 
25ef3da1e7STimothy McDaniel #endif /* _DLB2_EVDEV_LOG_H_ */
26