[PATCH v4 01/14] bug/kunit: Core support for suppressing warning backtraces
David Gow
davidgow at google.com
Sat Mar 29 19:03:49 AEDT 2025
On Thu, 13 Mar 2025 at 19:44, Alessandro Carminati <acarmina at redhat.com> wrote:
>
> From: Guenter Roeck <linux at roeck-us.net>
>
> Some unit tests intentionally trigger warning backtraces by passing
> bad parameters to API functions. Such unit tests typically check the
> return value from those calls, not the existence of the warning backtrace.
>
> Such intentionally generated warning backtraces are neither desirable
> nor useful for a number of reasons.
> - They can result in overlooked real problems.
> - A warning that suddenly starts to show up in unit tests needs to be
> investigated and has to be marked to be ignored, for example by
> adjusting filter scripts. Such filters are ad-hoc because there is
> no real standard format for warnings. On top of that, such filter
> scripts would require constant maintenance.
>
> One option to address problem would be to add messages such as "expected
> warning backtraces start / end here" to the kernel log. However, that
> would again require filter scripts, it might result in missing real
> problematic warning backtraces triggered while the test is running, and
> the irrelevant backtrace(s) would still clog the kernel log.
>
> Solve the problem by providing a means to identify and suppress specific
> warning backtraces while executing test code. Since the new functionality
> results in an image size increase of about 1% if CONFIG_KUNIT is enabled,
> provide configuration option KUNIT_SUPPRESS_BACKTRACE to be able to disable
> the new functionality. This option is by default enabled since almost all
> systems with CONFIG_KUNIT enabled will want to benefit from it.
>
> Cc: Dan Carpenter <dan.carpenter at linaro.org>
> Cc: Daniel Diaz <daniel.diaz at linaro.org>
> Cc: Naresh Kamboju <naresh.kamboju at linaro.org>
> Cc: Kees Cook <keescook at chromium.org>
> Tested-by: Linux Kernel Functional Testing <lkft at linaro.org>
> Acked-by: Dan Carpenter <dan.carpenter at linaro.org>
> Reviewed-by: Kees Cook <keescook at chromium.org>
> Signed-off-by: Guenter Roeck <linux at roeck-us.net>
> Signed-off-by: Alessandro Carminati <acarmina at redhat.com>
> ---
Thanks Guenter & Alessandro: I'm very happy with this.
Reviewed-by: David Gow <davidgow at google.com>
-- David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5281 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20250329/2eec3641/attachment.p7s>
More information about the Linuxppc-dev
mailing list