From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jonathan Corbet <corbet@lwn.net>,
John Ogness <john.ogness@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] hexdump: Allow skipping identical lines
Date: Mon, 26 Aug 2024 20:35:36 +0300 [thread overview]
Message-ID: <Zsy86HZ7uew9-Ef6@smile.fi.intel.com> (raw)
In-Reply-To: <20240826162416.74501-3-miquel.raynal@bootlin.com>
On Mon, Aug 26, 2024 at 06:24:16PM +0200, 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
The problem here is that without offset we can't see how many lines were
skipped.
Two ways to solve (that come to my mind immediately, maybe more and better):
1) make sure that new flag implies or expects (otherwise BUILD_BUG_ON() or so)
the OFFSET to be set;
2) [OR] add number of lines skipped in that * line.
Personally I prefer the 1) as I think that you tried to follow the existing
format of user space tools and there is a chance that there are other tools or
scripts that parse the dump to restore the binary contents.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-08-26 17:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 16:24 [PATCH 0/2] hexdump: Allow skipping identical lines Miquel Raynal
2024-08-26 16:24 ` [PATCH 1/2] hexdump: Convert the ascii boolean into a flag variable Miquel Raynal
2024-12-24 15:41 ` Andy Shevchenko
2024-08-26 16:24 ` [PATCH 2/2] hexdump: Allow skipping identical lines Miquel Raynal
2024-08-26 17:35 ` Andy Shevchenko [this message]
2024-08-27 9:13 ` Miquel Raynal
2024-08-27 13:36 ` Andy Shevchenko
2024-08-26 17:32 ` [PATCH 0/2] " Andy Shevchenko
2024-08-27 9:01 ` Miquel Raynal
2024-08-27 13:29 ` Andy Shevchenko
2024-12-24 11:56 ` Miquel Raynal
2024-12-24 15:49 ` Andy Shevchenko
2024-12-30 11:35 ` Miquel Raynal
2025-01-13 12:16 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zsy86HZ7uew9-Ef6@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=john.ogness@linutronix.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=miquel.raynal@bootlin.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).