public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] increase perf kvm stat accuracy
@ 2014-07-31 11:13 Christian Borntraeger
  2014-07-31 11:13 ` [PATCH/RFC] KVM: perf/stat: Properly show submicrosecond times Christian Borntraeger
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Borntraeger @ 2014-07-31 11:13 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, David Ahern, Paolo Bonzini,
	linux-kernel, kvm, Christian Borntraeger

On my s390 kvm system most of the kvm exits are in the range
of 0 or 1 microseconds. Can we increase the accuracy by 2 
additional digits?

Opinions?


Christian Borntraeger (1):
  KVM: perf/stat: Properly show submicrosecond times

 tools/perf/builtin-kvm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH/RFC] KVM: perf/stat: Properly show submicrosecond times
  2014-07-31 11:13 [RFC] increase perf kvm stat accuracy Christian Borntraeger
@ 2014-07-31 11:13 ` Christian Borntraeger
  2014-07-31 14:24   ` David Ahern
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Borntraeger @ 2014-07-31 11:13 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, David Ahern, Paolo Bonzini,
	linux-kernel, kvm, Christian Borntraeger

For lots of exits the min time (and sometimes max) is 0 or 1. Lets
increase the accurancy similar to what the average field alread does.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 tools/perf/builtin-kvm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 43367eb..fe92dfd 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -592,8 +592,8 @@ static void print_result(struct perf_kvm_stat *kvm)
 	pr_info("%9s ", "Samples%");
 
 	pr_info("%9s ", "Time%");
-	pr_info("%10s ", "Min Time");
-	pr_info("%10s ", "Max Time");
+	pr_info("%11s ", "Min Time");
+	pr_info("%11s ", "Max Time");
 	pr_info("%16s ", "Avg time");
 	pr_info("\n\n");
 
@@ -610,8 +610,8 @@ static void print_result(struct perf_kvm_stat *kvm)
 		pr_info("%10llu ", (unsigned long long)ecount);
 		pr_info("%8.2f%% ", (double)ecount / kvm->total_count * 100);
 		pr_info("%8.2f%% ", (double)etime / kvm->total_time * 100);
-		pr_info("%8" PRIu64 "us ", min / 1000);
-		pr_info("%8" PRIu64 "us ", max / 1000);
+		pr_info("%9.2fus ", (double)min / 1e3);
+		pr_info("%9.2fus ", (double)max / 1e3);
 		pr_info("%9.2fus ( +-%7.2f%% )", (double)etime / ecount/1e3,
 			kvm_event_rel_stddev(vcpu, event));
 		pr_info("\n");
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] KVM: perf/stat: Properly show submicrosecond times
  2014-07-31 11:13 ` [PATCH/RFC] KVM: perf/stat: Properly show submicrosecond times Christian Borntraeger
@ 2014-07-31 14:24   ` David Ahern
  2014-07-31 14:43     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: David Ahern @ 2014-07-31 14:24 UTC (permalink / raw)
  To: Christian Borntraeger, Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, Paolo Bonzini, linux-kernel, kvm,
	Xiao Guangrong

On 7/31/14, 5:13 AM, Christian Borntraeger wrote:
> For lots of exits the min time (and sometimes max) is 0 or 1. Lets
> increase the accurancy similar to what the average field alread does.

Seems reasonable to me.

Acked-by: David Ahern <dsahern@gmail.com>


>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>   tools/perf/builtin-kvm.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
> index 43367eb..fe92dfd 100644
> --- a/tools/perf/builtin-kvm.c
> +++ b/tools/perf/builtin-kvm.c
> @@ -592,8 +592,8 @@ static void print_result(struct perf_kvm_stat *kvm)
>   	pr_info("%9s ", "Samples%");
>
>   	pr_info("%9s ", "Time%");
> -	pr_info("%10s ", "Min Time");
> -	pr_info("%10s ", "Max Time");
> +	pr_info("%11s ", "Min Time");
> +	pr_info("%11s ", "Max Time");
>   	pr_info("%16s ", "Avg time");
>   	pr_info("\n\n");
>
> @@ -610,8 +610,8 @@ static void print_result(struct perf_kvm_stat *kvm)
>   		pr_info("%10llu ", (unsigned long long)ecount);
>   		pr_info("%8.2f%% ", (double)ecount / kvm->total_count * 100);
>   		pr_info("%8.2f%% ", (double)etime / kvm->total_time * 100);
> -		pr_info("%8" PRIu64 "us ", min / 1000);
> -		pr_info("%8" PRIu64 "us ", max / 1000);
> +		pr_info("%9.2fus ", (double)min / 1e3);
> +		pr_info("%9.2fus ", (double)max / 1e3);
>   		pr_info("%9.2fus ( +-%7.2f%% )", (double)etime / ecount/1e3,
>   			kvm_event_rel_stddev(vcpu, event));
>   		pr_info("\n");
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC] KVM: perf/stat: Properly show submicrosecond times
  2014-07-31 14:24   ` David Ahern
@ 2014-07-31 14:43     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-31 14:43 UTC (permalink / raw)
  To: David Ahern
  Cc: Christian Borntraeger, Jiri Olsa, Paolo Bonzini, linux-kernel,
	kvm, Xiao Guangrong

Em Thu, Jul 31, 2014 at 08:24:03AM -0600, David Ahern escreveu:
> On 7/31/14, 5:13 AM, Christian Borntraeger wrote:
> >For lots of exits the min time (and sometimes max) is 0 or 1. Lets
> >increase the accurancy similar to what the average field alread does.
> 
> Seems reasonable to me.
> 
> Acked-by: David Ahern <dsahern@gmail.com>

Thanks, applied.

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-31 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 11:13 [RFC] increase perf kvm stat accuracy Christian Borntraeger
2014-07-31 11:13 ` [PATCH/RFC] KVM: perf/stat: Properly show submicrosecond times Christian Borntraeger
2014-07-31 14:24   ` David Ahern
2014-07-31 14:43     ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox