Re: [PATCH v2 1/3] page-types: learn to describe flags directlyfrom command line

From: Wu Fengguang
Date: Thu Nov 05 2009 - 21:14:05 EST


On Fri, Nov 06, 2009 at 04:21:16AM +0800, Alex Chiang wrote:
> From: Wu Fengguang <fengguang.wu@xxxxxxxxx>
>
> Teach page-types to describe page flags directly from the command
> line.
>
> Why is this useful? For instance, if you're using memory hotplug
> and see this in /var/log/messages:
>
> kernel: removing from LRU failed 3836dd0/1/1e00000000000010
>
> It would be nice to decode those page flags without staring at
> the source.
>
> Example usage and output:
>
> # Documentation/vm/page-types -d 0x10
> 0x0000000000000010 ____D_____________________________ dirty
>
> # Documentation/vm/page-types -d anon
> 0x0000000000001000 ____________a_____________________ anonymous
>
> # Documentation/vm/page-types -d anon,0x10
> 0x0000000000001010 ____D_______a_____________________ dirty,anonymous

Good examples, thanks!

Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>

> [achiang@xxxxxx: documentation]
> Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>
> Cc: Haicheng Li <haicheng.li@xxxxxxxxx>
> Signed-off-by: Alex Chiang <achiang@xxxxxx>
> ---
>
> Documentation/vm/page-types.c | 21 ++++++++++++++++++++-
> 1 files changed, 20 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
> index 3ec4f2a..a93c28e 100644
> --- a/Documentation/vm/page-types.c
> +++ b/Documentation/vm/page-types.c
> @@ -674,6 +674,7 @@ static void usage(void)
> printf(
> "page-types [options]\n"
> " -r|--raw Raw mode, for kernel developers\n"
> +" -d|--describe flags Describe flags\n"

"Decode flags number; Encode flags name"?

Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/