From patchwork Wed Jan 16 15:48:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,V5,37/62] qcow2: Add deduplication metrics structures. From: =?utf-8?q?Beno=C3=AEt_Canet?= X-Patchwork-Id: 212837 Message-Id: <1358351321-4891-38-git-send-email-benoit@irqsave.net> To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@redhat.com Date: Wed, 16 Jan 2013 16:48:16 +0100 --- block/qcow2.h | 3 ++- include/block/block.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/block/qcow2.h b/block/qcow2.h index 29267a9..0729ff2 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -237,9 +237,10 @@ typedef struct BDRVQcowState { int32_t dedup_table_size; GTree *dedup_tree_by_hash; GTree *dedup_tree_by_sect; + CoMutex dedup_lock; + BlockDeduplicationMetrics dedup_metrics; CoMutex lock; - CoMutex dedup_lock; uint32_t crypt_method; /* current crypt method, 0 if no key yet */ uint32_t crypt_method_header; diff --git a/include/block/block.h b/include/block/block.h index b81d200..16e1cf1 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -12,6 +12,17 @@ typedef struct BlockDriver BlockDriver; typedef struct BlockJob BlockJob; +typedef struct { + uint64_t deduplicated_clusters; + uint64_t non_deduplicated_clusters; + uint64_t missing_data_reads; /* reads used to complete partials clusters */ + uint64_t ram_hash_creations; /* RAM based lookup */ + uint64_t ram_hash_deletions; /* RAM based lookup */ + uint64_t ram_usage; /* RAM usage in bytes */ + uint64_t deleted_clusters; /* number of deleted clusters */ + uint64_t refcount_overflows; /* number of refcount overflows */ +} BlockDeduplicationMetrics; + typedef struct BlockDriverInfo { /* in bytes, 0 if irrelevant */ int cluster_size;