summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/resctrl/mba_test.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2023-09-04 12:53:37 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-10-13 14:28:55 -0600
commite33cb5702a9f287d829b0e9e6abe57f6a4aba6d2 (patch)
treedf1886ccbab01a2f9f337e551dadfc65a0869255 /tools/testing/selftests/resctrl/mba_test.c
parent47809eb70cdc81221e03baafe8c1768801a9184e (diff)
downloadlinux-stable-e33cb5702a9f287d829b0e9e6abe57f6a4aba6d2.tar.gz
linux-stable-e33cb5702a9f287d829b0e9e6abe57f6a4aba6d2.tar.bz2
linux-stable-e33cb5702a9f287d829b0e9e6abe57f6a4aba6d2.zip
selftests/resctrl: Make benchmark command const and build it with pointers
Benchmark command is used in multiple tests so it should not be mutated by the tests but CMT test alters span argument. Due to the order of tests (CMT test runs last), mutating the span argument in CMT test does not trigger any real problems currently. Mark benchmark_cmd strings as const and setup the benchmark command using pointers. Because the benchmark command becomes const, the input arguments can be used directly. Besides being simpler, using the input arguments directly also removes the internal size restriction. CMT test has to create a copy of the benchmark command before altering the benchmark command. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: "Wieczor-Retman, Maciej" <maciej.wieczor-retman@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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c
index 094424d835d0..cf8284dadcb2 100644
--- a/tools/testing/selftests/resctrl/mba_test.c
+++ b/tools/testing/selftests/resctrl/mba_test.c
@@ -141,7 +141,7 @@ void mba_test_cleanup(void)
remove(RESULT_FILE_NAME);
}
-int mba_schemata_change(int cpu_no, char **benchmark_cmd)
+int mba_schemata_change(int cpu_no, const char * const *benchmark_cmd)
{
struct resctrl_val_param param = {
.resctrl_val = MBA_STR,