diff options
| author | Thomas Maarseveen <maarseveent@gmail.com> | 2026-08-12 20:55:33 +0200 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-10-06 19:02:58 -0700 |
| commit | a4747846dfa6f09080d2252d9d442e7dbe333fb2 (patch) | |
| tree | 2872c8b615c50a8fb6b94076a81dcbcf465ec27a /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | df0b7e0ea59c43708cff8c7e34da5e2f8d430e5e (diff) | |
lib/tests: add KUnit tests for errseq
The errseq_t infrastructure (lib/errseq.c) underpins writeback error
reporting but has no regression tests. Its semantics are subtle enough to
have needed fixing before: commit b4678df184b3 ("errseq: Always report a
writeback error once") changed how unseen errors reach new samplers.
Add a KUnit suite covering the documented single-threaded semantics:
- a zeroed errseq_t is the "no error yet" epoch
- errors are recorded, overwrite one another, and both ends of the
valid errno range round-trip exactly
- an error nobody has seen samples as zero, so a check against a
fresh sample still reports it
- errseq_check_and_advance() reports a given error exactly once per
cursor and leaves the cursor in place when nothing has changed
- once an error has been seen, a fresh sample is current and a check
against it reports nothing
- the same error recorded again after being seen is reported again,
even to a cursor that consumed the first occurrence while another
cursor marked the repeat as seen
- independent cursors each observe each error
The lockless behaviour of errseq_t under concurrent updates and the WARN
path for invalid error values are deliberately out of scope.
Tested with ./tools/testing/kunit/kunit.py run, with a kunitconfig
enabling CONFIG_KUNIT=y and CONFIG_ERRSEQ_KUNIT_TEST=y; all 13 tests pass
under ARCH=um.
Link: https://lore.kernel.org/20260812-errseq-kunit-v1-1-312be4c3aa0d@gmail.com
Signed-off-by: Thomas Maarseveen <maarseveent@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Jeff Layton <jlayton@kernel.org>
Cc: David Gow <david@davidgow.net>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
