diff options
author | Eric Van Hensbergen <ericvh@gmail.com> | 2005-09-09 16:04:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:57 -0400 |
commit | 3ed8491c8a75cefe95b57f7f428a3e2ddd421e97 (patch) | |
tree | 51729254e5b96f0a6794a7e11b51c5d67d9df874 /fs/9p/debug.h | |
parent | 322b329ab787de5f45abca9c9eabfd33bc5927e8 (diff) |
[PATCH] v9fs: debug and support routines
This part of the patch contains debug and other misc routines.
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/9p/debug.h')
-rw-r--r-- | fs/9p/debug.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/fs/9p/debug.h b/fs/9p/debug.h new file mode 100644 index 000000000000..4445f06919d9 --- /dev/null +++ b/fs/9p/debug.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * linux/fs/9p/debug.h - V9FS Debug Definitions | ||
3 | * | ||
4 | * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> | ||
5 | * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to: | ||
19 | * Free Software Foundation | ||
20 | * 51 Franklin Street, Fifth Floor | ||
21 | * Boston, MA 02111-1301 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #define DEBUG_ERROR (1<<0) | ||
26 | #define DEBUG_CURRENT (1<<1) | ||
27 | #define DEBUG_9P (1<<2) | ||
28 | #define DEBUG_VFS (1<<3) | ||
29 | #define DEBUG_CONV (1<<4) | ||
30 | #define DEBUG_MUX (1<<5) | ||
31 | #define DEBUG_TRANS (1<<6) | ||
32 | #define DEBUG_SLABS (1<<7) | ||
33 | |||
34 | #define DEBUG_DUMP_PKT 0 | ||
35 | |||
36 | extern int v9fs_debug_level; | ||
37 | |||
38 | #define dprintk(level, format, arg...) \ | ||
39 | do { \ | ||
40 | if((v9fs_debug_level & level)==level) \ | ||
41 | printk(KERN_NOTICE "-- %s (%d): " \ | ||
42 | format , __FUNCTION__, current->pid , ## arg); \ | ||
43 | } while(0) | ||
44 | |||
45 | #define eprintk(level, format, arg...) \ | ||
46 | do { \ | ||
47 | printk(level "v9fs: %s (%d): " \ | ||
48 | format , __FUNCTION__, current->pid , ## arg); \ | ||
49 | } while(0) | ||
50 | |||
51 | #if DEBUG_DUMP_PKT | ||
52 | static inline void dump_data(const unsigned char *data, unsigned int datalen) | ||
53 | { | ||
54 | int i, j; | ||
55 | int len = datalen; | ||
56 | |||
57 | printk(KERN_DEBUG "data "); | ||
58 | for (i = 0; i < len; i += 4) { | ||
59 | for (j = 0; (j < 4) && (i + j < len); j++) | ||
60 | printk(KERN_DEBUG "%02x", data[i + j]); | ||
61 | printk(KERN_DEBUG " "); | ||
62 | } | ||
63 | printk(KERN_DEBUG "\n"); | ||
64 | } | ||
65 | #else /* DEBUG_DUMP_PKT */ | ||
66 | static inline void dump_data(const unsigned char *data, unsigned int datalen) | ||
67 | { | ||
68 | |||
69 | } | ||
70 | #endif /* DEBUG_DUMP_PKT */ | ||