All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm-unit-tests: x86: pmu: call measure for every counter in check_counters_many
@ 2014-08-14 20:58 Chris J Arges
  2014-08-25 16:45 ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Chris J Arges @ 2014-08-14 20:58 UTC (permalink / raw)
  To: kvm; +Cc: Chris J Arges

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


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

end of thread, other threads:[~2014-08-26 10:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.