qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 07/22] block: Add statistics for failed and i


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations
Date: Tue, 13 Oct 2015 16:42:33 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]