lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1298956016-30673-3-git-send-email-bzhao@marvell.com>
Date:	Mon, 28 Feb 2011 21:06:56 -0800
From:	Bing Zhao <bzhao@...vell.com>
To:	linux-kernel@...r.kernel.org
Cc:	linux-wireless@...r.kernel.org,
	"John W. Linville" <linville@...driver.com>,
	Johannes Berg <johannes@...solutions.net>,
	Amitkumar Karwar <akarwar@...vell.com>,
	Kiran Divekar <dkiran@...vell.com>,
	Frank Huang <frankh@...vell.com>, Bing Zhao <bzhao@...vell.com>
Subject: [RFC v2 2/2] printk: add hexdump_debug macro

hexdump_debug(str, buf, len)

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

usage:
hexdump_debug("mwifiex data: tx_buf:\n", tx_buf, 32);

Signed-off-by: Bing Zhao <bzhao@...vell.com>
---
 include/linux/printk.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index ee048e7..c758131 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -299,4 +299,18 @@ static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
 
 #endif
 
+#if defined(DEBUG)
+#define hexdump_debug(str, buf, len) \
+do {									\
+	printk(KERN_DEBUG str);						\
+	print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len);		\
+} while (0)
+#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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ