Skip to content

Commit 47e36f1

Browse files
ij-intelshuahkh
authored andcommitted
selftests/resctrl: Remove bw_report and bm_type from main()
bw_report is always set to "reads" and bm_type is set to "fill_buf" but is never used. Set bw_report directly to "reads" in MBA/MBM test and remove bm_type. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: "Wieczor-Retman, Maciej" <maciej.wieczor-retman@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 5eb6360 commit 47e36f1

4 files changed

Lines changed: 13 additions & 17 deletions

File tree

tools/testing/selftests/resctrl/mba_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ void mba_test_cleanup(void)
141141
remove(RESULT_FILE_NAME);
142142
}
143143

144-
int mba_schemata_change(int cpu_no, char *bw_report, char **benchmark_cmd)
144+
int mba_schemata_change(int cpu_no, char **benchmark_cmd)
145145
{
146146
struct resctrl_val_param param = {
147147
.resctrl_val = MBA_STR,
148148
.ctrlgrp = "c1",
149149
.mongrp = "m1",
150150
.cpu_no = cpu_no,
151151
.filename = RESULT_FILE_NAME,
152-
.bw_report = bw_report,
152+
.bw_report = "reads",
153153
.setup = mba_setup
154154
};
155155
int ret;

tools/testing/selftests/resctrl/mbm_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void mbm_test_cleanup(void)
109109
remove(RESULT_FILE_NAME);
110110
}
111111

112-
int mbm_bw_change(size_t span, int cpu_no, char *bw_report, char **benchmark_cmd)
112+
int mbm_bw_change(size_t span, int cpu_no, char **benchmark_cmd)
113113
{
114114
struct resctrl_val_param param = {
115115
.resctrl_val = MBM_STR,
@@ -118,7 +118,7 @@ int mbm_bw_change(size_t span, int cpu_no, char *bw_report, char **benchmark_cmd
118118
.span = span,
119119
.cpu_no = cpu_no,
120120
.filename = RESULT_FILE_NAME,
121-
.bw_report = bw_report,
121+
.bw_report = "reads",
122122
.setup = mbm_setup
123123
};
124124
int ret;

tools/testing/selftests/resctrl/resctrl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ int perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu,
9898
int group_fd, unsigned long flags);
9999
int run_fill_buf(size_t span, int memflush, int op, bool once);
100100
int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param);
101-
int mbm_bw_change(size_t span, int cpu_no, char *bw_report, char **benchmark_cmd);
101+
int mbm_bw_change(size_t span, int cpu_no, char **benchmark_cmd);
102102
void tests_cleanup(void);
103103
void mbm_test_cleanup(void);
104-
int mba_schemata_change(int cpu_no, char *bw_report, char **benchmark_cmd);
104+
int mba_schemata_change(int cpu_no, char **benchmark_cmd);
105105
void mba_test_cleanup(void);
106106
int get_cbm_mask(char *cache_type, char *cbm_mask);
107107
int get_cache_size(int cpu_no, char *cache_type, unsigned long *cache_size);

tools/testing/selftests/resctrl/resctrl_tests.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ void tests_cleanup(void)
7070
cat_test_cleanup();
7171
}
7272

73-
static void run_mbm_test(char **benchmark_cmd, size_t span,
74-
int cpu_no, char *bw_report)
73+
static void run_mbm_test(char **benchmark_cmd, size_t span, int cpu_no)
7574
{
7675
int res;
7776

@@ -88,7 +87,7 @@ static void run_mbm_test(char **benchmark_cmd, size_t span,
8887
goto umount;
8988
}
9089

91-
res = mbm_bw_change(span, cpu_no, bw_report, benchmark_cmd);
90+
res = mbm_bw_change(span, cpu_no, benchmark_cmd);
9291
ksft_test_result(!res, "MBM: bw change\n");
9392
if ((get_vendor() == ARCH_INTEL) && res)
9493
ksft_print_msg("Intel MBM may be inaccurate when Sub-NUMA Clustering is enabled. Check BIOS configuration.\n");
@@ -97,7 +96,7 @@ static void run_mbm_test(char **benchmark_cmd, size_t span,
9796
umount_resctrlfs();
9897
}
9998

100-
static void run_mba_test(char **benchmark_cmd, int cpu_no, char *bw_report)
99+
static void run_mba_test(char **benchmark_cmd, int cpu_no)
101100
{
102101
int res;
103102

@@ -114,7 +113,7 @@ static void run_mba_test(char **benchmark_cmd, int cpu_no, char *bw_report)
114113
goto umount;
115114
}
116115

117-
res = mba_schemata_change(cpu_no, bw_report, benchmark_cmd);
116+
res = mba_schemata_change(cpu_no, benchmark_cmd);
118117
ksft_test_result(!res, "MBA: schemata change\n");
119118

120119
umount:
@@ -174,9 +173,9 @@ static void run_cat_test(int cpu_no, int no_of_bits)
174173
int main(int argc, char **argv)
175174
{
176175
bool has_ben = false, mbm_test = true, mba_test = true, cmt_test = true;
177-
char *benchmark_cmd[BENCHMARK_ARGS], bw_report[64], bm_type[64];
178176
char benchmark_cmd_area[BENCHMARK_ARGS][BENCHMARK_ARG_SIZE];
179177
int c, cpu_no = 1, argc_new = argc, i, no_of_bits = 0;
178+
char *benchmark_cmd[BENCHMARK_ARGS];
180179
int ben_ind, ben_count, tests = 0;
181180
size_t span = 250 * MB;
182181
bool cat_test = true;
@@ -279,9 +278,6 @@ int main(int argc, char **argv)
279278
benchmark_cmd[5] = NULL;
280279
}
281280

282-
sprintf(bw_report, "reads");
283-
sprintf(bm_type, "fill_buf");
284-
285281
if (!check_resctrlfs_support())
286282
return ksft_exit_skip("resctrl FS does not exist. Enable X86_CPU_RESCTRL config option.\n");
287283

@@ -293,10 +289,10 @@ int main(int argc, char **argv)
293289
ksft_set_plan(tests ? : 4);
294290

295291
if (mbm_test)
296-
run_mbm_test(benchmark_cmd, span, cpu_no, bw_report);
292+
run_mbm_test(benchmark_cmd, span, cpu_no);
297293

298294
if (mba_test)
299-
run_mba_test(benchmark_cmd, cpu_no, bw_report);
295+
run_mba_test(benchmark_cmd, cpu_no);
300296

301297
if (cmt_test)
302298
run_cmt_test(benchmark_cmd, cpu_no);

0 commit comments

Comments
 (0)