Skip to content

Commit a0dd82d

Browse files
lucasdemarchishuahkh
authored andcommitted
kunit: Mark filter* params as rw
By allowing the filter_glob parameter to be written to, it's possible to tweak the testsuites that will be executed on new module loads. This makes it easier to run specific tests without having to reload kunit and provides a way to filter tests on real HW even if kunit is builtin. Example for xe driver: 1) Run just 1 test # echo -n xe_bo > /sys/module/kunit/parameters/filter_glob # modprobe -r xe_live_test # modprobe xe_live_test # ls /sys/kernel/debug/kunit/ xe_bo 2) Run all tests # echo \* > /sys/module/kunit/parameters/filter_glob # modprobe -r xe_live_test # modprobe xe_live_test # ls /sys/kernel/debug/kunit/ xe_bo xe_dma_buf xe_migrate xe_mocs For completeness and to cover other use cases, also change filter and filter_action to rw. Link: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ Reviewed-by: Rae Moar <rmoar@google.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent ee8bd4a commit a0dd82d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/kunit/executor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ static char *filter_glob_param;
3333
static char *filter_param;
3434
static char *filter_action_param;
3535

36-
module_param_named(filter_glob, filter_glob_param, charp, 0400);
36+
module_param_named(filter_glob, filter_glob_param, charp, 0600);
3737
MODULE_PARM_DESC(filter_glob,
3838
"Filter which KUnit test suites/tests run at boot-time, e.g. list* or list*.*del_test");
39-
module_param_named(filter, filter_param, charp, 0400);
39+
module_param_named(filter, filter_param, charp, 0600);
4040
MODULE_PARM_DESC(filter,
4141
"Filter which KUnit test suites/tests run at boot-time using attributes, e.g. speed>slow");
42-
module_param_named(filter_action, filter_action_param, charp, 0400);
42+
module_param_named(filter_action, filter_action_param, charp, 0600);
4343
MODULE_PARM_DESC(filter_action,
4444
"Changes behavior of filtered tests using attributes, valid values are:\n"
4545
"<none>: do not run filtered tests as normal\n"

0 commit comments

Comments
 (0)