2 * Copyright (c) 2006 QLogic, Inc. All rights reserved.
3 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 #ifndef _VERBS_DEBUG_H
35 #define _VERBS_DEBUG_H
38 * This file contains tracing code for the ib_ipath kernel module.
40 #ifndef _VERBS_DEBUGGING /* tracing enabled or not */
41 #define _VERBS_DEBUGGING 1
44 extern unsigned ib_ipath_debug;
46 #define _VERBS_ERROR(fmt,...) \
48 printk(KERN_ERR "%s: " fmt, "ib_ipath", ##__VA_ARGS__); \
51 #define _VERBS_UNIT_ERROR(unit,fmt,...) \
53 printk(KERN_ERR "%s: " fmt, "ib_ipath", ##__VA_ARGS__); \
59 * Mask values for debugging. The scheme allows us to compile out any
60 * of the debug tracing stuff, and if compiled in, to enable or
61 * disable dynamically.
62 * This can be set at modprobe time also:
63 * modprobe ib_path ib_ipath_debug=3
66 #define __VERBS_INFO 0x1 /* generic low verbosity stuff */
67 #define __VERBS_DBG 0x2 /* generic debug */
68 #define __VERBS_VDBG 0x4 /* verbose debug */
69 #define __VERBS_SMADBG 0x8000 /* sma packet debug */
71 #define _VERBS_INFO(fmt,...) \
73 if (unlikely(ib_ipath_debug&__VERBS_INFO)) \
74 printk(KERN_INFO "%s: " fmt,"ib_ipath", \
78 #define _VERBS_DBG(fmt,...) \
80 if (unlikely(ib_ipath_debug&__VERBS_DBG)) \
81 printk(KERN_DEBUG "%s: " fmt, __func__, \
85 #define _VERBS_VDBG(fmt,...) \
87 if (unlikely(ib_ipath_debug&__VERBS_VDBG)) \
88 printk(KERN_DEBUG "%s: " fmt, __func__, \
92 #define _VERBS_SMADBG(fmt,...) \
94 if (unlikely(ib_ipath_debug&__VERBS_SMADBG)) \
95 printk(KERN_DEBUG "%s: " fmt, __func__, \
99 #else /* ! _VERBS_DEBUGGING */
101 #define _VERBS_INFO(fmt,...)
102 #define _VERBS_DBG(fmt,...)
103 #define _VERBS_VDBG(fmt,...)
104 #define _VERBS_SMADBG(fmt,...)
106 #endif /* _VERBS_DEBUGGING */
108 #endif /* _VERBS_DEBUG_H */