From: Bing Zhao <bzhao@marvell.com>
To: linux-kernel@vger.kernel.org
Cc: linux-wireless@vger.kernel.org, Joe Perches <joe@perches.com>,
"John W. Linville" <linville@tuxdriver.com>,
Johannes Berg <johannes@sipsolutions.net>,
Amitkumar Karwar <akarwar@marvell.com>,
Kiran Divekar <dkiran@marvell.com>,
Frank Huang <frankh@marvell.com>, Bing Zhao <bzhao@marvell.com>
Subject: [RFC v3 2/2] printk: add hexdump_debug macro
Date: Tue, 1 Mar 2011 17:24:10 -0800 [thread overview]
Message-ID: <1299029050-32242-2-git-send-email-bzhao@marvell.com> (raw)
In-Reply-To: <1299029050-32242-1-git-send-email-bzhao@marvell.com>
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 <bzhao@marvell.com>
---
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
prev parent reply other threads:[~2011-03-02 1:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 1:24 [RFC v3 1/2] dynamic debug: add dynamic_hexdump_debug macro Bing Zhao
2011-03-02 1:24 ` Bing Zhao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1299029050-32242-2-git-send-email-bzhao@marvell.com \
--to=bzhao@marvell.com \
--cc=akarwar@marvell.com \
--cc=dkiran@marvell.com \
--cc=frankh@marvell.com \
--cc=joe@perches.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®