summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/cmt_test.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2023-12-15 17:05:12 +0200
committerShuah Khan <skhan@linuxfoundation.org>2024-02-13 13:56:45 -0700
commitca1608875ae21bb40a7731b81bc0e2c95622d502 (patch)
tree9958d734cda96722d4750fd53656c877948e295a /tools/testing/selftests/resctrl/cmt_test.c
parentc603ff5bb830b8c22dae56ca3ca5ceb5c103525b (diff)
selftests/resctrl: Pass write_schemata() resource instead of test name
write_schemata() takes the test name as an argument and determines the relevant resource based on the test name. Such mapping from name to resource does not really belong to resctrlfs.c that should provide only generic, test-independent functions. Pass the resource stored in the test information structure to write_schemata() instead of the test name. The new API is also more flexible as it enables to use write_schemata() for more than one resource within a test. While touching the sprintf(), move the unnecessary %c that is always '=' directly into the format string. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/cmt_test.c')
-rw-r--r--tools/testing/selftests/resctrl/cmt_test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c
index c01980039118..dd5ca343c469 100644
--- a/tools/testing/selftests/resctrl/cmt_test.c
+++ b/tools/testing/selftests/resctrl/cmt_test.c
@@ -16,7 +16,9 @@
#define MAX_DIFF 2000000
#define MAX_DIFF_PERCENT 15
-static int cmt_setup(const struct user_params *uparams, struct resctrl_val_param *p)
+static int cmt_setup(const struct resctrl_test *test,
+ const struct user_params *uparams,
+ struct resctrl_val_param *p)
{
/* Run NUM_OF_RUNS times */
if (p->num_of_runs >= NUM_OF_RUNS)
@@ -150,7 +152,7 @@ static int cmt_run_test(const struct resctrl_test *test, const struct user_param
remove(RESULT_FILE_NAME);
- ret = resctrl_val(uparams, cmd, &param);
+ ret = resctrl_val(test, uparams, cmd, &param);
if (ret)
goto out;