Re: [PATCH] Support resetting WARN*_ONCE

Andi Kleen
2017-10-19T20:47:09Z

On Wed, Oct 18, 2017 at 04:35:14PM +1100, Michael Ellerman wrote:
> Andi Kleen <andi@firstfloor.org> writes:
>
> > From: Andi Kleen <ak@linux.intel.com>
> >
> > I like _ONCE warnings because it's guaranteed that they don't
> > flood the log.
> >
> > During testing I find it useful to reset the state of the once warnings,
> > so that I can rerun tests and see if they trigger again, or can
> > guarantee that a test run always hits the same warnings.
> >
> > This patch adds a debugfs interface to reset all the _ONCE
> > warnings so that they appear again:
> >
> > echo 1 > /sys/kernel/debug/clear_warn_once
> >
> > This is implemented by putting all the warning booleans into
> > a special section, and clearing it.
>
> That won't work for arches that do the ONCE logic with a flag will it?
> ie. arm64, parisc, powerpc, s390, sh, x86.

Thanks. I sent an incremential patch that fixes this.

-Andi