[PATCH i-g-t v4 0/8] lib/kunit: Support writable filter* parameters of kunit module

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Tue Feb 6 10:00:24 UTC 2024


Instead of wasting resources on reloading the base Kunit module each time
a different set of filter parameters is needed, try to write the required
values to sysfs representation of those parameters.  If that fails (e.g.
on older LTS kernels with read-only filter parameters), fall back to
reloading the module.

This change also provides a workaround for the issue of impossibility to
unload the base Kunit module on Xe platforms, available as soon as the
module supports writable filter parameters.

While being at it, fine tune processing of skips on errors during test
case list collection phase.

v4: Replace patch v3 1/6 "lib/kunit: Skip on empty list of test cases" 
    with "lib/kunit: Enter legacy path only if applying filters fails",
  - return early when opening module parameters directory fails (Lucas),
  - use error unwind pattern on errors from sysfs writes,
  - replace "human-readable" with "non-NULL" in comments about strings
    used as equivalents of default NULLs,
  - use empty string as filter_action NULL equivalent, but verify if
    successfully applied when critical,
  - refresh commit description by removing a statement that addressed an
    update to a comment on legacy path, no longer in scope of this patch.
  - add a patch that fixes inline documentation of IGT KUnit API,
  - add a patch that optimizes test suite filtering.
v3: Don't read-compare-write, just write the values (Lucas),
  - skip calling igt_sysfs_set() when the string to be written to
    filter_action is empty (Lucas),
  - warn if we leave the filter_action set to "skip" while setting a non-
    default value of the filter parameter,
  - transform generic kunit_set_params() to kunit_set_filtering().
v2: Work around ineffective writes of empty strings to sysfs module
    parameter files (Lucas) by using human readable non-empty strings that
    give the same results as default NULLs,
  - drop fallback to reload of base Kunit module method if assigning new
    values to module parameters via sysfs fails (Lucas), instead use the
    existing fallback to blind execution like if getting a list of test
    cases was not supported at all,
  - split move of open_parameters() helper up in the source file as well
    as cleanup of base KUnit module unloading to separate patches (Kamil),
  - skip on empty list of test cases (new patch),
  - address the issue of commit description suggesting two separate
    changes combined in one patch (Kamil).

Janusz Krzysztofik (8):
  lib/kunit: Enter legacy path only if applying filters fails
  lib/kmode: Prepare open_parameters() helper for reuse by kunit
  lib/kunit: Unload base KUnit module only before reloading it
  lib/kunit: Support writable filter* parameters of kunit module
  lib/kunit: Report early kernel taints explicitly
  lib/kunit: Process module remove error after list errors
  lib/kunit: Fix API documentation
  lib/kunit: Perform test suite filtering on the kernel side

 lib/igt_kmod.c | 196 ++++++++++++++++++++++++++++---------------------
 1 file changed, 114 insertions(+), 82 deletions(-)

-- 
2.43.0



More information about the igt-dev mailing list