From patchwork Tue Sep 7 23:38:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 162391 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o87NcXpY003134 for ; Tue, 7 Sep 2010 23:38:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756641Ab0IGXi3 (ORCPT ); Tue, 7 Sep 2010 19:38:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49342 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756557Ab0IGXi2 (ORCPT ); Tue, 7 Sep 2010 19:38:28 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o87NcSGm018686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 7 Sep 2010 19:38:28 -0400 Received: from [127.0.1.1] (vpn2-10-232.sin2.redhat.com [10.67.10.232]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o87NcAuZ011023; Tue, 7 Sep 2010 19:38:12 -0400 Subject: [PATCH] [KVM-Unit-Tests] Add summary to kvmclock test To: avi@redhat.com From: Amos Kong Cc: jasowang@redhat.com, kvm@vger.kernel.org Date: Wed, 08 Sep 2010 07:38:10 +0800 Message-ID: <20100907233810.3210.15046.stgit@z> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 07 Sep 2010 23:38:34 +0000 (UTC) diff --git a/x86/kvmclock_test.c b/x86/kvmclock_test.c index 5b14ae2..97fe6b3 100644 --- a/x86/kvmclock_test.c +++ b/x86/kvmclock_test.c @@ -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; }