1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015-2020 Beijing WangXun Technology Co., Ltd.
3 * Copyright(c) 2010-2017 Intel Corporation
12 * PMD_USER_LOG: for user
14 extern int txgbe_logtype_init;
15 #define PMD_INIT_LOG(level, fmt, args...) \
16 rte_log(RTE_LOG_ ## level, txgbe_logtype_init, \
17 "%s(): " fmt "\n", __func__, ##args)
19 extern int txgbe_logtype_driver;
20 #define PMD_DRV_LOG(level, fmt, args...) \
21 rte_log(RTE_LOG_ ## level, txgbe_logtype_driver, \
22 "%s(): " fmt "\n", __func__, ##args)
24 #ifdef RTE_LIBRTE_TXGBE_DEBUG_RX
25 extern int txgbe_logtype_rx;
26 #define PMD_RX_LOG(level, fmt, args...) \
27 rte_log(RTE_LOG_ ## level, txgbe_logtype_rx, \
28 "%s(): " fmt "\n", __func__, ##args)
30 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
33 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX
34 extern int txgbe_logtype_tx;
35 #define PMD_TX_LOG(level, fmt, args...) \
36 rte_log(RTE_LOG_ ## level, txgbe_logtype_tx, \
37 "%s(): " fmt "\n", __func__, ##args)
39 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
42 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX_FREE
43 extern int txgbe_logtype_tx_free;
44 #define PMD_TX_FREE_LOG(level, fmt, args...) \
45 rte_log(RTE_LOG_ ## level, txgbe_logtype_tx_free, \
46 "%s(): " fmt "\n", __func__, ##args)
48 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
51 #define TLOG_DEBUG(fmt, args...) PMD_DRV_LOG(DEBUG, fmt, ##args)
53 #define DEBUGOUT(fmt, args...) TLOG_DEBUG(fmt, ##args)
54 #define PMD_INIT_FUNC_TRACE() TLOG_DEBUG(" >>")
55 #define DEBUGFUNC(fmt) TLOG_DEBUG(fmt)
57 extern int txgbe_logtype_bp;
58 #define BP_LOG(fmt, args...) \
59 rte_log(RTE_LOG_DEBUG, txgbe_logtype_bp, \
60 "[%"PRIu64".%"PRIu64"]%s(%d): " fmt, \
61 usec_stamp() / 1000000, usec_stamp() % 1000000, \
62 __func__, __LINE__, ##args)
64 #endif /* _TXGBE_LOGS_H_ */