[Intel-gfx] [PATCH 4/4] lib/hexdump.c: Allow multiple groups to be separated by lines '|'

Alastair D'Silva alastair at d-silva.org
Wed Apr 10 09:52:58 UTC 2019

> -----Original Message-----
> From: David Laight <David.Laight at ACULAB.COM>
> Sent: Wednesday, 10 April 2019 6:45 PM
> To: 'Alastair D'Silva' <alastair at au1.ibm.com>; alastair at d-silva.org
> Cc: Jani Nikula <jani.nikula at linux.intel.com>; Joonas Lahtinen
> <joonas.lahtinen at linux.intel.com>; Rodrigo Vivi <rodrigo.vivi at intel.com>;
> David Airlie <airlied at linux.ie>; Daniel Vetter <daniel at ffwll.ch>; Karsten Keil
> <isdn at linux-pingi.de>; Jassi Brar <jassisinghbrar at gmail.com>; Tom Lendacky
> <thomas.lendacky at amd.com>; David S. Miller <davem at davemloft.net>;
> Jose Abreu <Jose.Abreu at synopsys.com>; Kalle Valo
> <kvalo at codeaurora.org>; Stanislaw Gruszka <sgruszka at redhat.com>;
> Benson Leung <bleung at chromium.org>; Enric Balletbo i Serra
> <enric.balletbo at collabora.com>; James E.J. Bottomley
> <jejb at linux.ibm.com>; Martin K. Petersen <martin.petersen at oracle.com>;
> Greg Kroah-Hartman <gregkh at linuxfoundation.org>; Alexander Viro
> <viro at zeniv.linux.org.uk>; Petr Mladek <pmladek at suse.com>; Sergey
> Senozhatsky <sergey.senozhatsky at gmail.com>; Steven Rostedt
> <rostedt at goodmis.org>; Andrew Morton <akpm at linux-foundation.org>;
> intel-gfx at lists.freedesktop.org; dri-devel at lists.freedesktop.org; linux-
> kernel at vger.kernel.org; netdev at vger.kernel.org;
> ath10k at lists.infradead.org; linux-wireless at vger.kernel.org; linux-
> scsi at vger.kernel.org; linux-fbdev at vger.kernel.org;
> devel at driverdev.osuosl.org; linux-fsdevel at vger.kernel.org
> Subject: RE: [PATCH 4/4] lib/hexdump.c: Allow multiple groups to be
> separated by lines '|'
> From: Alastair D'Silva
> > Sent: 10 April 2019 04:17
> > 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
> > buf:00000010: 00000000 00000002|00000000 00000000  ........|........
> Ugg, that is just horrid.
> It is enough to add an extra space if you really need the columns to be more
> easily counted.

I did consider that, but it would be a more invasive change, as the buffer length required would differ based on the flags.
> I'm not even sure that is needed if you are printing 32bit words.
> OTOH 32bit words makes 64bit values really stupid on LE systems.
> Bytes with extra spaces every 4 bytes is the format I prefer even for long
> lines.
> Oh, and if you are using hexdump() a lot you want a version that never uses
> snprintf().
> 	David
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes,
> MK1 1PT, UK Registration No: 1397386 (Wales)
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com

More information about the Intel-gfx mailing list