diff mbox

[RESEND] kvm-unit-tests: x86: pmu: call measure for every counter in check_counters_many

Message ID 1408569714-18225-1-git-send-email-chris.j.arges@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chris J Arges Aug. 20, 2014, 9:21 p.m. UTC
In the check_counters_many function measure was only being called on the last
counter, causing the pmu test to fail. This ensures that measure is called for
each counter in the array before calling verify_counter.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
---
 x86/pmu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

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);
 }