Skip to content

Commit 7144321

Browse files
committed
KVM: selftests: Print a more helpful message for EACCESS in access tracking test
Use open_path_or_exit() helper to probe /sys/kernel/mm/page_idle/bitmap in the access tracking perf test so that a helpful/pertinent SKIP message is printed if the file exists but is inaccessible, e.g. because the file has the kernel's default 0600 permissions. Cc: James Houghton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent ba300a7 commit 7144321

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/testing/selftests/kvm/access_tracking_perf_test.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -596,11 +596,8 @@ int main(int argc, char *argv[])
596596
if (ret)
597597
return ret;
598598
} else {
599-
page_idle_fd = open("/sys/kernel/mm/page_idle/bitmap", O_RDWR);
600-
__TEST_REQUIRE(page_idle_fd >= 0,
601-
"Couldn't open /sys/kernel/mm/page_idle/bitmap. "
602-
"Is CONFIG_IDLE_PAGE_TRACKING enabled?");
603-
599+
page_idle_fd = __open_path_or_exit("/sys/kernel/mm/page_idle/bitmap", O_RDWR,
600+
"Is CONFIG_IDLE_PAGE_TRACKING enabled?");
604601
close(page_idle_fd);
605602

606603
puts("Using page_idle for aging");

0 commit comments

Comments
 (0)