All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] hexdump: minimize the output width of address and offset
@ 2023-08-11  7:49 thunder.leizhen
  2023-08-11  7:49 ` [PATCH v3 1/2] hexdump: minimize the output width of the offset thunder.leizhen
  2023-08-11  7:49 ` [PATCH v3 2/2] hexdump: add a new dump prefix DUMP_PREFIX_CUSTOM thunder.leizhen
  0 siblings, 2 replies; 9+ messages in thread
From: thunder.leizhen @ 2023-08-11  7:49 UTC (permalink / raw)
  To: Petr Mladek, Sergey Senozhatsky, Steven Rostedt, John Ogness,
	linux-kernel
  Cc: Zhen Lei, Randy Dunlap

From: Zhen Lei <thunder.leizhen@huawei.com>

v2 --> v3:
Replace DUMP_PREFIX_ADDRESS_LOW16 with DUMP_PREFIX_CUSTOM. Let the user to
specify the format string.

v1 --> v2:
1. Move the code for calculating the output width of the offset into
   the case DUMP_PREFIX_OFFSET.
2. Add Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

v1:
The dump prefix is added to facilitate the reading of the dumped memory.
However, if the prefix content is too repeated or redundant, the readability
is reduced, and the ring buffer becomes full quickly and other prints are
overwritten.

For example: (DUMP_PREFIX_OFFSET)
Before:
dump_size=36:
00000000: c0 ba 8c 80 00 80 ff ff 6c 93 ee 2f ee bf ff ff
00000010: 00 50 1e 98 ff 27 ff ff 01 00 00 00 00 00 00 00
00000020: 80 ca 2f 98

After:
dump_size=36:
00: c0 3a 91 80 00 80 ff ff 6c 93 ae 76 30 ce ff ff
10: 00 60 cd 60 7d 4e ff ff 01 00 00 00 00 00 00 00
20: 40 9e 29 40


Zhen Lei (2):
  hexdump: minimize the output width of the offset
  hexdump: add a new dump prefix DUMP_PREFIX_CUSTOM

 include/linux/printk.h |  3 ++-
 lib/hexdump.c          | 28 ++++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 3 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-16 11:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11  7:49 [PATCH v3 0/2] hexdump: minimize the output width of address and offset thunder.leizhen
2023-08-11  7:49 ` [PATCH v3 1/2] hexdump: minimize the output width of the offset thunder.leizhen
2023-08-11  7:49 ` [PATCH v3 2/2] hexdump: add a new dump prefix DUMP_PREFIX_CUSTOM thunder.leizhen
2023-08-15 14:30   ` Petr Mladek
2023-08-16  3:20     ` Leizhen (ThunderTown)
2023-08-16  3:34       ` Sergey Senozhatsky
2023-08-16  6:32         ` Leizhen (ThunderTown)
2023-08-16  9:04       ` Petr Mladek
2023-08-16 11:24         ` Leizhen (ThunderTown)

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.