From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMevh-0005KV-6v for qemu-devel@nongnu.org; Wed, 27 Aug 2014 11:14:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMevc-0006GR-3W for qemu-devel@nongnu.org; Wed, 27 Aug 2014 11:14:33 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:41354 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMevb-0006GK-TE for qemu-devel@nongnu.org; Wed, 27 Aug 2014 11:14:28 -0400 Date: Wed, 27 Aug 2014 17:13:38 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140827151338.GL31176@irqsave.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] block IO latency tracker without using QMP socket. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anshul Makkar Cc: qemu-devel The Wednesday 27 Aug 2014 =E0 16:58:12 (+0200), Anshul Makkar wrote : > Hi, >=20 > I am writing a block IO latency tracker. >=20 > As obvious, I am calculating the latency by tracking the interval betw= een > start of IO and end of IO. > (firing my latency tracker from function BlockDriverAIOCB *raw_aio_subm= it() > raw-posix.c when job is submitted). Are you sure that your user want to measure latency in this place. In fact there is a lot of work done before requests reach raw-posix.c so the numbers you have may be smaller than the reality. In QEMU IO statistics are collected near the guest in the block device mo= del so the statitics are close to what the guest would measure. >=20 > The latency data per QEMU process will be written to shared memory and = then > another app uses this shared memory to read the data. That's a simple > architecture. Why not simply writting periodically a json report (qemu has code to writ= e json) into a char device (pipe, tcp socket etc) QEMU support (Markus's idea) ? >=20 > Can't use "info blockstats" QMP command as qmp socket is used and block= ed > by some other process in our subsystem. Libvirt can work as a proxy to passthrough simple QMP commands to QEMU. I think this approach is better than having two different programs manipu= lating separate QMP sockets because only one program really accessing QMP means = coherency can be enforced. For example libvirt or the program acting as a proxy could whitelist QMP = methods that are safe to use and do not risk to confuse libvirt state machine. (Preventing of modifying QEMU state in libvirt's back) >=20 > Just want a suggestion whether my approach is correct given the constra= int > that I can't use qmp socket or if any alternative is possible. Best regards Beno=EEt >=20 > Thanks > Anshul Makkar > www.justkernel.com