[PATCH 1/2] kernel.h: add pr_<level>_hex_dump macros
From: Roman Fietze
Date: Fri Dec 03 2010 - 08:06:56 EST
Add macros e.g. named pr_<level>_hex_dump calling print_hex_dump with
the approriate level, with level beeing emerg, alert, ..., debug. This
is similiar to the functions starting with "pr_".
The parameters for those macros are the same as for print_hex_dump
excluding the level.
Signed-off-by: Roman Fietze <roman.fietze@xxxxxxxxxxxxx>
---
include/linux/printk.h | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index b772ca5..77903f1 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -179,6 +179,44 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
#define pr_cont(fmt, ...) \
printk(KERN_CONT fmt, ##__VA_ARGS__)
+#define pr_emerg_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_EMERG, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_alert_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_ALERT, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_crit_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_CRIT, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_err_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_ERR, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_warning_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_WARNING, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_warn_hex_dump pr_warning_hex_dump
+#define pr_notice_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_NOTICE, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_info_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_INFO, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_cont_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_CONT, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+#define pr_debug_hex_dump(prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii) \
+ print_hex_dump(KERN_DEBUG, prfx_str, prfx_type, rowsz, grpsz, \
+ buf, len, ascii)
+
/* pr_devel() should produce zero code unless DEBUG is defined */
#ifdef DEBUG
#define pr_devel(fmt, ...) \
--
1.7.3.2
--
Roman Fietze Telemotive AG Buero Muehlhausen
Breitwiesen 73347 Muehlhausen
Tel.: +49(0)7335/18493-45 http://www.telemotive.de
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/