Thread (13 messages) 13 messages, 6 authors, 2012-12-12

Re: [RFC] dynamic_debug: introduce debug_hex_dump()

From: Vladimir Kondratiev <hidden>
Date: 2012-11-18 15:44:53
Also in: lkml

Possibly related (same subject, not in this thread)

On Sunday, November 18, 2012 06:38:51 AM Joe Perches wrote:
Another option could be testing __builtin_constant_p(prefix)
You mean something like below? Yes, it will work as well.

Pro: don't need to change existing code 
(drop [PATCH 2/2] dynamic_debug: use constant format in print_hex_dump_bytes())

Cons: format in dynamic metadata will be useless

What looks better?

---
#define dynamic_hex_dump(prefix_str, prefix_type, rowsize,	\
			 groupsize, buf, len, ascii)		\
do {								\
	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, 		\
		__builtin_constant_p(prefix_str) ? prefix_str : "hexdump");\
	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT))	\
		print_hex_dump(KERN_DEBUG, prefix_str,		\
			       prefix_type, rowsize, groupsize,	\
			       buf, len, ascii);		\
} while (0)


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help