block: add accounting for zone append operation

Taking account of the new zone append write operation for zoned devices,
BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read,
write, flush).

Signed-off-by: Sam Li <faithilikerun@gmail.com>
Message-id: 20230508051916.178322-3-faithilikerun@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Sam Li 2023-05-08 13:19:14 +08:00 committed by Stefan Hajnoczi
parent 4f7366506a
commit 52eb76f4b1
7 changed files with 113 additions and 11 deletions

View file

@ -517,6 +517,7 @@ void qmp_block_latency_histogram_set(
bool has_boundaries, uint64List *boundaries,
bool has_boundaries_read, uint64List *boundaries_read,
bool has_boundaries_write, uint64List *boundaries_write,
bool has_boundaries_append, uint64List *boundaries_append,
bool has_boundaries_flush, uint64List *boundaries_flush,
Error **errp)
{
@ -557,6 +558,16 @@ void qmp_block_latency_histogram_set(
}
}
if (has_boundaries || has_boundaries_append) {
ret = block_latency_histogram_set(
stats, BLOCK_ACCT_ZONE_APPEND,
has_boundaries_append ? boundaries_append : boundaries);
if (ret) {
error_setg(errp, "Device '%s' set append write boundaries fail", id);
return;
}
}
if (has_boundaries || has_boundaries_flush) {
ret = block_latency_histogram_set(
stats, BLOCK_ACCT_FLUSH,