2 * linux/fs/9p/debug.h - V9FS Debug Definitions
4 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
5 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to:
18 * Free Software Foundation
19 * 51 Franklin Street, Fifth Floor
20 * Boston, MA 02111-1301 USA
24 #define DEBUG_ERROR (1<<0)
25 #define DEBUG_CURRENT (1<<1)
26 #define DEBUG_9P (1<<2)
27 #define DEBUG_VFS (1<<3)
28 #define DEBUG_CONV (1<<4)
29 #define DEBUG_MUX (1<<5)
30 #define DEBUG_TRANS (1<<6)
31 #define DEBUG_SLABS (1<<7)
32 #define DEBUG_FCALL (1<<8)
34 #define DEBUG_DUMP_PKT 0
36 extern int v9fs_debug_level
;
38 #define dprintk(level, format, arg...) \
40 if((v9fs_debug_level & level)==level) \
41 printk(KERN_NOTICE "-- %s (%d): " \
42 format , __FUNCTION__, current->pid , ## arg); \
45 #define eprintk(level, format, arg...) \
47 printk(level "v9fs: %s (%d): " \
48 format , __FUNCTION__, current->pid , ## arg); \
52 static inline void dump_data(const unsigned char *data
, unsigned int datalen
)
60 n
+= snprintf(buf
+n
, sizeof(buf
)-n
, "%02x", data
[i
++]);
62 n
+= snprintf(buf
+n
, sizeof(buf
)-n
, " ");
65 dprintk(DEBUG_ERROR
, "%s\n", buf
);
70 dprintk(DEBUG_ERROR
, "%s\n", buf
);
72 #else /* DEBUG_DUMP_PKT */
73 static inline void dump_data(const unsigned char *data
, unsigned int datalen
)
77 #endif /* DEBUG_DUMP_PKT */