Skip to content

Commit a3611fb

Browse files
Fenghua Yushuahkh
authored andcommitted
selftests/resctrl: Check for resctrl mount point only if resctrl FS is supported
check_resctrlfs_support() does the following 1. Checks if the platform supports resctrl file system or not by looking for resctrl in /proc/filesystems 2. Calls opendir() on default resctrl file system path (i.e. /sys/fs/resctrl) 3. Checks if resctrl file system is mounted or not by looking at /proc/mounts Steps 2 and 3 will fail if the platform does not support resctrl file system. So, there is no need to check for them if step 1 fails. Fix this by returning immediately if the platform does not support resctrl file system. Tested-by: Babu Moger <babu.moger@amd.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent b67a766 commit a3611fb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎tools/testing/selftests/resctrl/resctrlfs.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ bool check_resctrlfs_support(void)
570570
ksft_print_msg("%s kernel supports resctrl filesystem\n",
571571
ret ? "Pass:" : "Fail:");
572572

573+
if (!ret)
574+
return ret;
575+
573576
dp = opendir(RESCTRL_PATH);
574577
ksft_print_msg("%s resctrl mountpoint \"%s\" exists\n",
575578
dp ? "Pass:" : "Fail:", RESCTRL_PATH);

0 commit comments

Comments
 (0)