lkml.org 
[lkml]   [2010]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND] tools: add power/x86/turbostat - v2
On Mon, Nov 15, 2010 at 11:01:05AM -0500, Len Brown wrote:
> From: Len Brown <len.brown@intel.com>
>
> turbostat displays actual processor frequency on modern
> Intel processors. Note that this capability depends on free-running
> APERF and MPERF MSRs, which were cleared by the acpi_cpufreq
> driver up through Linux-2.6.29.

Why isn't cpufreq-aperf sufficient for showing the actual frequency?
The tool can handle both AMD and Intel CPUs.

There is a CPUID flag which can be checked for APERF/MPERF existence,
no need to enforce a general vendor check like this:

$ ./turbostat
CPUID: AuthenticAMD != GenuineIntel

> On Intel Core i3/i5/i7 (Nehalem) and newer processors,
> turbostat displays residency in idle power saving states.

Can't this be added to cpuidle-info (see branch cpupowerutils in
git://git.kernel.org/pub/scm/utils/kernel/cpufreq/cpufrequtils.git)?

BTW, gcc v4.4 throws several warnings when compiling your
code:

linux-2.6/tools/power/x86/turbostat $ make
cc -Wall turbostat.c -o turbostat
turbostat.c: In function ‘get_msr’:
turbostat.c:234: warning: implicit declaration of function ‘pread’
turbostat.c:237: warning: format ‘%x’ expects type ‘unsigned int’, but argument 4 has type ‘off_t’
turbostat.c:237: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘ssize_t’
turbostat.c: In function ‘print_counters’:
turbostat.c:368: warning: unused variable ‘i’
turbostat.c: In function ‘compute_average’:
turbostat.c:508: warning: unused variable ‘i’
turbostat.c: In function ‘insert_cpu_counters’:
turbostat.c:642: warning: unused variable ‘next’
turbostat.c: In function ‘re_initialize’:
turbostat.c:747: warning: implicit declaration of function ‘for_all_cpus’
turbostat.c: In function ‘turbostat_loop’:
turbostat.c:779: warning: unused variable ‘retval’
turbostat.c: In function ‘check_cpuid’:
turbostat.c:868: warning: format ‘%.4s’ expects type ‘char *’, but argument 3 has type ‘unsigned int *’
turbostat.c:868: warning: format ‘%.4s’ expects type ‘char *’, but argument 4 has type ‘unsigned int *’
turbostat.c:868: warning: format ‘%.4s’ expects type ‘char *’, but argument 5 has type ‘unsigned int *’
turbostat.c:870: warning: implicit declaration of function ‘strncmp’
turbostat.c: At top level:
turbostat.c:912: warning: return type defaults to ‘int’
turbostat.c: In function ‘dir_filter’:
turbostat.c:957: warning: implicit declaration of function ‘isdigit’
turbostat.c: In function ‘turbostat_init’:
turbostat.c:1004: warning: unused variable ‘i’
turbostat.c: In function ‘fork_it’:
turbostat.c:1038: warning: implicit declaration of function ‘waitpid’
turbostat.c: In function ‘usage’:
turbostat.c:915: warning: control reaches end of non-void function
turbostat.c: In function ‘compute_delta’:
turbostat.c:401: warning: ‘i’ may be used uninitialized in this function


Regards,
Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-11-16 11:31    [from the cache]
©2003-2011 Jasper Spaans