diff options
| author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2023-12-15 17:05:10 +0200 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2024-02-13 13:56:45 -0700 |
| commit | 15f298821289d3efba87bb34db29d0ba9780a443 (patch) | |
| tree | 83583ce2b6d7587910fa4a2b2dc6fa5671799429 /tools/testing/selftests/resctrl/mba_test.c | |
| parent | selftests/resctrl: Restore the CPU affinity after CAT test (diff) | |
| download | linux-15f298821289d3efba87bb34db29d0ba9780a443.tar.gz linux-15f298821289d3efba87bb34db29d0ba9780a443.zip | |
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/mba_test.c')
| -rw-r--r-- | tools/testing/selftests/resctrl/mba_test.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c index e907adf7cd25..8e54bc508a75 100644 --- a/tools/testing/selftests/resctrl/mba_test.c +++ b/tools/testing/selftests/resctrl/mba_test.c @@ -22,7 +22,7 @@ * con_mon grp, mon_grp in resctrl FS. * For each allocation, run 5 times in order to get average values. */ -static int mba_setup(struct resctrl_val_param *p) +static int mba_setup(const struct user_params *uparams, struct resctrl_val_param *p) { static int runs_per_allocation, allocation = 100; char allocation_str[64]; @@ -40,7 +40,7 @@ static int mba_setup(struct resctrl_val_param *p) sprintf(allocation_str, "%d", allocation); - ret = write_schemata(p->ctrlgrp, allocation_str, p->cpu_no, + ret = write_schemata(p->ctrlgrp, allocation_str, uparams->cpu, p->resctrl_val); if (ret < 0) return ret; @@ -141,13 +141,12 @@ void mba_test_cleanup(void) remove(RESULT_FILE_NAME); } -int mba_schemata_change(int cpu_no, const char * const *benchmark_cmd) +int mba_schemata_change(const struct user_params *uparams) { struct resctrl_val_param param = { .resctrl_val = MBA_STR, .ctrlgrp = "c1", .mongrp = "m1", - .cpu_no = cpu_no, .filename = RESULT_FILE_NAME, .bw_report = "reads", .setup = mba_setup @@ -156,7 +155,7 @@ int mba_schemata_change(int cpu_no, const char * const *benchmark_cmd) remove(RESULT_FILE_NAME); - ret = resctrl_val(benchmark_cmd, ¶m); + ret = resctrl_val(uparams, uparams->benchmark_cmd, ¶m); if (ret) goto out; |
