blob: b4e668ac4fe33e5b6c05fdfc12266a92baabd327 [file] [log] [blame]
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -03001=========================================
2How to get printk format specifiers right
3=========================================
4
5:Author: Randy Dunlap <rdunlap@infradead.org>
6:Author: Andrew Murray <amurray@mpc-data.co.uk>
7
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -03008Integer types
9=============
10
11::
12
13 If variable is of Type, use printk format specifier:
14 ------------------------------------------------------------
Randy Dunlapb67ad182008-11-12 13:26:55 -080015 int %d or %x
16 unsigned int %u or %x
17 long %ld or %lx
18 unsigned long %lu or %lx
19 long long %lld or %llx
20 unsigned long long %llu or %llx
21 size_t %zu or %zx
22 ssize_t %zd or %zx
Geert Uytterhoevene8a7ba52015-04-15 16:17:17 -070023 s32 %d or %x
24 u32 %u or %x
25 s64 %lld or %llx
26 u64 %llu or %llx
27
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -030028If <type> is dependent on a config option for its size (e.g., ``sector_t``,
29``blkcnt_t``) or is architecture-dependent for its size (e.g., ``tcflag_t``),
30use a format specifier of its largest possible type and explicitly cast to it.
31
32Example::
Geert Uytterhoevene8a7ba52015-04-15 16:17:17 -070033
34 printk("test: sector number/total blocks: %llu/%llu\n",
35 (unsigned long long)sector, (unsigned long long)blockcount);
36
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -030037Reminder: ``sizeof()`` result is of type ``size_t``.
Geert Uytterhoevene8a7ba52015-04-15 16:17:17 -070038
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -030039The kernel's printf does not support ``%n``. For obvious reasons, floating
40point formats (``%e, %f, %g, %a``) are also not recognized. Use of any
Rasmus Villemoesd7ec9a02015-11-06 16:30:35 -080041unsupported specifier or length qualifier results in a WARN and early
42return from vsnprintf.
Randy Dunlapb67ad182008-11-12 13:26:55 -080043
Andrew Murray04c55712011-06-15 12:57:09 -070044Raw pointer value SHOULD be printed with %p. The kernel supports
45the following extended format specifiers for pointer types:
46
Tobin C. Hardingad67b742017-11-01 15:32:23 +110047Pointer Types
48=============
49
50Pointers printed without a specifier extension (i.e unadorned %p) are
51hashed to give a unique identifier without leaking kernel addresses to user
52space. On 64 bit machines the first 32 bits are zeroed.
53
54::
55
56 %p abcdef12 or 00000000abcdef12
57
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -030058Symbols/Function Pointers
59=========================
60
61::
Andrew Murray04c55712011-06-15 12:57:09 -070062
63 %pF versatile_init+0x0/0x110
64 %pf versatile_init
65 %pS versatile_init+0x0/0x110
Joe Perchesb0d33c22012-12-12 10:18:50 -080066 %pSR versatile_init+0x9/0x110
67 (with __builtin_extract_return_addr() translation)
Andrew Murray04c55712011-06-15 12:57:09 -070068 %ps versatile_init
69 %pB prev_fn_of_versatile_init+0x88/0x88
70
Helge Dellerd6957f32017-08-15 11:34:19 +020071The ``F`` and ``f`` specifiers are for printing function pointers,
72for example, f->func, &gettimeofday. They have the same result as
73``S`` and ``s`` specifiers. But they do an extra conversion on
74ia64, ppc64 and parisc64 architectures where the function pointers
75are actually function descriptors.
76
77The ``S`` and ``s`` specifiers can be used for printing symbols
78from direct addresses, for example, __builtin_return_address(0),
79(void *)regs->ip. They result in the symbol name with (``S``) or
80without (``s``) offsets. If KALLSYMS are disabled then the symbol
81address is printed instead.
Andrew Murray04c55712011-06-15 12:57:09 -070082
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -030083The ``B`` specifier results in the symbol name with offsets and should be
84used when printing stack backtraces. The specifier takes into
85consideration the effect of compiler optimisations which may occur
86when tail-call``s are used and marked with the noreturn GCC attribute.
Andrew Murray04c55712011-06-15 12:57:09 -070087
Helge Dellerfd46cd52017-08-23 21:52:05 +020088Examples::
89
90 printk("Going to call: %pF\n", gettimeofday);
91 printk("Going to call: %pF\n", p->func);
92 printk("%s: called from %pS\n", __func__, (void *)_RET_IP_);
93 printk("%s: called from %pS\n", __func__,
94 (void *)__builtin_return_address(0));
95 printk("Faulted at %pS\n", (void *)regs->ip);
96 printk(" %s%pB\n", (reliable ? "" : "? "), (void *)*stack);
97
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -030098Kernel Pointers
99===============
100
101::
Andrew Murray04c55712011-06-15 12:57:09 -0700102
Tobin C. Harding553d8e82017-11-23 10:55:24 +1100103 %pK 01234567 or 0123456789abcdef
Andrew Murray04c55712011-06-15 12:57:09 -0700104
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300105For printing kernel pointers which should be hidden from unprivileged
106users. The behaviour of ``%pK`` depends on the ``kptr_restrict sysctl`` - see
107Documentation/sysctl/kernel.txt for more details.
Andrew Murray04c55712011-06-15 12:57:09 -0700108
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300109Struct Resources
110================
111
112::
Andrew Murray04c55712011-06-15 12:57:09 -0700113
114 %pr [mem 0x60000000-0x6fffffff flags 0x2200] or
115 [mem 0x0000000060000000-0x000000006fffffff flags 0x2200]
116 %pR [mem 0x60000000-0x6fffffff pref] or
117 [mem 0x0000000060000000-0x000000006fffffff pref]
118
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300119For printing struct resources. The ``R`` and ``r`` specifiers result in a
120printed resource with (``R``) or without (``r``) a decoded flags member.
121Passed by reference.
Andrew Murray04c55712011-06-15 12:57:09 -0700122
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300123Physical addresses types ``phys_addr_t``
124========================================
125
126::
Stepan Moskovchenko7d799212013-02-21 16:43:09 -0800127
Joe Perchesaaf07622014-01-23 15:54:17 -0800128 %pa[p] 0x01234567 or 0x0123456789abcdef
Stepan Moskovchenko7d799212013-02-21 16:43:09 -0800129
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300130For printing a ``phys_addr_t`` type (and its derivatives, such as
131``resource_size_t``) which can vary based on build options, regardless of
132the width of the CPU data path. Passed by reference.
Stepan Moskovchenko7d799212013-02-21 16:43:09 -0800133
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300134DMA addresses types ``dma_addr_t``
135==================================
136
137::
Joe Perchesaaf07622014-01-23 15:54:17 -0800138
139 %pad 0x01234567 or 0x0123456789abcdef
140
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300141For printing a ``dma_addr_t`` type which can vary based on build options,
142regardless of the width of the CPU data path. Passed by reference.
Joe Perchesaaf07622014-01-23 15:54:17 -0800143
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300144Raw buffer as an escaped string
145===============================
146
147::
Andy Shevchenko71dca952014-10-13 15:55:18 -0700148
149 %*pE[achnops]
150
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300151For printing raw buffer as an escaped string. For the following buffer::
Andy Shevchenko71dca952014-10-13 15:55:18 -0700152
153 1b 62 20 5c 43 07 22 90 0d 5d
154
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300155few examples show how the conversion would be done (the result string
156without surrounding quotes)::
Andy Shevchenko71dca952014-10-13 15:55:18 -0700157
158 %*pE "\eb \C\a"\220\r]"
159 %*pEhp "\x1bb \C\x07"\x90\x0d]"
160 %*pEa "\e\142\040\\\103\a\042\220\r\135"
161
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300162The conversion rules are applied according to an optional combination
163of flags (see :c:func:`string_escape_mem` kernel documentation for the
164details):
Andy Shevchenko71dca952014-10-13 15:55:18 -0700165
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300166 - ``a`` - ESCAPE_ANY
167 - ``c`` - ESCAPE_SPECIAL
168 - ``h`` - ESCAPE_HEX
169 - ``n`` - ESCAPE_NULL
170 - ``o`` - ESCAPE_OCTAL
171 - ``p`` - ESCAPE_NP
172 - ``s`` - ESCAPE_SPACE
Andy Shevchenko71dca952014-10-13 15:55:18 -0700173
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300174By default ESCAPE_ANY_NP is used.
Andy Shevchenko71dca952014-10-13 15:55:18 -0700175
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300176ESCAPE_ANY_NP is the sane choice for many cases, in particularly for
177printing SSIDs.
178
179If field width is omitted the 1 byte only will be escaped.
180
181Raw buffer as a hex string
182==========================
183
184::
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800185
Andy Shevchenko31550a12012-07-30 14:40:27 -0700186 %*ph 00 01 02 ... 3f
187 %*phC 00:01:02: ... :3f
188 %*phD 00-01-02- ... -3f
189 %*phN 000102 ... 3f
190
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300191For printing a small buffers (up to 64 bytes long) as a hex string with
192certain separator. For the larger buffers consider to use
193:c:func:`print_hex_dump`.
Andy Shevchenko31550a12012-07-30 14:40:27 -0700194
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300195MAC/FDDI addresses
196==================
197
198::
Andrew Murray04c55712011-06-15 12:57:09 -0700199
200 %pM 00:01:02:03:04:05
Andrei Emeltchenko76597ff92012-07-30 14:40:23 -0700201 %pMR 05:04:03:02:01:00
Andrew Murray04c55712011-06-15 12:57:09 -0700202 %pMF 00-01-02-03-04-05
203 %pm 000102030405
Andy Shevchenko7c591542012-10-04 17:12:33 -0700204 %pmR 050403020100
Andrew Murray04c55712011-06-15 12:57:09 -0700205
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300206For printing 6-byte MAC/FDDI addresses in hex notation. The ``M`` and ``m``
207specifiers result in a printed address with (``M``) or without (``m``) byte
208separators. The default byte separator is the colon (``:``).
Andrew Murray04c55712011-06-15 12:57:09 -0700209
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300210Where FDDI addresses are concerned the ``F`` specifier can be used after
211the ``M`` specifier to use dash (``-``) separators instead of the default
212separator.
Andrew Murray04c55712011-06-15 12:57:09 -0700213
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300214For Bluetooth addresses the ``R`` specifier shall be used after the ``M``
215specifier to use reversed byte order suitable for visual interpretation
216of Bluetooth addresses which are in the little endian order.
Andrei Emeltchenko76597ff92012-07-30 14:40:23 -0700217
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300218Passed by reference.
Geert Uytterhoeven73306602015-04-15 16:17:14 -0700219
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300220IPv4 addresses
221==============
222
223::
Andrew Murray04c55712011-06-15 12:57:09 -0700224
225 %pI4 1.2.3.4
226 %pi4 001.002.003.004
Daniel Borkmann8ecada12013-06-28 15:49:39 +0200227 %p[Ii]4[hnbl]
Andrew Murray04c55712011-06-15 12:57:09 -0700228
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300229For printing IPv4 dot-separated decimal addresses. The ``I4`` and ``i4``
230specifiers result in a printed address with (``i4``) or without (``I4``)
231leading zeros.
Andrew Murray04c55712011-06-15 12:57:09 -0700232
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300233The additional ``h``, ``n``, ``b``, and ``l`` specifiers are used to specify
234host, network, big or little endian order addresses respectively. Where
235no specifier is provided the default network/big endian order is used.
Andrew Murray04c55712011-06-15 12:57:09 -0700236
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300237Passed by reference.
Geert Uytterhoeven73306602015-04-15 16:17:14 -0700238
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300239IPv6 addresses
240==============
241
242::
Andrew Murray04c55712011-06-15 12:57:09 -0700243
244 %pI6 0001:0002:0003:0004:0005:0006:0007:0008
245 %pi6 00010002000300040005000600070008
246 %pI6c 1:2:3:4:5:6:7:8
247
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300248For printing IPv6 network-order 16-bit hex addresses. The ``I6`` and ``i6``
249specifiers result in a printed address with (``I6``) or without (``i6``)
250colon-separators. Leading zeros are always used.
Andrew Murray04c55712011-06-15 12:57:09 -0700251
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300252The additional ``c`` specifier can be used with the ``I`` specifier to
253print a compressed IPv6 address as described by
254http://tools.ietf.org/html/rfc5952
Andrew Murray04c55712011-06-15 12:57:09 -0700255
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300256Passed by reference.
Geert Uytterhoeven73306602015-04-15 16:17:14 -0700257
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300258IPv4/IPv6 addresses (generic, with port, flowinfo, scope)
259=========================================================
260
261::
Daniel Borkmann10679642013-06-28 19:49:39 +0200262
263 %pIS 1.2.3.4 or 0001:0002:0003:0004:0005:0006:0007:0008
264 %piS 001.002.003.004 or 00010002000300040005000600070008
265 %pISc 1.2.3.4 or 1:2:3:4:5:6:7:8
266 %pISpc 1.2.3.4:12345 or [1:2:3:4:5:6:7:8]:12345
267 %p[Ii]S[pfschnbl]
268
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300269For printing an IP address without the need to distinguish whether it``s
270of type AF_INET or AF_INET6, a pointer to a valid ``struct sockaddr``,
271specified through ``IS`` or ``iS``, can be passed to this format specifier.
Daniel Borkmann10679642013-06-28 19:49:39 +0200272
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300273The additional ``p``, ``f``, and ``s`` specifiers are used to specify port
274(IPv4, IPv6), flowinfo (IPv6) and scope (IPv6). Ports have a ``:`` prefix,
275flowinfo a ``/`` and scope a ``%``, each followed by the actual value.
Daniel Borkmann10679642013-06-28 19:49:39 +0200276
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300277In case of an IPv6 address the compressed IPv6 address as described by
278http://tools.ietf.org/html/rfc5952 is being used if the additional
279specifier ``c`` is given. The IPv6 address is surrounded by ``[``, ``]`` in
280case of additional specifiers ``p``, ``f`` or ``s`` as suggested by
281https://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-07
Daniel Borkmann10679642013-06-28 19:49:39 +0200282
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300283In case of IPv4 addresses, the additional ``h``, ``n``, ``b``, and ``l``
284specifiers can be used as well and are ignored in case of an IPv6
285address.
Daniel Borkmann10679642013-06-28 19:49:39 +0200286
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300287Passed by reference.
Geert Uytterhoeven73306602015-04-15 16:17:14 -0700288
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300289Further examples::
Daniel Borkmann10679642013-06-28 19:49:39 +0200290
291 %pISfc 1.2.3.4 or [1:2:3:4:5:6:7:8]/123456789
292 %pISsc 1.2.3.4 or [1:2:3:4:5:6:7:8]%1234567890
293 %pISpfc 1.2.3.4:12345 or [1:2:3:4:5:6:7:8]:12345/123456789
294
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300295UUID/GUID addresses
296===================
297
298::
Andrew Murray04c55712011-06-15 12:57:09 -0700299
300 %pUb 00010203-0405-0607-0809-0a0b0c0d0e0f
301 %pUB 00010203-0405-0607-0809-0A0B0C0D0E0F
302 %pUl 03020100-0504-0706-0809-0a0b0c0e0e0f
303 %pUL 03020100-0504-0706-0809-0A0B0C0E0E0F
304
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300305For printing 16-byte UUID/GUIDs addresses. The additional 'l', 'L',
306'b' and 'B' specifiers are used to specify a little endian order in
307lower ('l') or upper case ('L') hex characters - and big endian order
308in lower ('b') or upper case ('B') hex characters.
Andrew Murray04c55712011-06-15 12:57:09 -0700309
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300310Where no additional specifiers are used the default big endian
311order with lower case hex characters will be printed.
Andrew Murray04c55712011-06-15 12:57:09 -0700312
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300313Passed by reference.
Geert Uytterhoeven73306602015-04-15 16:17:14 -0700314
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300315dentry names
316============
317
318::
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800319
Al Viro4b6ccca2013-09-03 12:00:44 -0400320 %pd{,2,3,4}
321 %pD{,2,3,4}
322
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300323For printing dentry name; if we race with :c:func:`d_move`, the name might be
324a mix of old and new ones, but it won't oops. ``%pd`` dentry is a safer
325equivalent of ``%s`` ``dentry->d_name.name`` we used to use, ``%pd<n>`` prints
326``n`` last components. ``%pD`` does the same thing for struct file.
Al Viro4b6ccca2013-09-03 12:00:44 -0400327
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300328Passed by reference.
Geert Uytterhoeven73306602015-04-15 16:17:14 -0700329
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300330block_device names
331==================
332
333::
Dmitry Monakhov1031bc52015-04-13 16:31:35 +0400334
335 %pg sda, sda1 or loop0p1
336
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300337For printing name of block_device pointers.
Dmitry Monakhov1031bc52015-04-13 16:31:35 +0400338
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300339struct va_format
340================
341
342::
Andrew Murray04c55712011-06-15 12:57:09 -0700343
344 %pV
345
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300346For printing struct va_format structures. These contain a format string
347and va_list as follows::
Andrew Murray04c55712011-06-15 12:57:09 -0700348
349 struct va_format {
350 const char *fmt;
351 va_list *va;
352 };
353
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300354Implements a "recursive vsnprintf".
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800355
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300356Do not use this feature without some mechanism to verify the
357correctness of the format string and va_list arguments.
Randy Dunlapb67ad182008-11-12 13:26:55 -0800358
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300359Passed by reference.
Geert Uytterhoeven73306602015-04-15 16:17:14 -0700360
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300361kobjects
362========
363
364::
365
Pantelis Antoniouce4fecf2015-01-21 19:06:14 +0200366 %pO
367
368 Base specifier for kobject based structs. Must be followed with
369 character for specific type of kobject as listed below:
370
371 Device tree nodes:
372
373 %pOF[fnpPcCF]
374
375 For printing device tree nodes. The optional arguments are:
376 f device node full_name
377 n device node name
378 p device node phandle
379 P device node path spec (name + @unit)
380 F device node flags
381 c major compatible string
382 C full compatible string
383 Without any arguments prints full_name (same as %pOFf)
384 The separator when using multiple arguments is ':'
385
386 Examples:
387
388 %pOF /foo/bar@0 - Node full name
389 %pOFf /foo/bar@0 - Same as above
390 %pOFfp /foo/bar@0:10 - Node full name + phandle
391 %pOFfcF /foo/bar@0:foo,device:--P- - Node full name +
392 major compatible string +
393 node flags
394 D - dynamic
395 d - detached
396 P - Populated
397 B - Populated bus
398
399 Passed by reference.
400
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300401
402struct clk
403==========
404
405::
Geert Uytterhoeven900cca22015-04-15 16:17:20 -0700406
407 %pC pll1
408 %pCn pll1
409 %pCr 1560000000
410
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300411For printing struct clk structures. ``%pC`` and ``%pCn`` print the name
412(Common Clock Framework) or address (legacy clock framework) of the
413structure; ``%pCr`` prints the current clock rate.
Geert Uytterhoeven900cca22015-04-15 16:17:20 -0700414
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300415Passed by reference.
Geert Uytterhoeven900cca22015-04-15 16:17:20 -0700416
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300417bitmap and its derivatives such as cpumask and nodemask
418=======================================================
419
420::
Wang Longd0724962015-02-26 03:28:25 +0000421
422 %*pb 0779
423 %*pbl 0,3-6,8-10
424
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300425For printing bitmap and its derivatives such as cpumask and nodemask,
426``%*pb`` output the bitmap with field width as the number of bits and ``%*pbl``
427output the bitmap as range list with field width as the number of bits.
Wang Longd0724962015-02-26 03:28:25 +0000428
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300429Passed by reference.
Randy Dunlapb67ad182008-11-12 13:26:55 -0800430
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300431Flags bitfields such as page flags, gfp_flags
432=============================================
433
434::
Vlastimil Babkaedf14cd2016-03-15 14:55:56 -0700435
436 %pGp referenced|uptodate|lru|active|private
437 %pGg GFP_USER|GFP_DMA32|GFP_NOWARN
438 %pGv read|exec|mayread|maywrite|mayexec|denywrite
439
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300440For printing flags bitfields as a collection of symbolic constants that
441would construct the value. The type of flags is given by the third
442character. Currently supported are [p]age flags, [v]ma_flags (both
443expect ``unsigned long *``) and [g]fp_flags (expects ``gfp_t *``). The flag
444names and print order depends on the particular type.
Vlastimil Babkaedf14cd2016-03-15 14:55:56 -0700445
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300446Note that this format should not be used directly in :c:func:`TP_printk()` part
447of a tracepoint. Instead, use the ``show_*_flags()`` functions from
448<trace/events/mmflags.h>.
Vlastimil Babkaedf14cd2016-03-15 14:55:56 -0700449
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300450Passed by reference.
Vlastimil Babkaedf14cd2016-03-15 14:55:56 -0700451
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300452Network device features
453=======================
454
455::
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800456
457 %pNF 0x000000000000c000
458
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300459For printing netdev_features_t.
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800460
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300461Passed by reference.
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800462
Mauro Carvalho Chehab3b033382017-05-16 22:27:11 -0300463If you add other ``%p`` extensions, please extend lib/test_printf.c with
Rasmus Villemoesd7ec9a02015-11-06 16:30:35 -0800464one or more test cases, if at all feasible.
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800465
Martin Kletzander5e4ee7b2015-11-06 16:30:17 -0800466
Randy Dunlapb67ad182008-11-12 13:26:55 -0800467Thank you for your cooperation and attention.