Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 1 | /* |
| 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 Armbruster | 2a6a407 | 2016-06-29 13:47:03 +0200 | [diff] [blame] | 18 | #ifndef QEMU_VMXNET_DEBUG_H |
| 19 | #define QEMU_VMXNET_DEBUG_H |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 20 | |
| 21 | #define VMXNET_DEVICE_NAME "vmxnet3" |
| 22 | |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 23 | #define VMXNET_DEBUG_WARNINGS |
| 24 | #define VMXNET_DEBUG_ERRORS |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 25 | |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 26 | #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 Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 32 | |
| 33 | #ifdef VMXNET_DEBUG_CB |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 34 | # define VMXNET_DEBUG_CB_ENABLED 1 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 35 | #else |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 36 | # define VMXNET_DEBUG_CB_ENABLED 0 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 37 | #endif |
| 38 | |
| 39 | #ifdef VMXNET_DEBUG_WARNINGS |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 40 | # define VMXNET_DEBUG_WARNINGS_ENABLED 1 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 41 | #else |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 42 | # define VMXNET_DEBUG_WARNINGS_ENABLED 0 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 43 | #endif |
| 44 | |
| 45 | #ifdef VMXNET_DEBUG_ERRORS |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 46 | # define VMXNET_DEBUG_ERRORS_ENABLED 1 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 47 | #else |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 48 | # define VMXNET_DEBUG_ERRORS_ENABLED 0 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 49 | #endif |
| 50 | |
| 51 | #ifdef VMXNET_DEBUG_CONFIG |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 52 | # define VMXNET_DEBUG_CONFIG_ENABLED 1 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 53 | #else |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 54 | # define VMXNET_DEBUG_CONFIG_ENABLED 0 |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 55 | #endif |
| 56 | |
| 57 | #ifdef VMXNET_DEBUG_RINGS |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 58 | # 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 Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 137 | #define VMW_RIPRN(fmt, ...) \ |
| 138 | do { \ |
Miao Yan | 71c2f5b | 2015-12-07 21:28:32 -0800 | [diff] [blame] | 139 | if (VMXNET_DEBUG_RINGS_ENABLED) { \ |
| 140 | printf("[%s][RI][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \ |
| 141 | ## __VA_ARGS__); \ |
| 142 | } \ |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 143 | } while (0) |
Dmitry Fleytman | 75020a7 | 2013-03-09 11:21:04 +0200 | [diff] [blame] | 144 | |
Markus Armbruster | 2a6a407 | 2016-06-29 13:47:03 +0200 | [diff] [blame] | 145 | #endif /* QEMU_VMXNET_DEBUG_H */ |