vmxnet_debug.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. #ifndef QEMU_VMXNET_DEBUG_H
  18. #define QEMU_VMXNET_DEBUG_H
  19. #define VMXNET_DEVICE_NAME "vmxnet3"
  20. #define VMXNET_DEBUG_WARNINGS
  21. #define VMXNET_DEBUG_ERRORS
  22. #undef VMXNET_DEBUG_CB
  23. #undef VMXNET_DEBUG_INTERRUPTS
  24. #undef VMXNET_DEBUG_CONFIG
  25. #undef VMXNET_DEBUG_RINGS
  26. #undef VMXNET_DEBUG_PACKETS
  27. #undef VMXNET_DEBUG_SHMEM_ACCESS
  28. #ifdef VMXNET_DEBUG_CB
  29. # define VMXNET_DEBUG_CB_ENABLED 1
  30. #else
  31. # define VMXNET_DEBUG_CB_ENABLED 0
  32. #endif
  33. #ifdef VMXNET_DEBUG_WARNINGS
  34. # define VMXNET_DEBUG_WARNINGS_ENABLED 1
  35. #else
  36. # define VMXNET_DEBUG_WARNINGS_ENABLED 0
  37. #endif
  38. #ifdef VMXNET_DEBUG_ERRORS
  39. # define VMXNET_DEBUG_ERRORS_ENABLED 1
  40. #else
  41. # define VMXNET_DEBUG_ERRORS_ENABLED 0
  42. #endif
  43. #ifdef VMXNET_DEBUG_CONFIG
  44. # define VMXNET_DEBUG_CONFIG_ENABLED 1
  45. #else
  46. # define VMXNET_DEBUG_CONFIG_ENABLED 0
  47. #endif
  48. #ifdef VMXNET_DEBUG_RINGS
  49. # define VMXNET_DEBUG_RINGS_ENABLED 1
  50. #else
  51. # define VMXNET_DEBUG_RINGS_ENABLED 0
  52. #endif
  53. #ifdef VMXNET_DEBUG_PACKETS
  54. # define VMXNET_DEBUG_PACKETS_ENABLED 1
  55. #else
  56. # define VMXNET_DEBUG_PACKETS_ENABLED 0
  57. #endif
  58. #ifdef VMXNET_DEBUG_INTERRUPTS
  59. # define VMXNET_DEBUG_INTERRUPTS_ENABLED 1
  60. #else
  61. # define VMXNET_DEBUG_INTERRUPTS_ENABLED 0
  62. #endif
  63. #ifdef VMXNET_DEBUG_SHMEM_ACCESS
  64. # define VMXNET_DEBUG_SHMEM_ACCESS_ENABLED 1
  65. #else
  66. # define VMXNET_DEBUG_SHMEM_ACCESS_ENABLED 0
  67. #endif
  68. #define VMW_SHPRN(fmt, ...) \
  69. do { \
  70. if (VMXNET_DEBUG_SHMEM_ACCESS_ENABLED) { \
  71. printf("[%s][SH][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  72. ## __VA_ARGS__); \
  73. } \
  74. } while (0)
  75. #define VMW_CBPRN(fmt, ...) \
  76. do { \
  77. if (VMXNET_DEBUG_CB_ENABLED) { \
  78. printf("[%s][CB][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  79. ## __VA_ARGS__); \
  80. } \
  81. } while (0)
  82. #define VMW_PKPRN(fmt, ...) \
  83. do { \
  84. if (VMXNET_DEBUG_PACKETS_ENABLED) { \
  85. printf("[%s][PK][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  86. ## __VA_ARGS__); \
  87. } \
  88. } while (0)
  89. #define VMW_WRPRN(fmt, ...) \
  90. do { \
  91. if (VMXNET_DEBUG_WARNINGS_ENABLED) { \
  92. printf("[%s][WR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  93. ## __VA_ARGS__); \
  94. } \
  95. } while (0)
  96. #define VMW_ERPRN(fmt, ...) \
  97. do { \
  98. if (VMXNET_DEBUG_ERRORS_ENABLED) { \
  99. printf("[%s][ER][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  100. ## __VA_ARGS__); \
  101. } \
  102. } while (0)
  103. #define VMW_IRPRN(fmt, ...) \
  104. do { \
  105. if (VMXNET_DEBUG_INTERRUPTS_ENABLED) { \
  106. printf("[%s][IR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  107. ## __VA_ARGS__); \
  108. } \
  109. } while (0)
  110. #define VMW_CFPRN(fmt, ...) \
  111. do { \
  112. if (VMXNET_DEBUG_CONFIG_ENABLED) { \
  113. printf("[%s][CF][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  114. ## __VA_ARGS__); \
  115. } \
  116. } while (0)
  117. #define VMW_RIPRN(fmt, ...) \
  118. do { \
  119. if (VMXNET_DEBUG_RINGS_ENABLED) { \
  120. printf("[%s][RI][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
  121. ## __VA_ARGS__); \
  122. } \
  123. } while (0)
  124. #endif /* QEMU_VMXNET_DEBUG_H */