From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm1ir-0007Xi-F4 for qemu-devel@nongnu.org; Tue, 13 Oct 2015 11:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zm1ip-0001om-QC for qemu-devel@nongnu.org; Tue, 13 Oct 2015 11:42:40 -0400 Date: Tue, 13 Oct 2015 16:42:33 +0100 From: Stefan Hajnoczi Message-ID: <20151013154233.GJ3057@stefanha-thinkpad.redhat.com> References: <84322c385b597a29ec217efd7fe99560a0bbc5d8.1443793122.git.berto@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84322c385b597a29ec217efd7fe99560a0bbc5d8.1443793122.git.berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org, Max Reitz On Fri, Oct 02, 2015 at 05:26:17PM +0300, Alberto Garcia wrote: > +void block_acct_failed(BlockAcctStats *stats, BlockAcctCookie *cookie) > +{ > + int64_t time_ns = qemu_clock_get_ns(clock_type); > + > + assert(cookie->type < BLOCK_MAX_IOTYPE); > + > + stats->failed_ops[cookie->type]++; > + stats->total_time_ns[cookie->type] += time_ns - cookie->start_time_ns; > + stats->last_access_time_ns = time_ns; > +} > + > +void block_acct_invalid(BlockAcctStats *stats, enum BlockAcctType type) > +{ > + assert(type < BLOCK_MAX_IOTYPE); > + > + stats->invalid_ops[type]++; > + stats->last_access_time_ns = qemu_clock_get_ns(clock_type); > +} block_acct_failed() updates total_time_ns[] but block_acct_invalid() does not. I guess that's because block_acct_invalid() is expected to happen during request submission and has effectively 0 duration? This deserves a comment.