[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 26/28] block/qcow2-refcount: add trace-point to qcow2
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 26/28] block/qcow2-refcount: add trace-point to qcow2_process_discards |
Date: |
Mon, 3 Jun 2019 17:02:31 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Let's at least trace ignored failure.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-refcount.c | 7 ++++++-
block/trace-events | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 3a2c673a5e..22cadd79d5 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -29,6 +29,7 @@
#include "qemu/range.h"
#include "qemu/bswap.h"
#include "qemu/cutils.h"
+#include "trace.h"
static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size,
uint64_t max);
@@ -737,7 +738,11 @@ void qcow2_process_discards(BlockDriverState *bs, int ret)
/* Discard is optional, ignore the return value */
if (ret >= 0) {
- bdrv_pdiscard(bs->file, d->offset, d->bytes);
+ int r2 = bdrv_pdiscard(bs->file, d->offset, d->bytes);
+ if (r2 < 0) {
+ trace_qcow2_process_discards_failed_region(d->offset, d->bytes,
+ r2);
+ }
}
g_free(d);
diff --git a/block/trace-events b/block/trace-events
index 1e0653ce6d..eab51497fc 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -92,6 +92,9 @@ qcow2_cache_get_done(void *co, int c, int i) "co %p
is_l2_cache %d index %d"
qcow2_cache_flush(void *co, int c) "co %p is_l2_cache %d"
qcow2_cache_entry_flush(void *co, int c, int i) "co %p is_l2_cache %d index %d"
+# qcow2-refcount.c
+qcow2_process_discards_failed_region(uint64_t offset, uint64_t bytes, int ret)
"offset 0x%" PRIx64 " bytes 0x%" PRIx64 " ret %d"
+
# qed-l2-cache.c
qed_alloc_l2_cache_entry(void *l2_cache, void *entry) "l2_cache %p entry %p"
qed_unref_l2_cache_entry(void *entry, int ref) "entry %p ref %d"
--
2.20.1
- [Qemu-block] [PULL 17/28] test-block-iothread: Test adding parent to iothread node, (continued)
- [Qemu-block] [PULL 17/28] test-block-iothread: Test adding parent to iothread node, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 19/28] block: Move node without parents to main AioContext, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 16/28] block: Adjust AioContexts when attaching nodes, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 20/28] blockdev: Use bdrv_try_set_aio_context() for monitor commands, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 22/28] virtio-scsi-test: Test attaching new overlay with iothreads, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 18/28] test-block-iothread: BlockBackend AioContext across root node change, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 21/28] block: Remove wrong bdrv_set_aio_context() calls, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 24/28] test-bdrv-drain: Use bdrv_try_set_aio_context(), Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 23/28] iotests: Attach new devices to node in non-default iothread, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 25/28] block: Remove bdrv_set_aio_context(), Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 26/28] block/qcow2-refcount: add trace-point to qcow2_process_discards,
Kevin Wolf <=
- [Qemu-block] [PULL 27/28] block/io: bdrv_pdiscard: support int64_t bytes parameter, Kevin Wolf, 2019/06/03
- [Qemu-block] [PULL 28/28] iotests: Fix duplicated diff output on failure, Kevin Wolf, 2019/06/03
- Re: [Qemu-block] [Qemu-devel] [PULL 00/28] Block layer patches, Peter Maydell, 2019/06/03
- Re: [Qemu-block] [Qemu-devel] [PULL 00/28] Block layer patches, no-reply, 2019/06/03