summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl
diff options
context:
space:
mode:
authorBabu Moger <babu.moger@amd.com>2020-01-16 13:32:44 -0800
committerShuah Khan <skhan@linuxfoundation.org>2020-02-10 18:43:32 -0700
commitc0327e1d7c42adb31a9541de6812f740893177a1 (patch)
tree3ec4c720237de923c30188ee1945512b58075489 /tools/testing/selftests/resctrl
parent53f74fbec9f069241aa6f4c4d908229c77ee83e2 (diff)
selftests/resctrl: Use cache index3 id for AMD schemata masks
AMD uses the cache l3 boundary for schemata masks. Update it accordigly. Signed-off-by: Babu Moger <babu.moger@amd.com> Co-developed-by: Fenghua Yu <fenghua.yu@intel.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')
-rw-r--r--tools/testing/selftests/resctrl/resctrlfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
index 8772c8c4d5d0..19c0ec4045a4 100644
--- a/tools/testing/selftests/resctrl/resctrlfs.c
+++ b/tools/testing/selftests/resctrl/resctrlfs.c
@@ -113,8 +113,13 @@ int get_resource_id(int cpu_no, int *resource_id)
char phys_pkg_path[1024];
FILE *fp;
- sprintf(phys_pkg_path, "%s%d/topology/physical_package_id",
- PHYS_ID_PATH, cpu_no);
+ if (is_amd)
+ sprintf(phys_pkg_path, "%s%d/cache/index3/id",
+ PHYS_ID_PATH, cpu_no);
+ else
+ sprintf(phys_pkg_path, "%s%d/topology/physical_package_id",
+ PHYS_ID_PATH, cpu_no);
+
fp = fopen(phys_pkg_path, "r");
if (!fp) {
perror("Failed to open physical_package_id");