Re: [PATCH] printk-formats.txt documentation update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Great! Thanks for the help.

On 10 June 2011 18:50, Randy Dunlap <rdunlap@xxxxxxxxxxxx> wrote:
> On Thu, Â9 Jun 2011 22:24:48 +0100 Andrew Murray wrote:
>
>> From: Andrew Murray <amurray@xxxxxxxxxxxxxx>
>>
>> This patch updates the incomplete documentation concerning the printk
>> extended format specifiers
>>
>> Signed-off-by: Andrew Murray <amurray@xxxxxxxxxxxxxx>
>
> Applied with minor tweaks (including dropping trailing whitespace).
>
> Thanks.
>
>> ---
>> ÂDocumentation/printk-formats.txt | Â119 +++++++++++++++++++++++++++++++++++++-
>> Â1 files changed, 117 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
>> index 1b5a5dd..6455e5b 100644
>> --- a/Documentation/printk-formats.txt
>> +++ b/Documentation/printk-formats.txt
>> @@ -9,7 +9,121 @@ If variable is of Type, Â Â Â Â Â Â use printk format specifier:
>>        size_t         Â%zu or %zx
>>        ssize_t         %zd or %zx
>>
>> -Raw pointer value SHOULD be printed with %p.
>> +Raw pointer value SHOULD be printed with %p. The kernel supports
>> +the following extended format specifiers for pointer types:
>> +
>> +Symbols/Function Pointers:
>> +
>> + Â Â %pF Â Â versatile_init+0x0/0x110
>> +   %pf   versatile_init
>> + Â Â %pS Â Â versatile_init+0x0/0x110
>> +   %ps   versatile_init
>> + Â Â %pB Â Â prev_fn_of_versatile_init+0x88/0x88
>> +
>> + Â Â For printing symbols and function pointers. The 'S' and 's' specifiers
>> + Â Â result in the symbol name with ('S') or without ('s') offsets. Where
>> + Â Â this is used on a kernel without KALLSYMS - the symbol address is
>> + Â Â printed instead.
>> +
>> + Â Â The '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-call's are used and marked with the noreturn GCC attribute.
>> +
>> + Â Â On ia64, ppc64 and parisc64 architectures function pointers are
>> + Â Â actually function descriptors which must first be resolved. The 'F' and
>> + Â Â 'f' specifiers perform this resolution and then provide the same
>> + Â Â functionality as the 'S' and 's' specifiers.
>> +
>> +Kernel Pointers:
>> +
>> + Â Â %pK Â Â 0x01234567 or 0x0123456789abcdef
>> +
>> + Â Â For printing kernel pointers which should be hidden from unprivileged
>> + Â Â users. The behaviour of %pK depends on the kptr_restrict sysctl - see
>> + Â Â Documentation/sysctl/kernel.txt for more details.
>> +
>> +Struct Resources:
>> +
>> +   %pr   [mem 0x60000000-0x6fffffff flags 0x2200] or
>> + Â Â Â Â Â Â [mem 0x0000000060000000-0x000000006fffffff flags 0x2200]
>> + Â Â %pR Â Â [mem 0x60000000-0x6fffffff pref] or
>> + Â Â Â Â Â Â [mem 0x0000000060000000-0x000000006fffffff pref]
>> +
>> + Â Â For printing struct resources. The 'R' and 'r' specifiers result in a
>> + Â Â printed resource with ('R') or without ('r') a decoded flags member.
>> +
>> +MAC/FDDI addresses:
>> +
>> + Â Â %pM Â Â 00:01:02:03:04:05
>> + Â Â %pMF Â Â00-01-02-03-04-05
>> +   %pm   000102030405
>> +
>> + Â Â For 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 (':').
>> +
>> + Â Â Where FDDI addresses are concerned the 'F' specifier can be used after
>> + Â Â the 'M' specifier to use dash ('-') separators instead of the default
>> + Â Â separator.
>> +
>> +IPv4 addresses:
>> +
>> + Â Â %pI4 Â Â1.2.3.4
>> + Â Â %pi4 Â Â001.002.003.004
>> + Â Â %p[Ii][hnbl]
>> +
>> + Â Â For printing IPv4 dot-separated decimal addresses. The 'I4' and 'i4'
>> + Â Â specifiers result in a printed address with ('i4') or without ('I4')
>> + Â Â leading zeros.
>> +
>> + Â Â The additional 'h', 'n', 'b', and 'l' specifiers are used to specify
>> + Â Â host, network, big or little endian order addresses respectively. Where
>> + Â Â no specifier is provided the default network/big endian order is used.
>> +
>> +IPv6 addresses:
>> +
>> + Â Â %pI6 Â Â0001:0002:0003:0004:0005:0006:0007:0008
>> + Â Â %pi6 Â Â00010002000300040005000600070008
>> +   %pI6c  1:2:3:4:5:6:7:8
>> +
>> + Â Â For printing IPv6 network-order 16-bit hex addresses. The 'I6' and 'i6'
>> + Â Â specifiers result in a printed address with ('I6') or without ('i6')
>> + Â Â colon-separators. Leading zeros are always used.
>> +
>> + Â Â The additional 'c' specifier can be used with the 'I' specifier to
>> + Â Â print a compressed IPv6 address as described by
>> + Â Â http://tools.ietf.org/html/rfc5952
>> +
>> +UUID/GUID addresses:
>> +
>> +   %pUb  Â00010203-0405-0607-0809-0a0b0c0d0e0f
>> + Â Â %pUB Â Â00010203-0405-0607-0809-0A0B0C0D0E0F
>> +   %pUl  Â03020100-0504-0706-0809-0a0b0c0e0e0f
>> + Â Â %pUL Â Â03020100-0504-0706-0809-0A0B0C0E0E0F
>> +
>> + Â Â For 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 characters - and big endian order
>> + Â Â in lower ('b') or upper case ('B') hex characters.
>> +
>> + Â Â Where no additional specifiers are used the default little endian
>> + Â Â order with lower case hex characters will be printed.
>> +
>> +struct va_format:
>> +
>> + Â Â %pV
>> +
>> + Â Â For printing struct va_format structures. These contain a format string
>> + Â Â and va_list as follows:
>> +
>> + Â Â struct va_format {
>> + Â Â Â Â Â Â const char *fmt;
>> + Â Â Â Â Â Â va_list *va;
>> + Â Â };
>> +
>> + Â Â Do not use this feature without some mechanism to verify the
>> + Â Â correctness of the format string and va_list arguments.
>>
>> Âu64 SHOULD be printed with %llu/%llx, (unsigned long long):
>>
>> @@ -32,4 +146,5 @@ Reminder: sizeof() result is of type size_t.
>> ÂThank you for your cooperation and attention.
>>
>>
>> -By Randy Dunlap <rdunlap@xxxxxxxxxxxx>
>> +By Randy Dunlap <rdunlap@xxxxxxxxxxxx> and
>> +Andrew Murray <amurray@xxxxxxxxxxxxxx>
>> --
>> 1.7.4.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html
>
>
> ---
> ~Randy
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Gstreamer Embedded]     [Linux MMC Devel]     [U-Boot V2]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux OMAP]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux