mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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 <jthoughton@google.com> Link: https://lore.kernel.org/r/20250516215909.2551628-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
@@ -596,11 +596,8 @@ int main(int argc, char *argv[])
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
page_idle_fd = open("/sys/kernel/mm/page_idle/bitmap", O_RDWR);
|
||||
__TEST_REQUIRE(page_idle_fd >= 0,
|
||||
"Couldn't open /sys/kernel/mm/page_idle/bitmap. "
|
||||
"Is CONFIG_IDLE_PAGE_TRACKING enabled?");
|
||||
|
||||
page_idle_fd = __open_path_or_exit("/sys/kernel/mm/page_idle/bitmap", O_RDWR,
|
||||
"Is CONFIG_IDLE_PAGE_TRACKING enabled?");
|
||||
close(page_idle_fd);
|
||||
|
||||
puts("Using page_idle for aging");
|
||||
|
||||
Reference in New Issue
Block a user