Documentation: add print bitmap description
authorWang Long <long.wanglong@huawei.com>
Thu, 26 Feb 2015 03:28:25 +0000 (03:28 +0000)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Mar 2015 13:41:55 +0000 (07:41 -0600)
as the commit: "lib/vsprintf: implement bitmap printing through
'%*pb[l]'" add an easy way to print bitmaps. so printk-formats.txt
should reflect it.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/printk-formats.txt

index 5a615c14f75da79133db306179ccdd355bb0b4c4..255a061e43090f013c2fa74fa4189f84e0490c91 100644 (file)
@@ -239,6 +239,15 @@ s64 SHOULD be printed with %lld/%llx:
 
        printk("%lld", s64_var);
 
+bitmap and its derivatives such as cpumask and nodemask:
+
+       %*pb    0779
+       %*pbl   0,3-6,8-10
+
+       For printing bitmap and its derivatives such as cpumask and nodemask,
+       %*pb output the bitmap with field width as the number of bits and %*pbl
+       output the bitmap as range list with field width as the number of bits.
+
 If <type> is dependent on a config option for its size (e.g., sector_t,
 blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
 format specifier of its largest possible type and explicitly cast to it.