aperf: fail early if user may not access MSR. Based on a suggestion by Thomas Renninger. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
diff --git a/utils/aperf.c b/utils/aperf.c index 893e8eb..063f4a4 100644 --- a/utils/aperf.c +++ b/utils/aperf.c
@@ -403,7 +403,7 @@ return EXIT_FAILURE; } - ret = access(msr_path, F_OK); + ret = access(msr_path, R_OK); if (ret < 0) { fprintf(stderr, "Error reading %s, load/enable msr.ko\n", msr_path); goto out;