Thread (2 messages) 2 messages, 1 author, 2011-03-02

[RFC v3 2/2] printk: add hexdump_debug macro

From: Bing Zhao <hidden>
Date: 2011-03-02 01:21:26
Also in: lkml
Subsystem: printk, the rest · Maintainers: Petr Mladek, Linus Torvalds

hexdump_debug(str, buf, len)

str: "prefix string"
buf: buffer pointer
len: length of the buffer being printed

usage:
hexdump_debug("mwifiex data_d: tx_buf: ", tx_buf, 32);

Signed-off-by: Bing Zhao <redacted>
---
v3: use "str" as prefix string (Joe Perches)
v2: rebase against linux-next.git tree and split into 2 patches

 include/linux/printk.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index ee048e7..041ef6d 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -299,4 +299,15 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
 
 #endif
 
+#if defined(DEBUG)
+#define hexdump_debug(str, buf, len) \
+	print_hex_dump_bytes(str, DUMP_PREFIX_OFFSET, buf, len);
+#elif defined(CONFIG_DYNAMIC_DEBUG)
+#define hexdump_debug(str, buf, len) \
+	dynamic_hexdump_debug(str, buf, len)
+#else
+#define hexdump_debug(str, buf, len) \
+	no_printk(KERN_DEBUG str)
+#endif
+
 #endif
-- 
1.6.2.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help