summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/mbm_test.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2023-12-15 17:05:10 +0200
committerShuah Khan <skhan@linuxfoundation.org>2024-02-13 13:56:45 -0700
commit15f298821289d3efba87bb34db29d0ba9780a443 (patch)
tree83583ce2b6d7587910fa4a2b2dc6fa5671799429 /tools/testing/selftests/resctrl/mbm_test.c
parent6c8cb747d071cf72c2930e09bb20ab3eabfe62ff (diff)
selftests/resctrl: Create struct for input parameters
resctrl_tests reads a set of parameters and passes them individually for each tests which causes variations in the call signature between the tests. Add struct input_params to hold all input parameters. It can be easily passed to every test without varying the call signature. 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/mbm_test.c')
-rw-r--r--tools/testing/selftests/resctrl/mbm_test.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c
index 721b3ecbc158..ea951cfae5fe 100644
--- a/tools/testing/selftests/resctrl/mbm_test.c
+++ b/tools/testing/selftests/resctrl/mbm_test.c
@@ -86,7 +86,7 @@ static int check_results(size_t span)
return ret;
}
-static int mbm_setup(struct resctrl_val_param *p)
+static int mbm_setup(const struct user_params *uparams, struct resctrl_val_param *p)
{
int ret = 0;
@@ -96,7 +96,7 @@ static int mbm_setup(struct resctrl_val_param *p)
/* Set up shemata with 100% allocation on the first run. */
if (p->num_of_runs == 0 && validate_resctrl_feature_request("MB", NULL))
- ret = write_schemata(p->ctrlgrp, "100", p->cpu_no,
+ ret = write_schemata(p->ctrlgrp, "100", uparams->cpu,
p->resctrl_val);
p->num_of_runs++;
@@ -109,13 +109,12 @@ void mbm_test_cleanup(void)
remove(RESULT_FILE_NAME);
}
-int mbm_bw_change(int cpu_no, const char * const *benchmark_cmd)
+int mbm_bw_change(const struct user_params *uparams)
{
struct resctrl_val_param param = {
.resctrl_val = MBM_STR,
.ctrlgrp = "c1",
.mongrp = "m1",
- .cpu_no = cpu_no,
.filename = RESULT_FILE_NAME,
.bw_report = "reads",
.setup = mbm_setup
@@ -124,7 +123,7 @@ int mbm_bw_change(int cpu_no, const char * const *benchmark_cmd)
remove(RESULT_FILE_NAME);
- ret = resctrl_val(benchmark_cmd, &param);
+ ret = resctrl_val(uparams, uparams->benchmark_cmd, &param);
if (ret)
goto out;