summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/resctrl.h
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2020-01-17 00:32:41 +0300
committerShuah Khan <skhan@linuxfoundation.org>2020-02-11 04:42:57 +0300
commit78941183d1b151317beb37b25690b7d87fe2596d (patch)
treedd078fd0c1808fbf5db2b5ee3259626dbd1767e7 /tools/testing/selftests/resctrl/resctrl.h
parent01fee6b4d1f93247e806dddb0065b88317949085 (diff)
downloadlinux-78941183d1b151317beb37b25690b7d87fe2596d.tar.xz
selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest
Cache QoS Monitoring (CQM) selftest starts stressful cache benchmark with specified size of memory to access the cache. Last Level cache occupancy reported by CQM should be close to the size of the memory. 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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index a6196ab6b59f..d326c7e95862 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -18,12 +18,16 @@
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/eventfd.h>
#include <asm/unistd.h>
#include <linux/perf_event.h>
#define MB (1024 * 1024)
#define RESCTRL_PATH "/sys/fs/resctrl"
#define PHYS_ID_PATH "/sys/devices/system/cpu/cpu"
+#define CBM_MASK_PATH "/sys/fs/resctrl/info"
#define PARENT_EXIT(err_msg) \
do { \
@@ -53,12 +57,16 @@ struct resctrl_val_param {
int mum_resctrlfs;
char filename[64];
char *bw_report;
+ unsigned long mask;
+ int num_of_runs;
int (*setup)(int num, ...);
};
pid_t bm_pid, ppid;
int tests_run;
+char llc_occup_path[1024];
+
bool check_resctrlfs_support(void);
int filter_dmesg(void);
int remount_resctrlfs(bool mum_resctrlfs);
@@ -83,5 +91,13 @@ void tests_cleanup(void);
void mbm_test_cleanup(void);
int mba_schemata_change(int cpu_no, char *bw_report, char **benchmark_cmd);
void mba_test_cleanup(void);
+int get_cbm_mask(char *cache_type);
+int get_cache_size(int cpu_no, char *cache_type, unsigned long *cache_size);
+void ctrlc_handler(int signum, siginfo_t *info, void *ptr);
+int cqm_resctrl_val(int cpu_no, int n, char **benchmark_cmd);
+unsigned int count_bits(unsigned long n);
+void cqm_test_cleanup(void);
+int get_core_sibling(int cpu_no);
+int measure_cache_vals(struct resctrl_val_param *param, int bm_pid);
#endif /* RESCTRL_H */