Skip to contentSkip to conversation

Add summary to kvmclock test

PATCH New Amos Kong 1 participant 1 message Sep 7, 2010 KVM

lore
Share & tools
lore

Amos Kong

author
#0 lore raw

PATCH 1/1 Add summary to kvmclock test

This summary would be helpful when analyze test log

---

 0 files changed, 0 insertions(+), 0 deletions(-)
x86/kvmclock_test.c +6 -0
index 5b14ae2..97fe6b3 100644
@@ -19,12 +19,15 @@ struct test_info {
 };
 
 struct test_info ti[4];
+static int ntests;
 
 static int wallclock_test(long sec, long threshold)
 {
         long ksec, offset;
         struct timespec ts;
 
+	++ntests;
+
         printf("Wallclock test, threshold %ld\n", threshold);
         kvm_get_wallclock(&ts);
         ksec = ts.tv_sec;
@@ -87,6 +90,8 @@ static int cycle_test(int ncpus, long loops, int check, struct test_info *ti)
         int i;
         unsigned long long begin, end;
 
+	++ntests;
+
         begin = rdtsc();
 
         atomic_set(&ti->ncpus, ncpus);
@@ -162,5 +167,6 @@ int main(int ac, char **av)
         for (i = 0; i < ncpus; ++i)
                 on_cpu(i, kvm_clock_clear, (void *)0);
 
+	printf("\nsummary: %d tests, %d failures\n", ntests, nerr);
         return nerr > 0 ? 1 : 0;
 }