diff options
author | Stuart Yoder <stuart.yoder@freescale.com> | 2011-03-28 16:01:56 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:47:49 -0400 |
commit | 1a040b26c5c915b317103b87ae7006d40443f197 (patch) | |
tree | 264b19e5489bfc6baab352d5353a236784cf3008 /arch/powerpc/kvm | |
parent | 49ea06957bf637b28aa338fba26432d5bafdeb99 (diff) |
KVM: PPC: use ticks, not usecs, for exit timing
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>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | 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 18f40fd3e98f..319177df9587 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) | |||
151 | { | 151 | { |
152 | struct kvm_vcpu *vcpu = m->private; | 152 | struct kvm_vcpu *vcpu = m->private; |
153 | int i; | 153 | int i; |
154 | u64 min, max, sum, sum_quad; | ||
154 | 155 | ||
155 | seq_printf(m, "%s", "type count min max sum sum_squared\n"); | 156 | seq_printf(m, "%s", "type count min max sum sum_squared\n"); |
156 | 157 | ||
158 | |||
157 | for (i = 0; i < __NUMBER_OF_KVM_EXIT_TYPES; i++) { | 159 | for (i = 0; i < __NUMBER_OF_KVM_EXIT_TYPES; i++) { |
160 | |||
161 | min = vcpu->arch.timing_min_duration[i]; | ||
162 | do_div(min, tb_ticks_per_usec); | ||
163 | max = vcpu->arch.timing_max_duration[i]; | ||
164 | do_div(max, tb_ticks_per_usec); | ||
165 | sum = vcpu->arch.timing_sum_duration[i]; | ||
166 | do_div(sum, tb_ticks_per_usec); | ||
167 | sum_quad = vcpu->arch.timing_sum_quad_duration[i]; | ||
168 | do_div(sum_quad, tb_ticks_per_usec); | ||
169 | |||
158 | seq_printf(m, "%12s %10d %10lld %10lld %20lld %20lld\n", | 170 | seq_printf(m, "%12s %10d %10lld %10lld %20lld %20lld\n", |
159 | kvm_exit_names[i], | 171 | kvm_exit_names[i], |
160 | vcpu->arch.timing_count_type[i], | 172 | vcpu->arch.timing_count_type[i], |
161 | vcpu->arch.timing_min_duration[i], | 173 | min, |
162 | vcpu->arch.timing_max_duration[i], | 174 | max, |
163 | vcpu->arch.timing_sum_duration[i], | 175 | sum, |
164 | vcpu->arch.timing_sum_quad_duration[i]); | 176 | sum_quad); |
177 | |||
165 | } | 178 | } |
166 | return 0; | 179 | return 0; |
167 | } | 180 | } |