From: John Ogness <john.ogness@linutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
David Gow <david@davidgow.net>,
Brendan Higgins <brendan.higgins@linux.dev>,
Kees Cook <kees@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>,
David Laight <david.laight.linux@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jonathan Corbet <corbet@lwn.net>,
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 v3 0/3] hexdump: Allow skipping identical lines
Date: Wed, 14 Oct 2026 11:28:47 +0206 [thread overview]
Message-ID: <87fqy8y6u0.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <as6TIm6xE8Izccb5@black.igk.intel.com>
On 2026-10-13, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> Sorry for the so late response. First of all, a bit of a background
> development on my side. At some point a few months ago I asked John
> Ogness to give me a private dive to the printk() guts. He explained
> to me a lot about ow printk() circular buffer works and that the
> implementation is nowadays done in the terms of circular buffer library
> and printk() front-end. This gives a potential to get a clean solution
> for the testing how printk() actually behaves. The main issue with the
> real printk() is that the buffer it's using is defined globally and
> for clean test cases the printk() can't be used. We discussed the way
> of high-jacking that by linking an object file of printk() implementation
> to the KUnit test, but it seems quite a tricky if ever achievable exercise.
>
> Meanwhile Kees Cook seems found a nice workaround for the similar use case
> in his recent patch series [1]. The idea is to register custom console and
> provide a custom .write() method which is the heart of the solution. On
> the writer side user prints something which has unique prefix, while the
> console callback recognises that pattern and checks the rest of the line.
The "sbufcap console" is using the legacy console interface. This is
probably good enough for now. However, we are currently working on
adding a "sync" feature to NBCON consoles. This feature would allow a
console to declare itself in "sync mode" and _every_ printk() call would
immediately and synchronously call into a ->write_atomic() console
callback. I think that feature would provide the level of printk
capturing that you want.
It also has the benefit of being useful outside of the KUnit testing
scope. (For example, pstore has also requested something similar.)
Until sync mode is ready, feel free to continue to use the less reliable
but probably good enough legacy console interface.
John Ogness
> [1]: https://lore.kernel.org/r/20261005155653.late.426-kees@kernel.org
next prev parent reply other threads:[~2026-10-14 9:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 16:08 [PATCH v3 0/3] hexdump: Allow skipping identical lines Miquel Raynal
2025-03-19 16:08 ` [PATCH v3 1/3] hexdump: Simplify print_hex_dump() Miquel Raynal
2025-03-19 16:37 ` Andy Shevchenko
2025-03-19 17:53 ` Miquel Raynal
2025-03-19 16:08 ` [PATCH v3 2/3] hexdump: Allow skipping identical lines Miquel Raynal
2025-03-19 16:41 ` Andy Shevchenko
2025-03-19 18:08 ` Miquel Raynal
2025-03-19 16:08 ` [PATCH v3 3/3] hexdump: Print the prefix after the last line to show the dump is over Miquel Raynal
2025-03-19 16:44 ` Andy Shevchenko
2026-10-13 20:22 ` [PATCH v3 0/3] hexdump: Allow skipping identical lines Andy Shevchenko
2026-10-14 9:22 ` John Ogness [this message]
2026-10-14 15:38 ` Petr Mladek
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=87fqy8y6u0.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brendan.higgins@linux.dev \
--cc=corbet@lwn.net \
--cc=david.laight.linux@gmail.com \
--cc=david@davidgow.net \
--cc=kees@kernel.org \
--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