aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/resctrl/resctrl.h
diff options
context:
space:
mode:
authorShaopeng Tan <tan.shaopeng@jp.fujitsu.com>2022-03-23 17:09:27 +0900
committerShuah Khan <skhan@linuxfoundation.org>2022-04-25 16:57:50 -0600
commit6220f69e72a534838cffd84dce6afd777777be03 (patch)
tree13ef22c7ac5ffe8f4d764544a28f388cacc84331 /tools/testing/selftests/resctrl/resctrl.h
parentselftests/x86/corrupt_xstate_header: Use provided __cpuid_count() macro (diff)
downloadlinux-dev-6220f69e72a534838cffd84dce6afd777777be03.tar.xz
linux-dev-6220f69e72a534838cffd84dce6afd777777be03.zip
selftests/resctrl: Extend CPU vendor detection
Currently, the resctrl_tests only has a function to detect AMD vendor. Since when the Intel Sub-NUMA Clustering feature is enabled, Intel CMT and MBM counters may not be accurate, the resctrl_tests also need a function to detect Intel vendor. And in the future, resctrl_tests will need a function to detect different vendors, such as Arm. Extend the function to detect Intel vendor as well. Also, this function can be easily extended to detect other vendors. Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> 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.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index 1ad10c47e31d..f0ded31fb3c7 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -34,6 +34,9 @@
#define L3_MON_PATH "/sys/fs/resctrl/info/L3_MON"
#define L3_MON_FEATURES_PATH "/sys/fs/resctrl/info/L3_MON/mon_features"
+#define ARCH_INTEL 1
+#define ARCH_AMD 2
+
#define PARENT_EXIT(err_msg) \
do { \
perror(err_msg); \
@@ -75,8 +78,8 @@ struct resctrl_val_param {
extern pid_t bm_pid, ppid;
extern char llc_occup_path[1024];
-extern bool is_amd;
+int get_vendor(void);
bool check_resctrlfs_support(void);
int filter_dmesg(void);
int remount_resctrlfs(bool mum_resctrlfs);