[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c364c36338d385eba60c523828ad8995c792ae4d.camel@perches.com>
Date: Mon, 24 Jun 2019 22:37:03 -0700
From: Joe Perches <joe@...ches.com>
To: Alastair D'Silva <alastair@....ibm.com>, alastair@...ilva.org
Cc: Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Dan Carpenter <dan.carpenter@...cle.com>,
Karsten Keil <isdn@...ux-pingi.de>,
Jassi Brar <jassisinghbrar@...il.com>,
Tom Lendacky <thomas.lendacky@....com>,
"David S. Miller" <davem@...emloft.net>,
Jose Abreu <Jose.Abreu@...opsys.com>,
Kalle Valo <kvalo@...eaurora.org>,
Stanislaw Gruszka <sgruszka@...hat.com>,
Benson Leung <bleung@...omium.org>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
David Laight <David.Laight@...LAB.COM>,
Andrew Morton <akpm@...ux-foundation.org>,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
ath10k@...ts.infradead.org, linux-wireless@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-fbdev@...r.kernel.org,
devel@...verdev.osuosl.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v4 5/7] lib/hexdump.c: Allow multiple groups to be
separated by lines '|'
On Tue, 2019-06-25 at 13:17 +1000, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair@...ilva.org>
>
> With the wider display format, it can become hard to identify how many
> bytes into the line you are looking at.
>
> The patch adds new flags to hex_dump_to_buffer() and print_hex_dump() to
> print vertical lines to separate every N groups of bytes.
>
> eg.
> buf:00000000: 454d414e 43415053|4e495f45 00584544 NAMESPAC|E_INDEX.
> buf:00000010: 00000000 00000002|00000000 00000000 ........|........
>
> Signed-off-by: Alastair D'Silva <alastair@...ilva.org>
> ---
> include/linux/printk.h | 3 +++
> lib/hexdump.c | 59 ++++++++++++++++++++++++++++++++++++------
> 2 files changed, 54 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/printk.h b/include/linux/printk.h
[]
> @@ -485,6 +485,9 @@ enum {
>
> #define HEXDUMP_ASCII BIT(0)
> #define HEXDUMP_SUPPRESS_REPEATED BIT(1)
> +#define HEXDUMP_2_GRP_LINES BIT(2)
> +#define HEXDUMP_4_GRP_LINES BIT(3)
> +#define HEXDUMP_8_GRP_LINES BIT(4)
These aren't really bits as only one value should be set
as 8 overrides 4 and 4 overrides 2.
I would also expect this to be a value of 2 in your above
example, rather than 8. It's described as groups not bytes.
The example is showing a what would normally be a space ' '
separator as a vertical bar '|' every 2nd grouping.
Powered by blists - more mailing lists