/sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget+/translations/zh_CN/core-api/printk-formatsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/zh_TW/core-api/printk-formatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/it_IT/core-api/printk-formatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/ja_JP/core-api/printk-formatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/ko_KR/core-api/printk-formatsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/sp_SP/core-api/printk-formatsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h)How to get printk format specifiers righth]h)How to get printk format specifiers right}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhE/var/lib/git/docbuild/linux/Documentation/core-api/printk-formats.rsthKubhtarget)}(h.. _printk-specifiers:h]h}(h]h ]h"]h$]h&]refidprintk-specifiersuh1hhKhhhhhhubh field_list)}(hhh](hfield)}(hhh](h field_name)}(hAuthorh]hAuthor}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(h$Randy Dunlap h]h paragraph)}(hhh](hRandy Dunlap <}(hhhhhNhNubh reference)}(hrdunlap@infradead.orgh]hrdunlap@infradead.org}(hhhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:rdunlap@infradead.orguh1hhhubh>}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hAuthorh]hAuthor}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhKubh)}(h(Andrew Murray h]h)}(h&Andrew Murray h](hAndrew Murray <}(hj+hhhNhNubh)}(hamurray@mpc-data.co.ukh]hamurray@mpc-data.co.uk}(hj3hhhNhNubah}(h]h ]h"]h$]h&]refurimailto:amurray@mpc-data.co.ukuh1hhj+ubh>}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj'ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]hah ]h"]printk-specifiersah$]h&]uh1hhhhhhhhKexpect_referenced_by_name}j]hsexpect_referenced_by_id}hhsubh)}(hhh](h)}(h Integer typesh]h Integer types}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhjdhhhhhK ubh literal_block)}(hXIf variable is of Type, use printk format specifier: ------------------------------------------------------------ signed char %d or %hhx unsigned char %u or %x char %u or %x short int %d or %hx unsigned short int %u or %x int %d or %x unsigned int %u or %x long %ld or %lx unsigned long %lu or %lx long long %lld or %llx unsigned long long %llu or %llx size_t %zu or %zx ssize_t %zd or %zx s8 %d or %hhx u8 %u or %x s16 %d or %hx u16 %u or %x s32 %d or %x u32 %u or %x s64 %lld or %llx u64 %llu or %llxh]hXIf variable is of Type, use printk format specifier: ------------------------------------------------------------ signed char %d or %hhx unsigned char %u or %x char %u or %x short int %d or %hx unsigned short int %u or %x int %d or %x unsigned int %u or %x long %ld or %lx unsigned long %lu or %lx long long %lld or %llx unsigned long long %llu or %llx size_t %zu or %zx ssize_t %zd or %zx s8 %d or %hhx u8 %u or %x s16 %d or %hx u16 %u or %x s32 %d or %x u32 %u or %x s64 %lld or %llx u64 %llu or %llx}hjwsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1juhhhKhjdhhubh)}(hIf is architecture-dependent for its size (e.g., cycles_t, tcflag_t) or is dependent on a config option for its size (e.g., blk_status_t), use a format specifier of its largest possible type and explicitly cast to it.h]hIf is architecture-dependent for its size (e.g., cycles_t, tcflag_t) or is dependent on a config option for its size (e.g., blk_status_t), use a format specifier of its largest possible type and explicitly cast to it.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjdhhubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjdhhubjv)}(hAprintk("test: latency: %llu cycles\n", (unsigned long long)time);h]hAprintk("test: latency: %llu cycles\n", (unsigned long long)time);}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhK/hjdhhubh)}(h'Reminder: sizeof() returns type size_t.h]h'Reminder: sizeof() returns type size_t.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjdhhubh)}(hThe kernel's printf does not support %n. Floating point formats (%e, %f, %g, %a) are also not recognized, for obvious reasons. Use of any unsupported specifier or length qualifier results in a WARN and early return from vsnprintf().h]hThe kernel’s printf does not support %n. Floating point formats (%e, %f, %g, %a) are also not recognized, for obvious reasons. Use of any unsupported specifier or length qualifier results in a WARN and early return from vsnprintf().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjdhhubeh}(h] integer-typesah ]h"] integer typesah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h Pointer typesh]h Pointer types}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK9ubh)}(hA raw pointer value may be printed with %p which will hash the address before printing. The kernel also supports extended specifiers for printing pointers of different types.h]hA raw pointer value may be printed with %p which will hash the address before printing. The kernel also supports extended specifiers for printing pointers of different types.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjhhubh)}(hSome of the extended specifiers print the data on the given address instead of printing the address itself. In this case, the following error messages might be printed instead of the unreachable information::h]hSome of the extended specifiers print the data on the given address instead of printing the address itself. In this case, the following error messages might be printed instead of the unreachable information:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjhhubjv)}(hm(null) data on plain NULL address (efault) data on invalid address (einval) invalid data on a valid addressh]hm(null) data on plain NULL address (efault) data on invalid address (einval) invalid data on a valid address}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKChjhhubh)}(hhh](h)}(hPlain Pointersh]hPlain Pointers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKHubjv)}(h$%p abcdef12 or 00000000abcdef12h]h$%p abcdef12 or 00000000abcdef12}hj!sbah}(h]h ]h"]h$]h&]jjuh1juhhhKLhjhhubh)}(hX=Pointers printed without a specifier extension (i.e unadorned %p) are hashed to prevent leaking information about the kernel memory layout. This has the added benefit of providing a unique identifier. On 64-bit machines the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it gathers enough entropy.h](hXPointers printed without a specifier extension (i.e unadorned %p) are hashed to prevent leaking information about the kernel memory layout. This has the added benefit of providing a unique identifier. On 64-bit machines the first 32 bits are zeroed. The kernel will print }(hj/hhhNhNubhliteral)}(h ``(ptrval)``h]h(ptrval)}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj/ubh! until it gathers enough entropy.}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubh)}(hXWhen possible, use specialised modifiers such as %pS or %pB (described below) to avoid the need of providing an unhashed address that has to be interpreted post-hoc. If not possible, and the aim of printing the address is to provide more information for debugging, use %p and boot the kernel with the ``no_hash_pointers`` parameter during debugging, which will print all %p addresses unmodified. If you *really* always want the unmodified address, see %px below.h](hX-When possible, use specialised modifiers such as %pS or %pB (described below) to avoid the need of providing an unhashed address that has to be interpreted post-hoc. If not possible, and the aim of printing the address is to provide more information for debugging, use %p and boot the kernel with the }(hjQhhhNhNubj8)}(h``no_hash_pointers``h]hno_hash_pointers}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjQubhR parameter during debugging, which will print all %p addresses unmodified. If you }(hjQhhhNhNubhemphasis)}(h*really*h]hreally}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jkhjQubh3 always want the unmodified address, see %px below.}(hjQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKThjhhubh)}(hIf (and only if) you are printing addresses as a content of a virtual file in e.g. procfs or sysfs (using e.g. seq_printf(), not printk()) read by a userspace process, use the %pK modifier described below instead of %p or %px.h]hIf (and only if) you are printing addresses as a content of a virtual file in e.g. procfs or sysfs (using e.g. seq_printf(), not printk()) read by a userspace process, use the %pK modifier described below instead of %p or %px.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK\hjhhubeh}(h]plain-pointersah ]h"]plain pointersah$]h&]uh1hhjhhhhhKHubh)}(hhh](h)}(hError Pointersh]hError Pointers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKaubjv)}(h%pe -ENOSPCh]h%pe -ENOSPC}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKehjhhubh)}(hFor printing error pointers (i.e. a pointer for which IS_ERR() is true) as a symbolic error name. Error values for which no symbolic name is known are printed in decimal, while a non-ERR_PTR passed as the argument to %pe gets treated as ordinary %p.h]hFor printing error pointers (i.e. a pointer for which IS_ERR() is true) as a symbolic error name. Error values for which no symbolic name is known are printed in decimal, while a non-ERR_PTR passed as the argument to %pe gets treated as ordinary %p.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjhhubeh}(h]error-pointersah ]h"]error pointersah$]h&]uh1hhjhhhhhKaubh)}(hhh](h)}(hSymbols/Function Pointersh]hSymbols/Function Pointers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKmubjv)}(h%pS versatile_init+0x0/0x110 %ps versatile_init %pSR versatile_init+0x9/0x110 (with __builtin_extract_return_addr() translation) %pB prev_fn_of_versatile_init+0x88/0x88h]h%pS versatile_init+0x0/0x110 %ps versatile_init %pSR versatile_init+0x9/0x110 (with __builtin_extract_return_addr() translation) %pB prev_fn_of_versatile_init+0x88/0x88}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKqhjhhubh)}(hThe ``S`` and ``s`` specifiers are used for printing a pointer in symbolic format. They result in the symbol name with (S) or without (s) offsets. If KALLSYMS are disabled then the symbol address is printed instead.h](hThe }(hjhhhNhNubj8)}(h``S``h]hS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh and }(hjhhhNhNubj8)}(h``s``h]hs}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh specifiers are used for printing a pointer in symbolic format. They result in the symbol name with (S) or without (s) offsets. If KALLSYMS are disabled then the symbol address is printed instead.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKxhjhhubh)}(hXThe ``B`` specifier results in the symbol name with offsets and should be used when printing stack backtraces. The specifier takes into consideration the effect of compiler optimisations which may occur when tail-calls are used and marked with the noreturn GCC attribute.h](hThe }(hj!hhhNhNubj8)}(h``B``h]hB}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj!ubhX specifier results in the symbol name with offsets and should be used when printing stack backtraces. The specifier takes into consideration the effect of compiler optimisations which may occur when tail-calls are used and marked with the noreturn GCC attribute.}(hj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK|hjhhubh)}(hIf the pointer is within a module, the module name and optionally build ID is printed after the symbol name with an extra ``b`` appended to the end of the specifier.h](hzIf the pointer is within a module, the module name and optionally build ID is printed after the symbol name with an extra }(hjAhhhNhNubj8)}(h``b``h]hb}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjAubh& appended to the end of the specifier.}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjv)}(hX|%pS versatile_init+0x0/0x110 [module_name] %pSb versatile_init+0x0/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e] %pSRb versatile_init+0x9/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e] (with __builtin_extract_return_addr() translation) %pBb prev_fn_of_versatile_init+0x88/0x88 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]h]hX|%pS versatile_init+0x0/0x110 [module_name] %pSb versatile_init+0x0/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e] %pSRb versatile_init+0x9/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e] (with __builtin_extract_return_addr() translation) %pBb prev_fn_of_versatile_init+0x88/0x88 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]}hjasbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjhhubeh}(h]symbols-function-pointersah ]h"]symbols/function pointersah$]h&]uh1hhjhhhhhKmubh)}(hhh](h)}(h"Probed Pointers from BPF / tracingh]h"Probed Pointers from BPF / tracing}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjwhhhhhKubjv)}(h)%pks kernel string %pus user stringh]h)%pks kernel string %pus user string}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjwhhubh)}(hX}The ``k`` and ``u`` specifiers are used for printing prior probed memory from either kernel memory (k) or user memory (u). The subsequent ``s`` specifier results in printing a string. For direct use in regular vsnprintf() the (k) and (u) annotation is ignored, however, when used out of BPF's bpf_trace_printk(), for example, it reads the memory it is pointing to without faulting.h](hThe }(hjhhhNhNubj8)}(h``k``h]hk}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh and }(hjhhhNhNubj8)}(h``u``h]hu}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubhw specifiers are used for printing prior probed memory from either kernel memory (k) or user memory (u). The subsequent }(hjhhhNhNubj8)}(h``s``h]hs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh specifier results in printing a string. For direct use in regular vsnprintf() the (k) and (u) annotation is ignored, however, when used out of BPF’s bpf_trace_printk(), for example, it reads the memory it is pointing to without faulting.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjwhhubeh}(h] probed-pointers-from-bpf-tracingah ]h"]"probed pointers from bpf / tracingah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hKernel Pointersh]hKernel Pointers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubjv)}(h$%pK 01234567 or 0123456789abcdefh]h$%pK 01234567 or 0123456789abcdef}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjhhubh)}(hFor printing kernel pointers which should be hidden from unprivileged users. The behaviour of %pK depends on the kptr_restrict sysctl - see Documentation/admin-guide/sysctl/kernel.rst for more details.h]hFor printing kernel pointers which should be hidden from unprivileged users. The behaviour of %pK depends on the kptr_restrict sysctl - see Documentation/admin-guide/sysctl/kernel.rst for more details.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThis modifier is *only* intended when producing content of a file read by userspace from e.g. procfs or sysfs, not for dmesg. Please refer to the section about %p above for discussion about how to manage hashing pointers in printk().h](hThis modifier is }(hjhhhNhNubjl)}(h*only*h]honly}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jkhjubh intended when producing content of a file read by userspace from e.g. procfs or sysfs, not for dmesg. Please refer to the section about %p above for discussion about how to manage hashing pointers in printk().}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]kernel-pointersah ]h"]kernel pointersah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hUnmodified Addressesh]hUnmodified Addresses}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hhhhhKubjv)}(h$%px 01234567 or 0123456789abcdefh]h$%px 01234567 or 0123456789abcdef}hjHsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhj7hhubh)}(hXFor printing pointers when you *really* want to print the address. Please consider whether or not you are leaking sensitive information about the kernel memory layout before printing pointers with %px. %px is functionally equivalent to %lx (or %lu). %px is preferred because it is more uniquely grep'able. If in the future we need to modify the way the kernel handles printing pointers we will be better equipped to find the call sites.h](hFor printing pointers when you }(hjVhhhNhNubjl)}(h*really*h]hreally}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1jkhjVubhX want to print the address. Please consider whether or not you are leaking sensitive information about the kernel memory layout before printing pointers with %px. %px is functionally equivalent to %lx (or %lu). %px is preferred because it is more uniquely grep’able. If in the future we need to modify the way the kernel handles printing pointers we will be better equipped to find the call sites.}(hjVhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj7hhubh)}(hXBefore using %px, consider if using %p is sufficient together with enabling the ``no_hash_pointers`` kernel parameter during debugging sessions (see the %p description above). One valid scenario for %px might be printing information immediately before a panic, which prevents any sensitive information to be exploited anyway, and with %px there would be no need to reproduce the panic with no_hash_pointers.h](hPBefore using %px, consider if using %p is sufficient together with enabling the }(hjvhhhNhNubj8)}(h``no_hash_pointers``h]hno_hash_pointers}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjvubhX3 kernel parameter during debugging sessions (see the %p description above). One valid scenario for %px might be printing information immediately before a panic, which prevents any sensitive information to be exploited anyway, and with %px there would be no need to reproduce the panic with no_hash_pointers.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj7hhubeh}(h]unmodified-addressesah ]h"]unmodified addressesah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hPointer Differencesh]hPointer Differences}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubjv)}(h%td 2560 %tx a00h]h%td 2560 %tx a00}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjhhubh)}(hHFor printing the pointer differences, use the %t modifier for ptrdiff_t.h]hHFor printing the pointer differences, use the %t modifier for ptrdiff_t.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjv)}(h@printk("test: difference between pointers: %td\n", ptr2 - ptr1);h]h@printk("test: difference between pointers: %td\n", ptr2 - ptr1);}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjhhubeh}(h]pointer-differencesah ]h"]pointer differencesah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hStruct Resourcesh]hStruct Resources}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubjv)}(hXw%pr [mem 0x60000000-0x6fffffff flags 0x2200] or [mem 0x60000000 flags 0x2200] or [mem 0x0000000060000000-0x000000006fffffff flags 0x2200] [mem 0x0000000060000000 flags 0x2200] %pR [mem 0x60000000-0x6fffffff pref] or [mem 0x60000000 pref] or [mem 0x0000000060000000-0x000000006fffffff pref] [mem 0x0000000060000000 pref]h]hXw%pr [mem 0x60000000-0x6fffffff flags 0x2200] or [mem 0x60000000 flags 0x2200] or [mem 0x0000000060000000-0x000000006fffffff flags 0x2200] [mem 0x0000000060000000 flags 0x2200] %pR [mem 0x60000000-0x6fffffff pref] or [mem 0x60000000 pref] or [mem 0x0000000060000000-0x000000006fffffff pref] [mem 0x0000000060000000 pref]}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjhhubh)}(hFor printing struct resources. The ``R`` and ``r`` specifiers result in a printed resource with (R) or without (r) a decoded flags member. If start is equal to end only print the start value.h](h#For printing struct resources. The }(hjhhhNhNubj8)}(h``R``h]hR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh and }(hjhhhNhNubj8)}(h``r``h]hr}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh specifiers result in a printed resource with (R) or without (r) a decoded flags member. If start is equal to end only print the start value.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hPassed by reference.h]hPassed by reference.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]struct-resourcesah ]h"]struct resourcesah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h"Physical address types phys_addr_th]h"Physical address types phys_addr_t}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhhhhhKubjv)}(h(%pa[p] 0x01234567 or 0x0123456789abcdefh]h(%pa[p] 0x01234567 or 0x0123456789abcdef}hjgsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjVhhubh)}(hFor printing a phys_addr_t type (and its derivatives, such as resource_size_t) which can vary based on build options, regardless of the width of the CPU data path.h]hFor printing a phys_addr_t type (and its derivatives, such as resource_size_t) which can vary based on build options, regardless of the width of the CPU data path.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjVhhubh)}(hPassed by reference.h]hPassed by reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjVhhubeh}(h]"physical-address-types-phys-addr-tah ]h"]"physical address types phys_addr_tah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h Struct Rangeh]h Struct Range}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubjv)}(h[%pra [range 0x0000000060000000-0x000000006fffffff] or [range 0x0000000060000000]h]h[%pra [range 0x0000000060000000-0x000000006fffffff] or [range 0x0000000060000000]}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhKhjhhubh)}(hFor printing struct range. struct range holds an arbitrary range of u64 values. If start is equal to end only print the start value.h]hFor printing struct range. struct range holds an arbitrary range of u64 values. If start is equal to end only print the start value.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hPassed by reference.h]hPassed by reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] struct-rangeah ]h"] struct rangeah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hDMA address types dma_addr_th]hDMA address types dma_addr_t}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubjv)}(h(%pad 0x01234567 or 0x0123456789abcdefh]h(%pad 0x01234567 or 0x0123456789abcdef}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjhhubh)}(hsFor printing a dma_addr_t type which can vary based on build options, regardless of the width of the CPU data path.h]hsFor printing a dma_addr_t type which can vary based on build options, regardless of the width of the CPU data path.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hPassed by reference.h]hPassed by reference.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]dma-address-types-dma-addr-tah ]h"]dma address types dma_addr_tah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hRaw buffer as an escaped stringh]hRaw buffer as an escaped string}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM ubjv)}(h %*pE[achnops]h]h %*pE[achnops]}hj0sbah}(h]h ]h"]h$]h&]jjuh1juhhhM hjhhubh)}(hHFor printing raw buffer as an escaped string. For the following buffer::h]hGFor printing raw buffer as an escaped string. For the following buffer:}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(h1b 62 20 5c 43 07 22 90 0d 5dh]h1b 62 20 5c 43 07 22 90 0d 5d}hjLsbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjhhubh)}(hUA few examples show how the conversion would be done (excluding surrounding quotes)::h]hTA few examples show how the conversion would be done (excluding surrounding quotes):}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(h~%*pE "\eb \C\a"\220\r]" %*pEhp "\x1bb \C\x07"\x90\x0d]" %*pEa "\e\142\040\\\103\a\042\220\r\135"h]h~%*pE "\eb \C\a"\220\r]" %*pEhp "\x1bb \C\x07"\x90\x0d]" %*pEa "\e\142\040\\\103\a\042\220\r\135"}hjhsbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjhhubh)}(hThe conversion rules are applied according to an optional combination of flags (see :c:func:`string_escape_mem` kernel documentation for the details):h](hTThe conversion rules are applied according to an optional combination of flags (see }(hjvhhhNhNubh)}(h:c:func:`string_escape_mem`h]j8)}(hjh]hstring_escape_mem()}(hjhhhNhNubah}(h]h ](xrefcc-funceh"]h$]h&]uh1j7hj~ubah}(h]h ]h"]h$]h&]refdoccore-api/printk-formats refdomainjreftypefunc refexplicitrefwarn reftargetstring_escape_memuh1hhhhMhjvubh' kernel documentation for the details):}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh block_quote)}(h- a - ESCAPE_ANY - c - ESCAPE_SPECIAL - h - ESCAPE_HEX - n - ESCAPE_NULL - o - ESCAPE_OCTAL - p - ESCAPE_NP - s - ESCAPE_SPACE h]h bullet_list)}(hhh](h list_item)}(ha - ESCAPE_ANYh]h)}(hjh]ha - ESCAPE_ANY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hc - ESCAPE_SPECIALh]h)}(hjh]hc - ESCAPE_SPECIAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hh - ESCAPE_HEXh]h)}(hjh]hh - ESCAPE_HEX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hn - ESCAPE_NULLh]h)}(hjh]hn - ESCAPE_NULL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(ho - ESCAPE_OCTALh]h)}(hjh]ho - ESCAPE_OCTAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM"hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h p - ESCAPE_NPh]h)}(hj-h]h p - ESCAPE_NP}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hj+ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hs - ESCAPE_SPACE h]h)}(hs - ESCAPE_SPACEh]hs - ESCAPE_SPACE}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hjBubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjhhubh)}(h!By default ESCAPE_ANY_NP is used.h]h!By default ESCAPE_ANY_NP is used.}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hjhhubh)}(hTESCAPE_ANY_NP is the sane choice for many cases, in particularly for printing SSIDs.h]hTESCAPE_ANY_NP is the sane choice for many cases, in particularly for printing SSIDs.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM(hjhhubh)}(h;If field width is omitted then 1 byte only will be escaped.h]h;If field width is omitted then 1 byte only will be escaped.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM+hjhhubeh}(h]raw-buffer-as-an-escaped-stringah ]h"]raw buffer as an escaped stringah$]h&]uh1hhjhhhhhM ubh)}(hhh](h)}(hRaw buffer as a hex stringh]hRaw buffer as a hex string}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM.ubjv)}(hc%*ph 00 01 02 ... 3f %*phC 00:01:02: ... :3f %*phD 00-01-02- ... -3f %*phN 000102 ... 3fh]hc%*ph 00 01 02 ... 3f %*phC 00:01:02: ... :3f %*phD 00-01-02- ... -3f %*phN 000102 ... 3f}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhM2hjhhubh)}(hFor printing small buffers (up to 64 bytes long) as a hex string with a certain separator. For larger buffers consider using :c:func:`print_hex_dump`.h](h}For printing small buffers (up to 64 bytes long) as a hex string with a certain separator. For larger buffers consider using }(hjhhhNhNubh)}(h:c:func:`print_hex_dump`h]j8)}(hjh]hprint_hex_dump()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1j7hjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjprint_hex_dumpuh1hhhhM7hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM7hjhhubeh}(h]raw-buffer-as-a-hex-stringah ]h"]raw buffer as a hex stringah$]h&]uh1hhjhhhhhM.ubh)}(hhh](h)}(hMAC/FDDI addressesh]hMAC/FDDI addresses}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM<ubjv)}(hw%pM 00:01:02:03:04:05 %pMR 05:04:03:02:01:00 %pMF 00-01-02-03-04-05 %pm 000102030405 %pmR 050403020100h]hw%pM 00:01:02:03:04:05 %pMR 05:04:03:02:01:00 %pMF 00-01-02-03-04-05 %pm 000102030405 %pmR 050403020100}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhM@hjhhubh)}(hFor printing 6-byte MAC/FDDI addresses in hex notation. The ``M`` and ``m`` specifiers result in a printed address with (M) or without (m) byte separators. The default byte separator is the colon (:).h](h specifier to print a compressed IPv6 address as described by }(hj hhhNhNubh)}(h#https://tools.ietf.org/html/rfc5952h]h#https://tools.ietf.org/html/rfc5952}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhhhMthjz hhubh)}(hPassed by reference.h]hPassed by reference.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhjz hhubeh}(h]ipv6-addressesah ]h"]ipv6 addressesah$]h&]uh1hhjhhhhhMhubh)}(hhh](h)}(h9IPv4/IPv6 addresses (generic, with port, flowinfo, scope)h]h9IPv4/IPv6 addresses (generic, with port, flowinfo, scope)}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj" hhhhhM{ubjv)}(h%pIS 1.2.3.4 or 0001:0002:0003:0004:0005:0006:0007:0008 %piS 001.002.003.004 or 00010002000300040005000600070008 %pISc 1.2.3.4 or 1:2:3:4:5:6:7:8 %pISpc 1.2.3.4:12345 or [1:2:3:4:5:6:7:8]:12345 %p[Ii]S[pfschnbl]h]h%pIS 1.2.3.4 or 0001:0002:0003:0004:0005:0006:0007:0008 %piS 001.002.003.004 or 00010002000300040005000600070008 %pISc 1.2.3.4 or 1:2:3:4:5:6:7:8 %pISpc 1.2.3.4:12345 or [1:2:3:4:5:6:7:8]:12345 %p[Ii]S[pfschnbl]}hj3 sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhj" hhubh)}(hFor printing an IP address without the need to distinguish whether it's of type AF_INET or AF_INET6. A pointer to a valid struct sockaddr, specified through ``IS`` or ``iS``, can be passed to this format specifier.h](hFor printing an IP address without the need to distinguish whether it’s of type AF_INET or AF_INET6. A pointer to a valid struct sockaddr, specified through }(hjA hhhNhNubj8)}(h``IS``h]hIS}(hjI hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjA ubh or }(hjA hhhNhNubj8)}(h``iS``h]hiS}(hj[ hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjA ubh), can be passed to this format specifier.}(hjA hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj" hhubh)}(hThe additional ``p``, ``f``, and ``s`` specifiers are used to specify port (IPv4, IPv6), flowinfo (IPv6) and scope (IPv6). Ports have a ``:`` prefix, flowinfo a ``/`` and scope a ``%``, each followed by the actual value.h](hThe additional }(hjs hhhNhNubj8)}(h``p``h]hp}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjs ubh, }(hjs hhhNhNubj8)}(h``f``h]hf}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjs ubh, and }(hjs hhhNhNubj8)}(h``s``h]hs}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjs ubhb specifiers are used to specify port (IPv4, IPv6), flowinfo (IPv6) and scope (IPv6). Ports have a }(hjs hhhNhNubj8)}(h``:``h]h:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjs ubh prefix, flowinfo a }(hjs hhhNhNubj8)}(h``/``h]h/}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjs ubh and scope a }(hjs hhhNhNubj8)}(h``%``h]h%}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjs ubh$, each followed by the actual value.}(hjs hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj" hhubh)}(hXbIn case of an IPv6 address the compressed IPv6 address as described by https://tools.ietf.org/html/rfc5952 is being used if the additional specifier ``c`` is given. The IPv6 address is surrounded by ``[``, ``]`` in case of additional specifiers ``p``, ``f`` or ``s`` as suggested by https://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-07h](hGIn case of an IPv6 address the compressed IPv6 address as described by }(hj hhhNhNubh)}(h#https://tools.ietf.org/html/rfc5952h]h#https://tools.ietf.org/html/rfc5952}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1hhj ubh+ is being used if the additional specifier }(hj hhhNhNubj8)}(h``c``h]hc}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh- is given. The IPv6 address is surrounded by }(hj hhhNhNubj8)}(h``[``h]h[}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh, }(hj hhhNhNubj8)}(h``]``h]h]}(hj, hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh" in case of additional specifiers }(hj hhhNhNubj8)}(h``p``h]hp}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh, }hj sbj8)}(h``f``h]hf}(hjP hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh or }(hj hhhNhNubj8)}(h``s``h]hs}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh as suggested by }(hj hhhNhNubh)}(hGhttps://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-07h]hGhttps://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-07}(hjt hhhNhNubah}(h]h ]h"]h$]h&]refurijv uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj" hhubh)}(hIn case of IPv4 addresses, the additional ``h``, ``n``, ``b``, and ``l`` specifiers can be used as well and are ignored in case of an IPv6 address.h](h*In case of IPv4 addresses, the additional }(hj hhhNhNubj8)}(h``h``h]hh}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh, }(hj hhhNhNubj8)}(h``n``h]hn}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh, }hj sbj8)}(h``b``h]hb}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh, and }(hj hhhNhNubj8)}(h``l``h]hl}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubhK specifiers can be used as well and are ignored in case of an IPv6 address.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj" hhubh)}(hPassed by reference.h]hPassed by reference.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj" hhubh)}(hFurther examples::h]hFurther examples:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj" hhubjv)}(h%pISfc 1.2.3.4 or [1:2:3:4:5:6:7:8]/123456789 %pISsc 1.2.3.4 or [1:2:3:4:5:6:7:8]%1234567890 %pISpfc 1.2.3.4:12345 or [1:2:3:4:5:6:7:8]:12345/123456789h]h%pISfc 1.2.3.4 or [1:2:3:4:5:6:7:8]/123456789 %pISsc 1.2.3.4 or [1:2:3:4:5:6:7:8]%1234567890 %pISpfc 1.2.3.4:12345 or [1:2:3:4:5:6:7:8]:12345/123456789}hj sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhj" hhubeh}(h]4ipv4-ipv6-addresses-generic-with-port-flowinfo-scopeah ]h"]9ipv4/ipv6 addresses (generic, with port, flowinfo, scope)ah$]h&]uh1hhjhhhhhM{ubh)}(hhh](h)}(hUUID/GUID addressesh]hUUID/GUID addresses}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubjv)}(h%pUb 00010203-0405-0607-0809-0a0b0c0d0e0f %pUB 00010203-0405-0607-0809-0A0B0C0D0E0F %pUl 03020100-0504-0706-0809-0a0b0c0e0e0f %pUL 03020100-0504-0706-0809-0A0B0C0E0E0Fh]h%pUb 00010203-0405-0607-0809-0a0b0c0d0e0f %pUB 00010203-0405-0607-0809-0A0B0C0D0E0F %pUl 03020100-0504-0706-0809-0a0b0c0e0e0f %pUL 03020100-0504-0706-0809-0A0B0C0E0E0F}hj" sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhj hhubh)}(hFor printing 16-byte UUID/GUIDs addresses. The additional ``l``, ``L``, ``b`` and ``B`` specifiers are used to specify a little endian order in lower (l) or upper case (L) hex notation - and big endian order in lower (b) or upper case (B) hex notation.h](h:For printing 16-byte UUID/GUIDs addresses. The additional }(hj0 hhhNhNubj8)}(h``l``h]hl}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj0 ubh, }(hj0 hhhNhNubj8)}(h``L``h]hL}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj0 ubh, }(hj0 hhhNhNubj8)}(h``b``h]hb}(hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj0 ubh and }(hj0 hhhNhNubj8)}(h``B``h]hB}(hjn hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj0 ubh specifiers are used to specify a little endian order in lower (l) or upper case (L) hex notation - and big endian order in lower (b) or upper case (B) hex notation.}(hj0 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hrWhere no additional specifiers are used the default big endian order with lower case hex notation will be printed.h]hrWhere no additional specifiers are used the default big endian order with lower case hex notation will be printed.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hPassed by reference.h]hPassed by reference.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]uuid-guid-addressesah ]h"]uuid/guid addressesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(h dentry namesh]h dentry names}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubjv)}(h%pd{,2,3,4} %pD{,2,3,4}h]h%pd{,2,3,4} %pD{,2,3,4}}hj sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhj hhubh)}(hXFor printing dentry name; if we race with :c:func:`d_move`, the name might be a mix of old and new ones, but it won't oops. %pd dentry is a safer equivalent of %s dentry->d_name.name we used to use, %pd prints ``n`` last components. %pD does the same thing for struct file.h](h*For printing dentry name; if we race with }(hj hhhNhNubh)}(h:c:func:`d_move`h]j8)}(hj h]hd_move()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1j7hj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjd_moveuh1hhhhMhj ubh, the name might be a mix of old and new ones, but it won’t oops. %pd dentry is a safer equivalent of %s dentry->d_name.name we used to use, %pd prints }(hj hhhNhNubj8)}(h``n``h]hn}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j7hj ubh; last components. %pD does the same thing for struct file.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hPassed by reference.h]hPassed by reference.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h] dentry-namesah ]h"] dentry namesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hblock_device namesh]hblock_device names}(hj% hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj" hhhhhMubjv)}(h%pg sda, sda1 or loop0p1h]h%pg sda, sda1 or loop0p1}hj3 sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhj" hhubh)}(h+For printing name of block_device pointers.h]h+For printing name of block_device pointers.}(hjA hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj" hhubeh}(h]block-device-namesah ]h"]block_device namesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hstruct va_formath]hstruct va_format}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjW hhhhhMubjv)}(h%pVh]h%pV}hjh sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjW hhubh)}(h`For printing struct va_format structures. These contain a format string and va_list as follows::h]h_For printing struct va_format structures. These contain a format string and va_list as follows:}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjW hhubjv)}(hCstruct va_format { const char *fmt; va_list *va; };h]hCstruct va_format { const char *fmt; va_list *va; };}hj sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjW hhubh)}(h#Implements a "recursive vsnprintf".h]h'Implements a “recursive vsnprintf”.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjW hhubh)}(htDo not use this feature without some mechanism to verify the correctness of the format string and va_list arguments.h]htDo not use this feature without some mechanism to verify the correctness of the format string and va_list arguments.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjW hhubh)}(hPassed by reference.h]hPassed by reference.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjW hhubeh}(h]struct-va-formatah ]h"]struct va_formatah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hDevice tree nodesh]hDevice tree nodes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubjv)}(h %pOF[fnpPcCF]h]h %pOF[fnpPcCF]}hj sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhj hhubh)}(hSFor printing device tree node structures. Default behaviour is equivalent to %pOFf.h]hSFor printing device tree node structures. Default behaviour is equivalent to %pOFf.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(h- f - device node full_name - n - device node name - p - device node phandle - P - device node path spec (name + @unit) - F - device node flags - c - major compatible string - C - full compatible string h]j)}(hhh](j)}(hf - device node full_nameh]h)}(hj h]hf - device node full_name}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hn - device node nameh]h)}(hjh]hn - device node name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hp - device node phandleh]h)}(hj(h]hp - device node phandle}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(h(P - device node path spec (name + @unit)h]h)}(hj?h]h(P - device node path spec (name + @unit)}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hF - device node flagsh]h)}(hjVh]hF - device node flags}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjTubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hc - major compatible stringh]h)}(hjmh]hc - major compatible string}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjkubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hC - full compatible string h]h)}(hC - full compatible stringh]hC - full compatible string}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]j`jauh1jhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhhhMhj hhubh)}(h2The separator when using multiple arguments is ':'h]h6The separator when using multiple arguments is ‘:’}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h Examples::h]h Examples:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubjv)}(hX`%pOF /foo/bar@0 - Node full name %pOFf /foo/bar@0 - Same as above %pOFfp /foo/bar@0:10 - Node full name + phandle %pOFfcF /foo/bar@0:foo,device:--P- - Node full name + major compatible string + node flags D - dynamic d - detached P - Populated B - Populated bush]hX`%pOF /foo/bar@0 - Node full name %pOFf /foo/bar@0 - Same as above %pOFfp /foo/bar@0:10 - Node full name + phandle %pOFfcF /foo/bar@0:foo,device:--P- - Node full name + major compatible string + node flags D - dynamic d - detached P - Populated B - Populated bus}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhMhj hhubh)}(hPassed by reference.h]hPassed by reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]device-tree-nodesah ]h"]device tree nodesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hFwnode handlesh]hFwnode handles}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubjv)}(h%pfw[fP]h]h%pfw[fP]}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhM hjhhubh)}(hFor printing information on fwnode handles. The default is to print the full node name, including the path. The modifiers are functionally equivalent to %pOF above.h]hFor printing information on fwnode handles. The default is to print the full node name, including the path. The modifiers are functionally equivalent to %pOF above.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubj)}(hr- f - full name of the node, including the path - P - the name of the node including an address (if there is one) h]j)}(hhh](j)}(h-f - full name of the node, including the pathh]h)}(hjh]h-f - full name of the node, including the path}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h@P - the name of the node including an address (if there is one) h]h)}(h?P - the name of the node including an address (if there is one)h]h?P - the name of the node including an address (if there is one)}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj1ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j`jauh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjhhubh)}(hExamples (ACPI)::h]hExamples (ACPI):}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(h|%pfwf \_SB.PCI0.CIO2.port@1.endpoint@0 - Full node name %pfwP endpoint@0 - Node nameh]h|%pfwf \_SB.PCI0.CIO2.port@1.endpoint@0 - Full node name %pfwP endpoint@0 - Node name}hjcsbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjhhubh)}(hExamples (OF)::h]hExamples (OF):}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(h%pfwf /ocp@68000000/i2c@48072000/camera@10/port/endpoint - Full name %pfwP endpoint - Node nameh]h%pfwf /ocp@68000000/i2c@48072000/camera@10/port/endpoint - Full name %pfwP endpoint - Node name}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjhhubeh}(h]fwnode-handlesah ]h"]fwnode handlesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(h Time and dateh]h Time and date}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubjv)}(h%pt[RT] YYYY-mm-ddTHH:MM:SS %pt[RT]s YYYY-mm-dd HH:MM:SS %pt[RT]d YYYY-mm-dd %pt[RT]t HH:MM:SS %pt[RT][dt][r][s]h]h%pt[RT] YYYY-mm-ddTHH:MM:SS %pt[RT]s YYYY-mm-dd HH:MM:SS %pt[RT]d YYYY-mm-dd %pt[RT]t HH:MM:SS %pt[RT][dt][r][s]}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhM"hjhhubh)}(h.For printing date and time as represented by::h]h-For printing date and time as represented by:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM(hjhhubjv)}(h-R struct rtc_time structure T time64_t typeh]h-R struct rtc_time structure T time64_t type}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhM*hjhhubh)}(hin human readable format.h]hin human readable format.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hjhhubh)}(hjBy default year will be incremented by 1900 and month by 1. Use %pt[RT]r (raw) to suppress this behaviour.h]hjBy default year will be incremented by 1900 and month by 1. Use %pt[RT]r (raw) to suppress this behaviour.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM/hjhhubh)}(hThe %pt[RT]s (space) will override ISO 8601 separator by using ' ' (space) instead of 'T' (Capital T) between date and time. It won't have any effect when date or time is omitted.h]hThe %pt[RT]s (space) will override ISO 8601 separator by using ‘ ‘ (space) instead of ‘T’ (Capital T) between date and time. It won’t have any effect when date or time is omitted.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM2hjhhubh)}(hPassed by reference.h]hPassed by reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjhhubeh}(h] time-and-dateah ]h"] time and dateah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(h struct clkh]h struct clk}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM9ubjv)}(h%pC pll1 %pCn pll1h]h%pC pll1 %pCn pll1}hj!sbah}(h]h ]h"]h$]h&]jjuh1juhhhM=hjhhubh)}(hFor printing struct clk structures. %pC and %pCn print the name of the clock (Common Clock Framework) or a unique 32-bit ID (legacy clock framework).h]hFor printing struct clk structures. %pC and %pCn print the name of the clock (Common Clock Framework) or a unique 32-bit ID (legacy clock framework).}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@hjhhubh)}(hPassed by reference.h]hPassed by reference.}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChjhhubeh}(h] struct-clkah ]h"] struct clkah$]h&]uh1hhjhhhhhM9ubh)}(hhh](h)}(h7bitmap and its derivatives such as cpumask and nodemaskh]h7bitmap and its derivatives such as cpumask and nodemask}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShhhhhMFubjv)}(h%*pb 0779 %*pbl 0,3-6,8-10h]h%*pb 0779 %*pbl 0,3-6,8-10}hjdsbah}(h]h ]h"]h$]h&]jjuh1juhhhMJhjShhubh)}(hFor printing bitmap and its derivatives such as cpumask and nodemask, %*pb outputs 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.h]hFor printing bitmap and its derivatives such as cpumask and nodemask, %*pb outputs 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.%.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhjShhubh)}(hThe field width is passed by value, the bitmap is passed by reference. Helper macros cpumask_pr_args() and nodemask_pr_args() are available to ease printing cpumask and nodemask.h]hThe field width is passed by value, the bitmap is passed by reference. Helper macros cpumask_pr_args() and nodemask_pr_args() are available to ease printing cpumask and nodemask.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhjShhubeh}(h]7bitmap-and-its-derivatives-such-as-cpumask-and-nodemaskah ]h"]7bitmap and its derivatives such as cpumask and nodemaskah$]h&]uh1hhjhhhhhMFubh)}(hhh](h)}(h0Flags bitfields such as page flags and gfp_flagsh]h0Flags bitfields such as page flags and gfp_flags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMVubjv)}(h%pGp 0x17ffffc0002036(referenced|uptodate|lru|active|private|node=0|zone=2|lastcpupid=0x1fffff) %pGg GFP_USER|GFP_DMA32|GFP_NOWARN %pGv read|exec|mayread|maywrite|mayexec|denywriteh]h%pGp 0x17ffffc0002036(referenced|uptodate|lru|active|private|node=0|zone=2|lastcpupid=0x1fffff) %pGg GFP_USER|GFP_DMA32|GFP_NOWARN %pGv read|exec|mayread|maywrite|mayexec|denywrite}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhMZhjhhubh)}(hFor printing flags bitfields as a collection of symbolic constants that would construct the value. The type of flags is given by the third character. Currently supported are:h]hFor printing flags bitfields as a collection of symbolic constants that would construct the value. The type of flags is given by the third character. Currently supported are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hjhhubj)}(h- p - [p]age flags, expects value of type (``unsigned long *``) - v - [v]ma_flags, expects value of type (``unsigned long *``) - g - [g]fp_flags, expects value of type (``gfp_t *``) h]j)}(hhh](j)}(h=p - [p]age flags, expects value of type (``unsigned long *``)h]h)}(hjh](h)p - [p]age flags, expects value of type (}(hjhhhNhNubj8)}(h``unsigned long *``h]hunsigned long *}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjubh)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMbhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hThe flag names and print order depends on the particular type.h]h>The flag names and print order depends on the particular type.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMfhjhhubh)}(hNote that this format should not be used directly in the :c:func:`TP_printk()` part of a tracepoint. Instead, use the show_*_flags() functions from .h](h9Note that this format should not be used directly in the }(hj`hhhNhNubh)}(h:c:func:`TP_printk()`h]j8)}(hjjh]h TP_printk()}(hjlhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1j7hjhubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnj TP_printkuh1hhhhMhhj`ubh_ part of a tracepoint. Instead, use the show_*_flags() functions from .}(hj`hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhhjhhubh)}(hPassed by reference.h]hPassed by reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhjhhubeh}(h]0flags-bitfields-such-as-page-flags-and-gfp-flagsah ]h"]0flags bitfields such as page flags and gfp_flagsah$]h&]uh1hhjhhhhhMVubh)}(hhh](h)}(hNetwork device featuresh]hNetwork device features}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMoubjv)}(h%pNF 0x000000000000c000h]h%pNF 0x000000000000c000}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhMshjhhubh)}(hFor printing netdev_features_t.h]hFor printing netdev_features_t.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhjhhubh)}(hPassed by reference.h]hPassed by reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhjhhubeh}(h]network-device-featuresah ]h"]network device featuresah$]h&]uh1hhjhhhhhMoubh)}(hhh](h)}(h'V4L2 and DRM FourCC code (pixel format)h]h'V4L2 and DRM FourCC code (pixel format)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMzubjv)}(h%p4cch]h%p4cc}hjsbah}(h]h ]h"]h$]h&]jjuh1juhhhM~hjhhubh)}(hlPrint a FourCC code used by V4L2 or DRM, including format endianness and its numerical value as hexadecimal.h]hlPrint a FourCC code used by V4L2 or DRM, including format endianness and its numerical value as hexadecimal.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hPassed by reference.h]hPassed by reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h Examples::h]h Examples:}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjv)}(ht%p4cc BG12 little-endian (0x32314742) %p4cc Y10 little-endian (0x20303159) %p4cc NV12 big-endian (0xb231564e)h]ht%p4cc BG12 little-endian (0x32314742) %p4cc Y10 little-endian (0x20303159) %p4cc NV12 big-endian (0xb231564e)}hj3sbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjhhubeh}(h]%v4l2-and-drm-fourcc-code-pixel-formatah ]h"]'v4l2 and drm fourcc code (pixel format)ah$]h&]uh1hhjhhhhhMzubh)}(hhh](h)}(hRusth]hRust}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhhhhhMubjv)}(h%pAh]h%pA}hjZsbah}(h]h ]h"]h$]h&]jjuh1juhhhMhjIhhubh)}(hcOnly intended to be used from Rust code to format ``core::fmt::Arguments``. Do *not* use it from C.h](h2Only intended to be used from Rust code to format }(hjhhhhNhNubj8)}(h``core::fmt::Arguments``h]hcore::fmt::Arguments}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1j7hjhubh. Do }(hjhhhhNhNubjl)}(h*not*h]hnot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jkhjhubh use it from C.}(hjhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjIhhubeh}(h]rustah ]h"]rustah$]h&]uh1hhjhhhhhMubeh}(h] pointer-typesah ]h"] pointer typesah$]h&]uh1hhhhhhhhK9ubh)}(hhh](h)}(hThanksh]hThanks}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hyIf you add other %p extensions, please extend with one or more test cases, if at all feasible.h]hyIf you add other %p extensions, please extend with one or more test cases, if at all feasible.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h-Thank you for your cooperation and attention.h]h-Thank you for your cooperation and attention.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]thanksah ]h"]thanksah$]h&]uh1hhhhhhhhMubeh}(h])how-to-get-printk-format-specifiers-rightah ]h"])how to get printk format specifiers rightah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}h]hasnameids}(jjj]hjjjjjjjjjtjqjjj4j1jjjjjSjPjjjjjjjjjjjjjw jt j j j j j j j j jT jQ j j jjjjj j jPjMjjjjjjjFjCjjjju nametypes}(jj]jjjjjtjj4jjjSjjjjjjjw j j j j jT j jjj jPjjjjFjjuh}(jhhhjjdjjjjjjjqjjjwj1jjj7jjjPjjjVjjjjjjjjjjjt jj jz j j" j j j j jQ j" j jW jj jjj jjMjjjSjjjjjCjjjIjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h7Hyperlink target "printk-specifiers" is not referenced.}hjtsbah}(h]h ]h"]h$]h&]uh1hhjqubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1jouba transformerN include_log] decorationNhhub.