From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC kvm-unit-tests] api: Add dirty logging performance test Date: Sun, 08 Jan 2012 16:54:27 +0200 Message-ID: <4F09AE23.5070101@redhat.com> References: <20120108225852.7c51724ce86f312b8e6b36f9@gmail.com> <4F09A654.6020408@redhat.com> <20120108234925.f3cd34c9ead6ad9c3e07b980@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25085 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753468Ab2AHOyb (ORCPT ); Sun, 8 Jan 2012 09:54:31 -0500 In-Reply-To: <20120108234925.f3cd34c9ead6ad9c3e07b980@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 01/08/2012 04:49 PM, Takuya Yoshikawa wrote: > > > + > > > + gettimeofday(&start_time, NULL); > > > + slot.update_dirty_log(); > > > + gettimeofday(&end_time, NULL); > > > > Nicer to have a function that returns time in nanoseconds. > > I don't know such an API which can be used in userspace. static uint64_t time_ns() { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * (uint64_t)1000000000 + tv.tv_usec * 1000; } (that's not nanosecond precision, but it gives a single number instead of a pair; there's also clock_gettime() that does have nanosecond precision). > If we can use nano-precision timer, I want to check other things > too, e.g. emulation. > -- error compiling committee.c: too many arguments to function