From: David Laight <david.laight.linux@gmail.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>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] hexdump: Allow skipping identical lines
Date: Sat, 11 Jan 2025 12:10:05 +0000 [thread overview]
Message-ID: <20250111121005.0fc89c94@pumpkin> (raw)
In-Reply-To: <87o70dsmj1.fsf@bootlin.com>
On Sat, 11 Jan 2025 10:54:58 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> Hi David,
>
> On 10/01/2025 at 19:39:30 GMT, David Laight <david.laight.linux@gmail.com> wrote:
>
> > On Fri, 10 Jan 2025 19:42:05 +0100
> > Miquel Raynal <miquel.raynal@bootlin.com> 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.
> > ...
> >> enum {
> >> DUMP_FLAG_ASCII,
> >> + DUMP_FLAG_SKIP_IDENTICAL_LINES,
> >> };
> > ...
> >> + if (flags & DUMP_FLAG_SKIP_IDENTICAL_LINES) {
> >
> >
> > That doesn't look right to me.
> > You want:
> > enum {
> > DUMP_FLAG_HEX_ONLY = false,
> > DUMP_FLAG_ASCII = true,
> > DUMP_FLAG_SKIP_IDENTICAL_LINES = BIT(1),
> > };
> >
> > and maybe you can get away with not changing all the other files.
>
> I'm a bit sad all the time spent on these changes will go to trash :),
> they kind of looked "nicer", but for sure this approach would be
> transparent. I can definitely try that.
The only way the big patch would ever get applied is if Linus himself
decided it was a good idea and 'just applied it'.
Otherwise it needs an ack from all the maintainers.
The other way to avoid having to change all the files is to rename the
function and add a compile-time wrapper for the old users.
So you'd end up with (something like):
#define hexdump(args, ascii) hexdump_new(args, ascii ? DUMP_FLAG_ASCII : DUMP_FLAG_HEX_ONLY)
But in this case you might be away with binary compatibility.
David
next prev parent reply other threads:[~2025-01-11 12:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 18:42 [PATCH v2 0/2] hexdump: Allow skipping identical lines Miquel Raynal
2025-01-10 18:42 ` [PATCH v2 1/2] hexdump: Convert the ascii boolean into a flag variable Miquel Raynal
2025-01-10 18:42 ` [PATCH v2 2/2] hexdump: Allow skipping identical lines Miquel Raynal
2025-01-10 19:39 ` David Laight
2025-01-11 9:54 ` Miquel Raynal
2025-01-11 12:10 ` David Laight [this message]
2025-01-13 10:04 ` Andy Shevchenko
2025-01-11 5:36 ` Randy Dunlap
2025-01-13 12:35 ` Andy Shevchenko
2025-01-17 16:27 ` Petr Mladek
2025-01-17 19:25 ` David Laight
2025-01-20 9:29 ` Miquel Raynal
2025-01-20 10:25 ` Petr Mladek
2025-01-13 12:40 ` [PATCH v2 0/2] " 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=20250111121005.0fc89c94@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--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).