blob: cb50aa95dbeb5683d8420b59907afc212db7c89f [file] [log] [blame]
Dmitry Fleytman75020a72013-03-09 11:21:04 +02001/*
2 * QEMU VMWARE VMXNET* paravirtual NICs - debugging facilities
3 *
4 * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com)
5 *
6 * Developed by Daynix Computing LTD (http://www.daynix.com)
7 *
8 * Authors:
9 * Dmitry Fleytman <dmitry@daynix.com>
10 * Tamir Shomer <tamirs@daynix.com>
11 * Yan Vugenfirer <yan@daynix.com>
12 *
13 * This work is licensed under the terms of the GNU GPL, version 2 or later.
14 * See the COPYING file in the top-level directory.
15 *
16 */
17
Markus Armbruster2a6a4072016-06-29 13:47:03 +020018#ifndef QEMU_VMXNET_DEBUG_H
19#define QEMU_VMXNET_DEBUG_H
Dmitry Fleytman75020a72013-03-09 11:21:04 +020020
21#define VMXNET_DEVICE_NAME "vmxnet3"
22
Dmitry Fleytman75020a72013-03-09 11:21:04 +020023#define VMXNET_DEBUG_WARNINGS
24#define VMXNET_DEBUG_ERRORS
Dmitry Fleytman75020a72013-03-09 11:21:04 +020025
Miao Yan71c2f5b2015-12-07 21:28:32 -080026#undef VMXNET_DEBUG_CB
27#undef VMXNET_DEBUG_INTERRUPTS
28#undef VMXNET_DEBUG_CONFIG
29#undef VMXNET_DEBUG_RINGS
30#undef VMXNET_DEBUG_PACKETS
31#undef VMXNET_DEBUG_SHMEM_ACCESS
Dmitry Fleytman75020a72013-03-09 11:21:04 +020032
33#ifdef VMXNET_DEBUG_CB
Miao Yan71c2f5b2015-12-07 21:28:32 -080034# define VMXNET_DEBUG_CB_ENABLED 1
Dmitry Fleytman75020a72013-03-09 11:21:04 +020035#else
Miao Yan71c2f5b2015-12-07 21:28:32 -080036# define VMXNET_DEBUG_CB_ENABLED 0
Dmitry Fleytman75020a72013-03-09 11:21:04 +020037#endif
38
39#ifdef VMXNET_DEBUG_WARNINGS
Miao Yan71c2f5b2015-12-07 21:28:32 -080040# define VMXNET_DEBUG_WARNINGS_ENABLED 1
Dmitry Fleytman75020a72013-03-09 11:21:04 +020041#else
Miao Yan71c2f5b2015-12-07 21:28:32 -080042# define VMXNET_DEBUG_WARNINGS_ENABLED 0
Dmitry Fleytman75020a72013-03-09 11:21:04 +020043#endif
44
45#ifdef VMXNET_DEBUG_ERRORS
Miao Yan71c2f5b2015-12-07 21:28:32 -080046# define VMXNET_DEBUG_ERRORS_ENABLED 1
Dmitry Fleytman75020a72013-03-09 11:21:04 +020047#else
Miao Yan71c2f5b2015-12-07 21:28:32 -080048# define VMXNET_DEBUG_ERRORS_ENABLED 0
Dmitry Fleytman75020a72013-03-09 11:21:04 +020049#endif
50
51#ifdef VMXNET_DEBUG_CONFIG
Miao Yan71c2f5b2015-12-07 21:28:32 -080052# define VMXNET_DEBUG_CONFIG_ENABLED 1
Dmitry Fleytman75020a72013-03-09 11:21:04 +020053#else
Miao Yan71c2f5b2015-12-07 21:28:32 -080054# define VMXNET_DEBUG_CONFIG_ENABLED 0
Dmitry Fleytman75020a72013-03-09 11:21:04 +020055#endif
56
57#ifdef VMXNET_DEBUG_RINGS
Miao Yan71c2f5b2015-12-07 21:28:32 -080058# define VMXNET_DEBUG_RINGS_ENABLED 1
59#else
60# define VMXNET_DEBUG_RINGS_ENABLED 0
61#endif
62
63#ifdef VMXNET_DEBUG_PACKETS
64# define VMXNET_DEBUG_PACKETS_ENABLED 1
65#else
66# define VMXNET_DEBUG_PACKETS_ENABLED 0
67#endif
68
69#ifdef VMXNET_DEBUG_INTERRUPTS
70# define VMXNET_DEBUG_INTERRUPTS_ENABLED 1
71#else
72# define VMXNET_DEBUG_INTERRUPTS_ENABLED 0
73#endif
74
75#ifdef VMXNET_DEBUG_SHMEM_ACCESS
76# define VMXNET_DEBUG_SHMEM_ACCESS_ENABLED 1
77#else
78# define VMXNET_DEBUG_SHMEM_ACCESS_ENABLED 0
79#endif
80
81#define VMW_SHPRN(fmt, ...) \
82 do { \
83 if (VMXNET_DEBUG_SHMEM_ACCESS_ENABLED) { \
84 printf("[%s][SH][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
85 ## __VA_ARGS__); \
86 } \
87 } while (0)
88
89#define VMW_CBPRN(fmt, ...) \
90 do { \
91 if (VMXNET_DEBUG_CB_ENABLED) { \
92 printf("[%s][CB][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
93 ## __VA_ARGS__); \
94 } \
95 } while (0)
96
97#define VMW_PKPRN(fmt, ...) \
98 do { \
99 if (VMXNET_DEBUG_PACKETS_ENABLED) { \
100 printf("[%s][PK][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
101 ## __VA_ARGS__); \
102 } \
103 } while (0)
104
105#define VMW_WRPRN(fmt, ...) \
106 do { \
107 if (VMXNET_DEBUG_WARNINGS_ENABLED) { \
108 printf("[%s][WR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
109 ## __VA_ARGS__); \
110 } \
111 } while (0)
112
113#define VMW_ERPRN(fmt, ...) \
114 do { \
115 if (VMXNET_DEBUG_ERRORS_ENABLED) { \
116 printf("[%s][ER][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
117 ## __VA_ARGS__); \
118 } \
119 } while (0)
120
121#define VMW_IRPRN(fmt, ...) \
122 do { \
123 if (VMXNET_DEBUG_INTERRUPTS_ENABLED) { \
124 printf("[%s][IR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
125 ## __VA_ARGS__); \
126 } \
127 } while (0)
128
129#define VMW_CFPRN(fmt, ...) \
130 do { \
131 if (VMXNET_DEBUG_CONFIG_ENABLED) { \
132 printf("[%s][CF][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
133 ## __VA_ARGS__); \
134 } \
135 } while (0)
136
Dmitry Fleytman75020a72013-03-09 11:21:04 +0200137#define VMW_RIPRN(fmt, ...) \
138 do { \
Miao Yan71c2f5b2015-12-07 21:28:32 -0800139 if (VMXNET_DEBUG_RINGS_ENABLED) { \
140 printf("[%s][RI][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
141 ## __VA_ARGS__); \
142 } \
Dmitry Fleytman75020a72013-03-09 11:21:04 +0200143 } while (0)
Dmitry Fleytman75020a72013-03-09 11:21:04 +0200144
Markus Armbruster2a6a4072016-06-29 13:47:03 +0200145#endif /* QEMU_VMXNET_DEBUG_H */