bnx2x: add periodic debug option
[dpdk.git] / drivers / net / bnx2x / bnx2x_logs.h
1 /*
2  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
3  *
4  * All rights reserved.
5  */
6
7 #ifndef _PMD_LOGS_H_
8 #define _PMD_LOGS_H_
9
10 #define PMD_INIT_LOG(level, fmt, args...) \
11         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ##args)
12
13 #ifdef RTE_LIBRTE_BNX2X_DEBUG_INIT
14 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
15 #else
16 #define PMD_INIT_FUNC_TRACE() do { } while(0)
17 #endif
18
19 #ifdef RTE_LIBRTE_BNX2X_DEBUG_RX
20 #define PMD_RX_LOG(level, fmt, args...) \
21         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
22 #else
23 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
24 #endif
25
26 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX
27 #define PMD_TX_LOG(level, fmt, args...) \
28         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
29 #else
30 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
31 #endif
32
33 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX_FREE
34 #define PMD_TX_FREE_LOG(level, fmt, args...) \
35         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
36 #else
37 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
38 #endif
39
40 #ifdef RTE_LIBRTE_BNX2X_DEBUG
41 #define PMD_DRV_LOG_RAW(level, fmt, args...) \
42         RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
43 #else
44 #define PMD_DRV_LOG_RAW(level, fmt, args...) do { } while (0)
45 #endif
46
47 #define PMD_DRV_LOG(level, fmt, args...) \
48         PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
49
50 #ifdef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC
51 #define PMD_DEBUG_PERIODIC_LOG(level, fmt, args...) \
52         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
53 #else
54 #define PMD_DEBUG_PERIODIC_LOG(level, fmt, args...) do { } while(0)
55 #endif
56
57
58 #endif /* _PMD_LOGS_H_ */