public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Chris J Arges <chris.j.arges@canonical.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] kvm-unit-tests: x86: pmu: call measure for every counter in check_counters_many
Date: Mon, 25 Aug 2014 18:45:38 +0200	[thread overview]
Message-ID: <53FB6832.6080800@redhat.com> (raw)
In-Reply-To: <1408049924-18848-1-git-send-email-chris.j.arges@canonical.com>

Il 14/08/2014 22:58, Chris J Arges ha scritto:
> In the check_counters_many function measure was only being called on the last
> counter, causing the pmu test to fail.

I don't understand.  measure loops on all N counters and calls
start_event (which in turn calls global_enable) and stop_event (which
calls global_disable) on all counters.

> This ensures that measure is called for
> each counter in the array before calling verify_counter.

Actually the point of this test is to run the loop while all the
counters are active, so this patch is just masking another bug.

Paolo

> Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
> ---
>  x86/pmu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/x86/pmu.c b/x86/pmu.c
> index 5c85146..3402d1e 100644
> --- a/x86/pmu.c
> +++ b/x86/pmu.c
> @@ -287,11 +287,11 @@ static void check_counters_many(void)
>  		n++;
>  	}
>  
> -	measure(cnt, n);
> -
> -	for (i = 0; i < n; i++)
> +	for (i = 0; i < n; i++) {
> +		measure(&cnt[i], 1);
>  		if (!verify_counter(&cnt[i]))
>  			break;
> +	}
>  
>  	report("all counters", i == n);
>  }
> 

  reply	other threads:[~2014-08-25 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-14 20:58 [PATCH] kvm-unit-tests: x86: pmu: call measure for every counter in check_counters_many Chris J Arges
2014-08-25 16:45 ` Paolo Bonzini [this message]
2014-08-25 17:47   ` Chris J Arges
2014-08-25 19:32     ` Paolo Bonzini
2014-08-25 19:38       ` Chris J Arges
2014-08-26 10:52         ` Paolo Bonzini

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=53FB6832.6080800@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=chris.j.arges@canonical.com \
    --cc=kvm@vger.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