All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: linux@dominikbrodowski.net
Cc: cpufreq@vger.kernel.org, herrmann.der.user@googlemail.com
Subject: Re: [PATCH 4/4] cpufreq-aperf: mperf might tick faster than expected, esp on Intel
Date: Tue, 1 Feb 2011 16:25:13 +0100	[thread overview]
Message-ID: <201102011625.13898.trenn@suse.de> (raw)
In-Reply-To: <7043858684c755c587d032735f35e5df5e0f624c.1296572755.git.trenn@suse.de>

I sent an old/broken patch (4/4).

This one is better:

cpufreq-aperf: mperf might tick faster than expected, esp on Intel

fixes lines like that:

CPU     Average freq(KHz)  Time in C0      Time in Cx      C0 percentage
000     2601300            05 sec 004 ms   8155059272 sec 192 ms   100


Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: Dominik Brodowski <linux@dominikbrodowski.net>
CC: cpufreq@vger.kernel.org

---
 utils/cpufreq-aperf.c |    5 ++-
 6 files changed, 293 insertions(+), 211 deletions(-)

--- a/utils/cpufreq-aperf.c
+++ b/utils/cpufreq-aperf.c
@@ -153,7 +153,10 @@ static int get_C_state_time(struct timeval time_diff, uint64_t mperf_diff,
 	expected_ticks = max_freq * overall_msecs;
 	*percent = (mperf_diff * 100) / expected_ticks;
 
-	cx_time = (expected_ticks - mperf_diff) / max_freq;
+	if (mperf_diff > expected_ticks)
+		cx_time = 0;
+	else
+		cx_time = (expected_ticks - mperf_diff) / max_freq;
 	c0_time = mperf_diff / max_freq;
 
 	CX_time->tv_sec  = cx_time / 1000;

      reply	other threads:[~2011-02-01 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 15:11 [PATCH 0/4] Add some AMD boost state info and tiny fixes Thomas Renninger
2011-02-01 15:11 ` [PATCH 1/4] libcpupower/cpufreq-info: Add basic functions to detect AMD CPB information Thomas Renninger
2011-02-01 15:11 ` [PATCH 2/4] Make linking quiet again Thomas Renninger
2011-02-01 15:11 ` [PATCH 3/4] libcpupower: libcpufreq: Provide boost information also for AMD family 12h and 15h Thomas Renninger
2011-02-02 19:07   ` Andreas Herrmann
2011-02-01 15:11 ` [PATCH 4/4] cpufreq-aperf: mperf might tick faster than expected, esp on Intel Thomas Renninger
2011-02-01 15:25   ` Thomas Renninger [this message]

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=201102011625.13898.trenn@suse.de \
    --to=trenn@suse.de \
    --cc=cpufreq@vger.kernel.org \
    --cc=herrmann.der.user@googlemail.com \
    --cc=linux@dominikbrodowski.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.