printk: ringbuffer: Add KUnit test

The KUnit test validates the correct operation of the ringbuffer.
A separate dedicated ringbuffer is used so that the global printk
ringbuffer is not touched.

Co-developed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://patch.msgid.link/20250612-printk-ringbuffer-test-v3-1-550c088ee368@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
This commit is contained in:
Thomas Weißschuh
2025-06-12 08:29:07 +02:00
committed by Petr Mladek
parent 19272b37aa
commit 5ea2bcdfbf
5 changed files with 317 additions and 0 deletions

View File

@@ -1667,6 +1667,18 @@ config PRINTK
very difficult to diagnose system problems, saying N here is
strongly discouraged.
config PRINTK_RINGBUFFER_KUNIT_TEST
tristate "KUnit Test for the printk ringbuffer" if !KUNIT_ALL_TESTS
depends on PRINTK && KUNIT
default KUNIT_ALL_TESTS
help
This builds the printk ringbuffer KUnit test suite.
For more information on KUnit and unit tests in general, please refer
to the KUnit documentation.
If unsure, say N.
config BUG
bool "BUG() support" if EXPERT
default y