diff options
Diffstat (limited to 'fs/9p/debug.h')
-rw-r--r-- | fs/9p/debug.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/9p/debug.h b/fs/9p/debug.h index 4445f06919d9..fe551032788b 100644 --- a/fs/9p/debug.h +++ b/fs/9p/debug.h | |||
@@ -51,16 +51,23 @@ do { \ | |||
51 | #if DEBUG_DUMP_PKT | 51 | #if DEBUG_DUMP_PKT |
52 | static inline void dump_data(const unsigned char *data, unsigned int datalen) | 52 | static inline void dump_data(const unsigned char *data, unsigned int datalen) |
53 | { | 53 | { |
54 | int i, j; | 54 | int i, n; |
55 | int len = datalen; | 55 | char buf[5*8]; |
56 | 56 | ||
57 | printk(KERN_DEBUG "data "); | 57 | n = 0; |
58 | for (i = 0; i < len; i += 4) { | 58 | i = 0; |
59 | for (j = 0; (j < 4) && (i + j < len); j++) | 59 | while (i < datalen) { |
60 | printk(KERN_DEBUG "%02x", data[i + j]); | 60 | n += snprintf(buf+n, sizeof(buf)-n, "%02x", data[i++]); |
61 | printk(KERN_DEBUG " "); | 61 | if (i%4 == 0) |
62 | n += snprintf(buf+n, sizeof(buf)-n, " "); | ||
63 | |||
64 | if (i%16 == 0) { | ||
65 | dprintk(DEBUG_ERROR, "%s\n", buf); | ||
66 | n = 0; | ||
67 | } | ||
62 | } | 68 | } |
63 | printk(KERN_DEBUG "\n"); | 69 | |
70 | dprintk(DEBUG_ERROR, "%s\n", buf); | ||
64 | } | 71 | } |
65 | #else /* DEBUG_DUMP_PKT */ | 72 | #else /* DEBUG_DUMP_PKT */ |
66 | static inline void dump_data(const unsigned char *data, unsigned int datalen) | 73 | static inline void dump_data(const unsigned char *data, unsigned int datalen) |