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.