Received: from eggs.gnu.org ([2001:4830:134:3::10]:38338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWmaS-0000LF-Ue for qemu-devel@nongnu.org; Wed, 24 Sep 2014 09:26:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWmaN-0007Ia-OC for qemu-devel@nongnu.org; Wed, 24 Sep 2014 09:26:28 -0400 Received: from dew.nodalink.com ([95.130.14.197]:60602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWmaN-0007Gv-Ik for qemu-devel@nongnu.org; Wed, 24 Sep 2014 09:26:23 -0400 Date: Wed, 24 Sep 2014 13:26:35 +0000 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140924132635.GA18369@nodalink.com> References: <1410178693-23370-1-git-send-email-benoit.canet@nodalink.com> <1410178693-23370-4-git-send-email-benoit.canet@nodalink.com> <540DBD46.7030207@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <540DBD46.7030207@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 3/3] util: Add an utility infrastructure used to compute an average on a time slice List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, =?iso-8859-1?Q?Beno=EEt?= Canet On Mon, Sep 08, 2014 at 04:29:26PM +0200, Paolo Bonzini wrote: > Il 08/09/2014 14:18, Beno=EEt Canet ha scritto: > > The algorithm used was defined on the list while discussing the new I= O accounting > > overhaul. > > See http://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04954.= html > >=20 > > Also the module takes care of computing minimal and maximal values ov= er the time > > slice duration. > >=20 > > Signed-off-by: Beno=EEt Canet >=20 > If you add >=20 > int64_t cpu_get_clock(void) > { > return my_clock_value; > } >=20 > to the test, and use a QEMU_CLOCK_VIRTUAL-based average, you should be > able to advance the clock directly in the test with no need for sleep() > and with 100% deterministic results. That's a really neat trick. Thanks