All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Murray <amurray@mpcdata.com>
Cc: Wolfram Sang <w.sang@pengutronix.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-embedded@vger.kernel.org,
	linux kernel <linux-kernel@vger.kernel.org>,
	trivial@kernel.org, rdunlap@xenotime.net
Subject: Re: [PATCH] printk-formats.txt documentation update
Date: Mon, 07 Feb 2011 11:33:25 -0800	[thread overview]
Message-ID: <1297107205.17359.61.camel@Joe-Laptop> (raw)
In-Reply-To: <AANLkTi=zbmf6QQ2qgv6jf_SJ_GwF=8XPW4CCs-9AJ16B@mail.gmail.com>

On Mon, 2011-02-07 at 18:12 +0000, Andrew Murray wrote:
> On 7 February 2011 09:29, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > On Sun, Feb 06, 2011 at 04:23:09PM +0000, Andrew Murray wrote:
> >> +
> >> +     For printing kernel pointers which should be hidden from unprivileged
> >> +     users. The behaviour of %pK depends on the kptr_resrict sysctl - see
> >
> > Typo: Should be kptr_restrict.
> Updated patch:

trivia:

> diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
[]
> +Kernel Pointers:
> +
> +	%pK	0x0

Bad example, leading zeros are emitted.

	%pK	0x01234567 or 0x01234567890abcdef

depending on 32/64 bit. For 2.6.38, output should be 0x00000000
for a 0 if kptr_restrict is set, "(null)" or value otherwise.

> +	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]
> +	%pR	[mem 0x60000000-0x6fffffff pref]
> +
> +	For printing struct resources. The 'R' and 'r' specifiers result in a
> +	printed resource with ('R') or without ('r') a decoded flags member.

Same issue, mem resources are printed using sizeof(resource_size_t) * 2

> +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/draft-ietf-6man-text-addr-representation-00.

It's probably better to use:

	http://tools.ietf.org/html/rfc5952

> +
> +UUID/GUID addresses:
> +
> +	%pU	00010203-0506-0708-090a-0b0c0d0e0fff

What happened to 04?

It's probably easier/simpler to just show all possible
output styles.  Assuming an in memory incrementing
16 byte array, output is:

	%pU	00010203-0405-0607-08090a0b0c0d0e0f
	
> +	%pU[bBlL]

	%pUb	00010203-0405-0607-08090a0b0c0d0e0f
	%pUB	00010203-0405-0607-08090A0B0C0D0E0F
	%pUl	03020100-0504-0706-08090a0b0c0d0e0f
	%pUL	03020100-0504-0706-08090A0B0E0D0E0F

> +	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_lost *va;

va_list


  reply	other threads:[~2011-02-07 19:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-06  0:15 [PATCH] printk-formats.txt documentation update Andrew Murray
2011-02-06  0:27 ` Tim Bird
2011-02-06  0:37 ` Joe Perches
2011-02-06 10:07   ` Andrew Murray
2011-02-06 10:16 ` Geert Uytterhoeven
2011-02-06 16:14   ` Andrew Murray
2011-02-06 16:23     ` Andrew Murray
2011-02-07  9:29       ` Wolfram Sang
2011-02-07 18:12         ` Andrew Murray
2011-02-07 19:33           ` Joe Perches [this message]
2011-02-11  8:15             ` Andrew Murray
2011-02-11  8:15               ` Andrew Murray
2011-06-09 17:33               ` [PATCH] Revised patch Andrew Murray
2011-06-09 17:40                 ` Joe Perches
2011-06-09 17:47                   ` Namhyung Kim
2011-06-09 17:47                     ` Namhyung Kim
2011-06-09 17:48                     ` Andrew Murray
2011-06-09 18:04                       ` [PATCH] printk-formats.txt documentation update Andrew Murray
2011-06-09 18:20                         ` Namhyung Kim
2011-06-09 18:20                           ` Namhyung Kim
2011-06-09 18:55                           ` Andrew Murray
2011-06-09 19:45                             ` Randy Dunlap
2011-06-09 21:24                               ` Andrew Murray
2011-06-09 21:51                                 ` Randy Dunlap
2011-06-09 22:00                                   ` Joe Perches
2011-06-09 22:21                                     ` Andrew Murray
2011-06-09 22:37                                     ` Randy Dunlap
2011-06-09 22:53                                       ` Joe Perches
2011-06-09 22:57                                         ` Randy Dunlap
2011-06-10 17:50                                 ` Randy Dunlap
2011-06-10 17:56                                   ` Andrew Murray
2011-06-09 18:23                         ` [PATCH] vsprintf: Update %pI6c to not compress a single 0 Joe Perches
2011-06-09 17:47                 ` [PATCH] Revised patch Randy Dunlap
2011-06-09 17:53                   ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1297107205.17359.61.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=amurray@mpcdata.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=trivial@kernel.org \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.