summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/resctrl/resctrl.h
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2020-01-16 13:32:39 -0800
committerShuah Khan <skhan@linuxfoundation.org>2020-02-10 18:42:29 -0700
commitecdbb911f22d6cc5d422571dedf048b889d71417 (patch)
treefec76c9957f0335f20c5a4a5ad0ae5d3efe8afac /tools/testing/selftests/resctrl/resctrl.h
parenta2561b12fe392e0024e3187d325dbcbde7b99c04 (diff)
downloadlinux-ecdbb911f22d6cc5d422571dedf048b889d71417.tar.bz2
selftests/resctrl: Add MBM test
MBM (Memory Bandwidth Monitoring) test is the first implemented selftest. It starts a stressful memory bandwidth benchmark and assigns the bandwidth pid in a resctrl monitoring group. Read and compare perf IMC counter and MBM total bytes for the benchmark. The numbers should be close enough to pass the test. Default benchmark is built-in fill_buf. But users can specify their own benchmark by option "-b". We can add memory bandwidth monitoring for multiple processes in the future. Co-developed-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> Co-developed-by: Babu Moger <babu.moger@amd.com> Signed-off-by: Babu Moger <babu.moger@amd.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl.h')
-rw-r--r--tools/testing/selftests/resctrl/resctrl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index fb42087c904d..c92bc50c6751 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -57,7 +57,10 @@ struct resctrl_val_param {
};
pid_t bm_pid, ppid;
+int tests_run;
+bool check_resctrlfs_support(void);
+int filter_dmesg(void);
int remount_resctrlfs(bool mum_resctrlfs);
int get_resource_id(int cpu_no, int *resource_id);
int umount_resctrlfs(void);
@@ -75,5 +78,8 @@ int perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu,
int run_fill_buf(unsigned long span, int malloc_and_init_memory, int memflush,
int op, char *resctrl_va);
int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param);
+int mbm_bw_change(int span, int cpu_no, char *bw_report, char **benchmark_cmd);
+void tests_cleanup(void);
+void mbm_test_cleanup(void);
#endif /* RESCTRL_H */