b52de73c9e367480359026d34d62db418c64fac0
[dpdk.git] / drivers / net / virtio / virtio_logs.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4
5 #ifndef _VIRTIO_LOGS_H_
6 #define _VIRTIO_LOGS_H_
7
8 #include <rte_log.h>
9
10 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_INIT
11 #define PMD_INIT_LOG(level, fmt, args...) \
12         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
13 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
14 #else
15 #define PMD_INIT_LOG(level, fmt, args...) do { } while(0)
16 #define PMD_INIT_FUNC_TRACE() do { } while(0)
17 #endif
18
19 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
20 #define PMD_RX_LOG(level, fmt, args...) \
21         RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
22 #else
23 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
24 #endif
25
26 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
27 #define PMD_TX_LOG(level, fmt, args...) \
28         RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
29 #else
30 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
31 #endif
32
33
34 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_DRIVER
35 #define PMD_DRV_LOG(level, fmt, args...) \
36         RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
37 #else
38 #define PMD_DRV_LOG(level, fmt, args...) do { } while(0)
39 #endif
40
41 #endif /* _VIRTIO_LOGS_H_ */