summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/resctrl_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl_tests.c')
-rw-r--r--tools/testing/selftests/resctrl/resctrl_tests.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index 70179a61df3b..7f75b0b01bb5 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -19,7 +19,7 @@ static void cmd_help(void)
printf("\t-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CQM");
printf("\t default benchmark is builtin fill_buf\n");
printf("\t-t test list: run tests specified in the test list, ");
- printf("e.g. -t mbm, mba, cqm\n");
+ printf("e.g. -t mbm, mba, cqm, cat\n");
printf("\t-n no_of_bits: run cache tests using specified no of bits in cache bit mask\n");
printf("\t-p cpu_no: specify CPU number to run the test. 1 is default\n");
printf("\t-h: help\n");
@@ -30,6 +30,7 @@ void tests_cleanup(void)
mbm_test_cleanup();
mba_test_cleanup();
cqm_test_cleanup();
+ cat_test_cleanup();
}
int main(int argc, char **argv)
@@ -39,6 +40,7 @@ int main(int argc, char **argv)
char *benchmark_cmd[BENCHMARK_ARGS], bw_report[64], bm_type[64];
char benchmark_cmd_area[BENCHMARK_ARGS][BENCHMARK_ARG_SIZE];
int ben_ind, ben_count;
+ bool cat_test = true;
for (i = 0; i < argc; i++) {
if (strcmp(argv[i], "-b") == 0) {
@@ -60,6 +62,7 @@ int main(int argc, char **argv)
mbm_test = false;
mba_test = false;
cqm_test = false;
+ cat_test = false;
while (token) {
if (!strcmp(token, "mbm")) {
mbm_test = true;
@@ -67,6 +70,8 @@ int main(int argc, char **argv)
mba_test = true;
} else if (!strcmp(token, "cqm")) {
cqm_test = true;
+ } else if (!strcmp(token, "cat")) {
+ cat_test = true;
} else {
printf("invalid argument\n");
@@ -159,6 +164,14 @@ int main(int argc, char **argv)
tests_run++;
}
+ if (cat_test) {
+ printf("# Starting CAT test ...\n");
+ res = cat_perf_miss_val(cpu_no, no_of_bits, "L3");
+ printf("%sok CAT: test\n", res ? "not " : "");
+ tests_run++;
+ cat_test_cleanup();
+ }
+
printf("1..%d\n", tests_run);
return 0;