[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9rzy9WQcy_MgH9v@smile.fi.intel.com>
Date: Wed, 19 Mar 2025 18:41:47 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: Petr Mladek <pmladek@...e.com>,
David Laight <david.laight.linux@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Jonathan Corbet <corbet@....net>,
John Ogness <john.ogness@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/3] hexdump: Allow skipping identical lines
On Wed, Mar 19, 2025 at 05:08:11PM +0100, Miquel Raynal wrote:
> When dumping long buffers (especially for debug purposes) it may be very
> convenient to sometimes avoid spitting all the lines of the buffer if
> the lines are identical. Typically on embedded devices, the console
> would be wired to a UART running at 115200 bauds, which makes the dumps
> very (very) slow. In this case, having a flag to avoid printing
> duplicated lines is handy.
>
> Example of a made up repetitive output:
> 0f 53 63 47 56 55 78 7a aa b7 8c ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff 01 2a 39 eb
>
> Same but with the flag enabled:
> 0f 53 63 47 56 55 78 7a aa b7 8c ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> ff ff ff ff ff ff ff ff ff ff ff ff 01 2a 39 eb
...
> For printing small buffers (up to 64 bytes long) as a hex string with a
> certain separator. For larger buffers consider using
> -:c:func:`print_hex`.
Instead of fixing this (see also comment in previous patch), just add the text
like
:c:func:`print_hex` is especially useful since duplicated lines can be skipped
automatically to reduce the overhead with the ``DUMP_SKIP_IDENTICAL_LINES`` flag.
> +:c:func:`print_hex`, especially since duplicated lines can be
> +skipped automatically to reduce the overhead with the
> +``DUMP_SKIP_IDENTICAL_LINES`` flag.
Also, can we also put a sub name spaces to the flags, like for HEX/ASCII
DUMP_DATA_HEX
DUMP_DATA_ASCII
This SKIP will start a new sub name space.
...
> #include <linux/errno.h>
> #include <linux/kernel.h>
> #include <linux/minmax.h>
> +#include <linux/string.h>
> #include <linux/export.h>
It's more natural to put it here, with given context it makes more order
(speaking of alphabetical one).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists