Thread (5 messages) 5 messages, 2 authors, 2011-03-01

Re: [RFC v2 1/2] dynamic debug: add dynamic_hexdump_debug macro

From: Joe Perches <joe@perches.com>
Date: 2011-03-01 05:25:41
Also in: lkml

On Mon, 2011-02-28 at 21:06 -0800, Bing Zhao wrote:
dynamic_hexdump_debug(str, buf, len)
quoted hunk ↗ jump to hunk
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
+#define dynamic_hexdump_debug(str, buf, len)				\
+do {									\
+	static struct _ddebug descriptor				\
+	__used								\
+	__attribute__((section("__verbose"), aligned(8))) =		\
+	{ KBUILD_MODNAME, __func__, __FILE__, str, __LINE__,		\
+		_DPRINTK_FLAGS_DEFAULT };				\
+	if (unlikely(descriptor.enabled)) {				\
+		printk(KERN_DEBUG str);					\
+		print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len);	\
Perhaps
		print_hex_dump(str, DUMP_PREFIX_OFFSET, buf, len);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help