kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: KVM devel mailing list <kvm@vger.kernel.org>
Cc: Stuart Yoder <stuart.yoder@freescale.com>
Subject: [PATCH 3/6] KVM: PPC: use ticks, not usecs, for exit timing
Date: Tue,  3 May 2011 14:36:58 +0200	[thread overview]
Message-ID: <1304426221-23178-4-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1304426221-23178-1-git-send-email-agraf@suse.de>

From: Stuart Yoder <stuart.yoder@freescale.com>

Convert to microseconds when displaying
(with fix from Bharat Bhushan <Bharat.Bhushan@freescale.com>).

This reduces rounding error with large quantities of short exits.

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/timing.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c
index 18f40fd..319177d 100644
--- a/arch/powerpc/kvm/timing.c
+++ b/arch/powerpc/kvm/timing.c
@@ -151,17 +151,30 @@ static int kvmppc_exit_timing_show(struct seq_file *m, void *private)
 {
 	struct kvm_vcpu *vcpu = m->private;
 	int i;
+	u64 min, max, sum, sum_quad;
 
 	seq_printf(m, "%s", "type	count	min	max	sum	sum_squared\n");
 
+
 	for (i = 0; i < __NUMBER_OF_KVM_EXIT_TYPES; i++) {
+
+		min = vcpu->arch.timing_min_duration[i];
+		do_div(min, tb_ticks_per_usec);
+		max = vcpu->arch.timing_max_duration[i];
+		do_div(max, tb_ticks_per_usec);
+		sum = vcpu->arch.timing_sum_duration[i];
+		do_div(sum, tb_ticks_per_usec);
+		sum_quad = vcpu->arch.timing_sum_quad_duration[i];
+		do_div(sum_quad, tb_ticks_per_usec);
+
 		seq_printf(m, "%12s	%10d	%10lld	%10lld	%20lld	%20lld\n",
 			kvm_exit_names[i],
 			vcpu->arch.timing_count_type[i],
-			vcpu->arch.timing_min_duration[i],
-			vcpu->arch.timing_max_duration[i],
-			vcpu->arch.timing_sum_duration[i],
-			vcpu->arch.timing_sum_quad_duration[i]);
+			min,
+			max,
+			sum,
+			sum_quad);
+
 	}
 	return 0;
 }
-- 
1.6.0.2


  parent reply	other threads:[~2011-05-03 12:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 12:36 [PULL 0/6] PPC KVM patches Alexander Graf
2011-05-03 12:36 ` [PATCH 1/6] KVM: PPC: e500: emulate SVR Alexander Graf
2011-05-03 12:36 ` [PATCH 2/6] KVM: PPC: fix exit accounting for SPRs, tlbwe, tlbsx Alexander Graf
2011-05-03 12:36 ` Alexander Graf [this message]
2011-05-03 12:36 ` [PATCH 4/6] KVM: PPC: booke: save/restore VRSAVE (a.k.a. USPRG0) Alexander Graf
2011-05-03 12:37 ` [PATCH 5/6] KVM: PPC: booke: add sregs support Alexander Graf
2011-05-03 12:37 ` [PATCH 6/6] KVM: PPC: Add kvm headers to headers_install Alexander Graf
2011-05-03 14:20   ` Jan Kiszka
2011-05-03 14:36     ` Alexander Graf
2011-05-03 14:44       ` Jan Kiszka
2011-05-03 15:04         ` Alexander Graf
2011-05-03 15:10           ` Jan Kiszka
2011-05-03 15:14             ` Alexander Graf
2011-05-03 16:20               ` Scott Wood
2011-05-04  5:55                 ` Alexander Graf

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=1304426221-23178-4-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=stuart.yoder@freescale.com \
    /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;
as well as URLs for NNTP newsgroup(s).