aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/printk-formats.txt
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2012-07-30 17:40:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 20:25:14 -0400
commit31550a16a5d2af859e8a11839e8c6c6c9c92dfa7 (patch)
treeb38c5921bfeecdfc24e3146b15e21360a490e19e /Documentation/printk-formats.txt
parent3715c5309f6d175c3053672b73fd4f73be16fd07 (diff)
vsprintf: add support of '%*ph[CDN]'
There are many places in the kernel where the drivers print small buffers as a hex string. This patch adds a support of the variable width buffer to print it as a hex string with a delimiter. The idea came from Pavel Roskin here: http://www.digipedia.pl/usenet/thread/18835/17449/ Sample output of pr_info("buf[%d:%d] %*phC\n", from, len, len, &buf[from]); could be look like this: [ 0.726130] buf[51:8] e8:16:b6:ef:e3:74:45:6e [ 0.750736] buf[59:15] 31:81:b8:3f:35:49:06:ae:df:32:06:05:4a:af:55 [ 0.757602] buf[17:5] ac:16:d5:2c:ef Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/printk-formats.txt')
-rw-r--r--Documentation/printk-formats.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index d8d168fa79d6..7561d7ed8e11 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -53,6 +53,16 @@ Struct Resources:
53 For printing struct resources. The 'R' and 'r' specifiers result in a 53 For printing struct resources. The 'R' and 'r' specifiers result in a
54 printed resource with ('R') or without ('r') a decoded flags member. 54 printed resource with ('R') or without ('r') a decoded flags member.
55 55
56Raw buffer as a hex string:
57 %*ph 00 01 02 ... 3f
58 %*phC 00:01:02: ... :3f
59 %*phD 00-01-02- ... -3f
60 %*phN 000102 ... 3f
61
62 For printing a small buffers (up to 64 bytes long) as a hex string with
63 certain separator. For the larger buffers consider to use
64 print_hex_dump().
65
56MAC/FDDI addresses: 66MAC/FDDI addresses:
57 67
58 %pM 00:01:02:03:04:05 68 %pM 00:01:02:03:04:05