mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Herrmann <herrmann.der.user@googlemail.com>
To: Len Brown <lenb@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	linux-pm@lists.linux-foundation.org, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] tools: add power/x86/turbostat - v2
Date: Tue, 16 Nov 2010 11:29:16 +0100	[thread overview]
Message-ID: <20101116102916.GA4305@alberich.amd.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1011151056380.2939@x980>

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

  parent reply	other threads:[~2010-11-16 10:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-23  5:31 [PATCH] tools: add power/x86/turbostat Len Brown
2010-10-24  4:06 ` [PATCH] tools: add power/x86/turbostat - v2 Len Brown
2010-10-27  3:14   ` [PATCH RESEND] " Len Brown
2010-11-15 16:01     ` Len Brown
2010-11-15 17:16       ` Otavio Salvador
2010-11-16 10:29       ` Andreas Herrmann [this message]
2010-11-17  6:44         ` Len Brown
2010-11-24  4:58       ` [PATCH v3] tools: create power/x86/turbostat Len Brown
2010-12-07  6:00         ` [PATCH v4] " Len Brown
2010-12-07 14:29           ` Thiago Farina
2011-02-11  4:43             ` Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101116102916.GA4305@alberich.amd.com \
    --to=herrmann.der.user@googlemail.com \
    --cc=gregkh@suse.de \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome