Thread (29 messages) 29 messages, 7 authors, 2019-04-15

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

From: Alastair D'Silva <hidden>
Date: 2019-04-10 09:53:34
Also in: dri-devel, intel-gfx, linux-fsdevel, linux-scsi, linux-wireless, lkml, netdev

-----Original Message-----
From: David Laight <redacted>
Sent: Wednesday, 10 April 2019 6:45 PM
To: 'Alastair D'Silva' <redacted>; alastair@d-silva.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>; Joonas Lahtinen
[off-list ref]; Rodrigo Vivi [off-list ref];
David Airlie [off-list ref]; Daniel Vetter [off-list ref]; Karsten Keil
[off-list ref]; Jassi Brar [off-list ref]; Tom Lendacky
[off-list ref]; David S. Miller [off-list ref];
Jose Abreu [off-list ref]; Kalle Valo
[off-list ref]; Stanislaw Gruszka [off-list ref];
Benson Leung [off-list ref]; Enric Balletbo i Serra
[off-list ref]; James E.J. Bottomley
[off-list ref]; Martin K. Petersen [off-list ref];
Greg Kroah-Hartman [off-list ref]; Alexander Viro
[off-list ref]; Petr Mladek [off-list ref]; Sergey
Senozhatsky [off-list ref]; Steven Rostedt
[off-list ref]; Andrew Morton [off-list ref];
intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
kernel@vger.kernel.org; netdev@vger.kernel.org;
ath10k@lists.infradead.org; linux-wireless@vger.kernel.org; linux-
scsi@vger.kernel.org; linux-fbdev@vger.kernel.org;
devel@driverdev.osuosl.org; linux-fsdevel@vger.kernel.org
Subject: RE: [PATCH 4/4] lib/hexdump.c: Allow multiple groups to be
separated by lines '|'

From: Alastair D'Silva
quoted
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()
quoted
to print vertical lines to separate every N groups of bytes.

eg.
buf:00000000: 454d414e 43415053|4e495f45 00584544
NAMESPAC|E_INDEX.
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help