From nobody Sat May 4 16:20:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1685602845; cv=none; d=zohomail.com; s=zohoarc; b=djDZd5ZTJiYGS4IsACI7sqocK5v+B7wX4B+hehtvop8S7/Cfl+DDs8ThpZLQGOrsjpAKN5+zc/RJDvxH+FzxTYbl5tC52ukHzd1STTWKX67f/ebiYGREMaMebF5qleMomaPW1e0eEb5Xg4kZEkERE9eN7L4phZgsdA7DzC3ovkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685602845; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=lSHyehWlC5Qcuj6Ybi9f2sLbgpuGGxdQkLpcRRINFfM=; b=V95r3YZB7v5YiLKPguKXHgucc5f0qy1u0Dgs2+2wETI8t5KNbzfTQtVXCtYrii/FwR+AxT6BIElFIKbWnouJXFMyu7u4BRoKtybfOr8da21tJdoXJjehAvBrkoZWXlYHbpp7OeYd7ZzFqDXHDBo7qEGhGH9qssi1QZnVSsuHUNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685602845587898.964541749485; Thu, 1 Jun 2023 00:00:45 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-119-4cGHMGK1OaGfdVyXPHYKAw-1; Thu, 01 Jun 2023 03:00:39 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 265E01C0A586; Thu, 1 Jun 2023 07:00:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4BC7492B00; Thu, 1 Jun 2023 07:00:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7FC5B194343B; Thu, 1 Jun 2023 07:00:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CBD1219451E5 for ; Thu, 1 Jun 2023 07:00:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A9C6240BB2D; Thu, 1 Jun 2023 07:00:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A26CE492B00 for ; Thu, 1 Jun 2023 07:00:33 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B208438294A0 for ; Thu, 1 Jun 2023 07:00:33 +0000 (UTC) Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-xdQnVfGoOv2LXffs3ZPwlA-1; Thu, 01 Jun 2023 03:00:31 -0400 Received: from [192.168.16.30] (helo=dv.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1q4c2n-004bkz-2F; Thu, 01 Jun 2023 08:44:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685602844; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lSHyehWlC5Qcuj6Ybi9f2sLbgpuGGxdQkLpcRRINFfM=; b=d6WYZre8ycakHLfuDrzGy3qwdJZdXlCWFdRuiOnXETpmb9rynDKJFK7EHSCQNqgpTTo4sK jI+n1fUYiuyQT0/f6rqkyszVoD7aw8QKCtyK1Ndsb1AYU9HIWgvUiB2SToF6W54yFXlQH1 rm5T+bSAtFt89M/Fzm5nm9fARmUCJQg= X-MC-Unique: 4cGHMGK1OaGfdVyXPHYKAw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: xdQnVfGoOv2LXffs3ZPwlA-1 From: Oleg Vasilev To: libvir-list@redhat.com Subject: [PATCH] qemu: add unmap stats to all domain stats Date: Thu, 1 Jun 2023 12:44:19 +0600 Message-Id: <20230601064419.709229-1-oleg.vasilev@virtuozzo.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oleg Vasilev , Den Lunev , Nikolay Shirokovskiy Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: virtuozzo.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685602847442100001 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Nikolay Shirokovskiy Unmap stats are useful for debugging how efficient qemu is in freeing host disk space. Signed-off-by: Oleg Vasilev --- src/qemu/qemu_driver.c | 3 +++ src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5ee15bab7a..6725bddff9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17451,6 +17451,9 @@ qemuDomainGetStatsBlockExportFrontend(const char *f= rontendname, virTypedParamListAddULLong(par, en->wr_req, "block.%zu.wr.reqs", i= dx) < 0 || virTypedParamListAddULLong(par, en->wr_bytes, "block.%zu.wr.bytes"= , idx) < 0 || virTypedParamListAddULLong(par, en->wr_total_times, "block.%zu.wr.= times", idx) < 0 || + virTypedParamListAddULLong(par, en->unmap_req, "block.%zu.un.reqs"= , idx) < 0 || + virTypedParamListAddULLong(par, en->unmap_bytes, "block.%zu.un.byt= es", idx) < 0 || + virTypedParamListAddULLong(par, en->unmap_total_times, "block.%zu.= un.times", idx) < 0 || virTypedParamListAddULLong(par, en->flush_req, "block.%zu.fl.reqs"= , idx) < 0 || virTypedParamListAddULLong(par, en->flush_total_times, "block.%zu.= fl.times", idx) < 0) return -1; diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 72db0c0838..0c34319ea2 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -667,6 +667,9 @@ struct _qemuBlockStats { unsigned long long wr_total_times; unsigned long long flush_req; unsigned long long flush_total_times; + unsigned long long unmap_req; + unsigned long long unmap_bytes; + unsigned long long unmap_total_times; unsigned long long capacity; unsigned long long physical; =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index b2c0b20a11..c0fe4a7554 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2280,6 +2280,9 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValue *de= v, QEMU_MONITOR_BLOCK_STAT_GET("wr_total_time_ns", bstats->wr_total_times= , false); QEMU_MONITOR_BLOCK_STAT_GET("flush_operations", bstats->flush_req, fal= se); QEMU_MONITOR_BLOCK_STAT_GET("flush_total_time_ns", bstats->flush_total= _times, false); + QEMU_MONITOR_BLOCK_STAT_GET("unmap_operations", bstats->unmap_req, fal= se); + QEMU_MONITOR_BLOCK_STAT_GET("unmap_bytes", bstats->unmap_bytes, false); + QEMU_MONITOR_BLOCK_STAT_GET("unmap_total_time_ns", bstats->unmap_total= _times, false); #undef QEMU_MONITOR_BLOCK_STAT_GET =20 if ((parent =3D virJSONValueObjectGetObject(dev, "parent")) && --=20 2.40.1