2 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
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:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
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.
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
33 #ifndef _VERBS_DEBUG_H
34 #define _VERBS_DEBUG_H
37 * This file contains tracing code for the ib_ipath kernel module.
39 #ifndef _VERBS_DEBUGGING /* tracing enabled or not */
40 #define _VERBS_DEBUGGING 1
43 extern unsigned ib_ipath_debug
;
45 #define _VERBS_ERROR(fmt,...) \
47 printk(KERN_ERR "%s: " fmt, "ib_ipath", ##__VA_ARGS__); \
50 #define _VERBS_UNIT_ERROR(unit,fmt,...) \
52 printk(KERN_ERR "%s: " fmt, "ib_ipath", ##__VA_ARGS__); \
58 * Mask values for debugging. The scheme allows us to compile out any
59 * of the debug tracing stuff, and if compiled in, to enable or
60 * disable dynamically.
61 * This can be set at modprobe time also:
62 * modprobe ib_path ib_ipath_debug=3
65 #define __VERBS_INFO 0x1 /* generic low verbosity stuff */
66 #define __VERBS_DBG 0x2 /* generic debug */
67 #define __VERBS_VDBG 0x4 /* verbose debug */
68 #define __VERBS_SMADBG 0x8000 /* sma packet debug */
70 #define _VERBS_INFO(fmt,...) \
72 if (unlikely(ib_ipath_debug&__VERBS_INFO)) \
73 printk(KERN_INFO "%s: " fmt,"ib_ipath", \
77 #define _VERBS_DBG(fmt,...) \
79 if (unlikely(ib_ipath_debug&__VERBS_DBG)) \
80 printk(KERN_DEBUG "%s: " fmt, __func__, \
84 #define _VERBS_VDBG(fmt,...) \
86 if (unlikely(ib_ipath_debug&__VERBS_VDBG)) \
87 printk(KERN_DEBUG "%s: " fmt, __func__, \
91 #define _VERBS_SMADBG(fmt,...) \
93 if (unlikely(ib_ipath_debug&__VERBS_SMADBG)) \
94 printk(KERN_DEBUG "%s: " fmt, __func__, \
98 #else /* ! _VERBS_DEBUGGING */
100 #define _VERBS_INFO(fmt,...)
101 #define _VERBS_DBG(fmt,...)
102 #define _VERBS_VDBG(fmt,...)
103 #define _VERBS_SMADBG(fmt,...)
105 #endif /* _VERBS_DEBUGGING */
107 #endif /* _VERBS_DEBUG_H */