ipath_debug.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #ifndef _IPATH_DEBUG_H
  33. #define _IPATH_DEBUG_H
  34. #ifndef _IPATH_DEBUGGING /* debugging enabled or not */
  35. #define _IPATH_DEBUGGING 1
  36. #endif
  37. #if _IPATH_DEBUGGING
  38. /*
  39. * Mask values for debugging. The scheme allows us to compile out any
  40. * of the debug tracing stuff, and if compiled in, to enable or disable
  41. * dynamically. This can be set at modprobe time also:
  42. * modprobe infinipath.ko infinipath_debug=7
  43. */
  44. #define __IPATH_INFO 0x1 /* generic low verbosity stuff */
  45. #define __IPATH_DBG 0x2 /* generic debug */
  46. #define __IPATH_TRSAMPLE 0x8 /* generate trace buffer sample entries */
  47. /* leave some low verbosity spots open */
  48. #define __IPATH_VERBDBG 0x40 /* very verbose debug */
  49. #define __IPATH_PKTDBG 0x80 /* print packet data */
  50. /* print process startup (init)/exit messages */
  51. #define __IPATH_PROCDBG 0x100
  52. /* print mmap/nopage stuff, not using VDBG any more */
  53. #define __IPATH_MMDBG 0x200
  54. #define __IPATH_USER_SEND 0x1000 /* use user mode send */
  55. #define __IPATH_KERNEL_SEND 0x2000 /* use kernel mode send */
  56. #define __IPATH_EPKTDBG 0x4000 /* print ethernet packet data */
  57. #define __IPATH_SMADBG 0x8000 /* sma packet debug */
  58. #define __IPATH_IPATHDBG 0x10000 /* Ethernet (IPATH) general debug on */
  59. #define __IPATH_IPATHWARN 0x20000 /* Ethernet (IPATH) warnings on */
  60. #define __IPATH_IPATHERR 0x40000 /* Ethernet (IPATH) errors on */
  61. #define __IPATH_IPATHPD 0x80000 /* Ethernet (IPATH) packet dump on */
  62. #define __IPATH_IPATHTABLE 0x100000 /* Ethernet (IPATH) table dump on */
  63. #else /* _IPATH_DEBUGGING */
  64. /*
  65. * define all of these even with debugging off, for the few places that do
  66. * if(infinipath_debug & _IPATH_xyzzy), but in a way that will make the
  67. * compiler eliminate the code
  68. */
  69. #define __IPATH_INFO 0x0 /* generic low verbosity stuff */
  70. #define __IPATH_DBG 0x0 /* generic debug */
  71. #define __IPATH_TRSAMPLE 0x0 /* generate trace buffer sample entries */
  72. #define __IPATH_VERBDBG 0x0 /* very verbose debug */
  73. #define __IPATH_PKTDBG 0x0 /* print packet data */
  74. #define __IPATH_PROCDBG 0x0 /* print process startup (init)/exit messages */
  75. /* print mmap/nopage stuff, not using VDBG any more */
  76. #define __IPATH_MMDBG 0x0
  77. #define __IPATH_EPKTDBG 0x0 /* print ethernet packet data */
  78. #define __IPATH_SMADBG 0x0 /* print process startup (init)/exit messages */#define __IPATH_IPATHDBG 0x0 /* Ethernet (IPATH) table dump on */
  79. #define __IPATH_IPATHWARN 0x0 /* Ethernet (IPATH) warnings on */
  80. #define __IPATH_IPATHERR 0x0 /* Ethernet (IPATH) errors on */
  81. #define __IPATH_IPATHPD 0x0 /* Ethernet (IPATH) packet dump on */
  82. #define __IPATH_IPATHTABLE 0x0 /* Ethernet (IPATH) packet dump on */
  83. #endif /* _IPATH_DEBUGGING */
  84. #define __IPATH_VERBOSEDBG __IPATH_VERBDBG
  85. #endif /* _IPATH_DEBUG_H */