Re: [PATCH v4 01/14] bug/kunit: Core support for suppressing warning backtraces

David Gow <[email protected]>
Newsgroups gmane.linux.ports.ppc64.devel,gmane.comp.video.dri.devel,gmane.linux.kernel.cross-arch,gmane.linux.ports.arm.kernel,gmane.linux.documentation,gmane.linux.kernel,gmane.linux.ports.parisc,gmane.linux.ports.riscv,gmane.linux.ports.sh.devel
Message-ID <CABVgOS=+y-yO+4G6-77Cry3LH-bhA+MLsrT-G45ZbxNUyEBRhw@mail.gmail.com>
On Thu, 13 Mar 2025 at 19:44, Alessandro Carminati <[email protected]> wrote:
>
> From: Guenter Roeck <[email protected]>
>
> 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 <[email protected]>
> Cc: Daniel Diaz <[email protected]>
> Cc: Naresh Kamboju <[email protected]>
> Cc: Kees Cook <[email protected]>
> Tested-by: Linux Kernel Functional Testing <[email protected]>
> Acked-by: Dan Carpenter <[email protected]>
> Reviewed-by: Kees Cook <[email protected]>
> Signed-off-by: Guenter Roeck <[email protected]>
> Signed-off-by: Alessandro Carminati <[email protected]>
> ---

Thanks Guenter & Alessandro: I'm very happy with this.

Reviewed-by: David Gow <[email protected]>


-- David
smime.p7s (application/pkcs7-signature, 5.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.