1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015-2020
11 * PMD_USER_LOG: for user
13 extern int txgbe_logtype_init;
14 #define PMD_INIT_LOG(level, fmt, args...) \
15 rte_log(RTE_LOG_ ## level, txgbe_logtype_init, \
16 "%s(): " fmt "\n", __func__, ##args)
18 extern int txgbe_logtype_driver;
19 #define PMD_DRV_LOG(level, fmt, args...) \
20 rte_log(RTE_LOG_ ## level, txgbe_logtype_driver, \
21 "%s(): " fmt "\n", __func__, ##args)
23 #ifdef RTE_LIBRTE_TXGBE_DEBUG_RX
24 extern int txgbe_logtype_rx;
25 #define PMD_RX_LOG(level, fmt, args...) \
26 rte_log(RTE_LOG_ ## level, txgbe_logtype_rx, \
27 "%s(): " fmt "\n", __func__, ##args)
29 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
32 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX
33 extern int txgbe_logtype_tx;
34 #define PMD_TX_LOG(level, fmt, args...) \
35 rte_log(RTE_LOG_ ## level, txgbe_logtype_tx, \
36 "%s(): " fmt "\n", __func__, ##args)
38 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
41 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX_FREE
42 extern int txgbe_logtype_tx_free;
43 #define PMD_TX_FREE_LOG(level, fmt, args...) \
44 rte_log(RTE_LOG_ ## level, txgbe_logtype_tx_free, \
45 "%s(): " fmt "\n", __func__, ##args)
47 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
50 #define TLOG_DEBUG(fmt, args...) PMD_DRV_LOG(DEBUG, fmt, ##args)
52 #define DEBUGOUT(fmt, args...) TLOG_DEBUG(fmt, ##args)
53 #define PMD_INIT_FUNC_TRACE() TLOG_DEBUG(" >>")
54 #define DEBUGFUNC(fmt) TLOG_DEBUG(fmt)
56 extern int txgbe_logtype_bp;
57 #define BP_LOG(fmt, args...) \
58 rte_log(RTE_LOG_DEBUG, txgbe_logtype_bp, \
59 "[%"PRIu64".%"PRIu64"]%s(%d): " fmt, \
60 usec_stamp() / 1000000, usec_stamp() % 1000000, \
61 __func__, __LINE__, ##args)
63 #endif /* _TXGBE_LOGS_H_ */