From 4d023a7913a52cd94b56876ec35cdc01d5dfcc31 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Fri, 30 Apr 2010 09:51:01 +0200 Subject: cpufrequtils aperf: MSR not readable differentiation Tell the user whether he has to load the msr driver or whether he has to be root to be able to read things. Remove exclamation mark in output. Signed-off-by: Thomas Renninger Acked-by: Borislav Petkov Signed-off-by: Dominik Brodowski --- utils/aperf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/aperf.c b/utils/aperf.c index c5ceb4b..627fb17 100644 --- a/utils/aperf.c +++ b/utils/aperf.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -396,8 +397,13 @@ int main(int argc, char *argv[]) } } + if (getuid() != 0) { + fprintf(stderr, "You must be root\n"); + return EXIT_FAILURE; + } + if (!cpu_has_effective_freq()) { - fprintf(stderr, "CPU doesn't support APERF/MPERF!\n"); + fprintf(stderr, "CPU doesn't support APERF/MPERF\n"); return EXIT_FAILURE; } -- cgit 1.2.3-korg