From patchwork Mon Nov 20 16:50:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10066767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9098B603FA for ; Mon, 20 Nov 2017 16:55:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8281429435 for ; Mon, 20 Nov 2017 16:55:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 762AE2943A; Mon, 20 Nov 2017 16:55:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C9D7D29439 for ; Mon, 20 Nov 2017 16:55:52 +0000 (UTC) Received: from localhost ([::1]:58246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGpMN-0006Yz-QL for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Nov 2017 11:55:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGpI3-0002f9-EF for qemu-devel@nongnu.org; Mon, 20 Nov 2017 11:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGpHz-0003pg-34 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 11:51:23 -0500 Received: from mail-eopbgr20093.outbound.protection.outlook.com ([40.107.2.93]:54656 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eGpHy-0003oW-O3; Mon, 20 Nov 2017 11:51:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=n3C9QSiPR/zk8ctQfyfK30CSa20w8BCZGTbN7SShY78=; b=cYcxner02OuLoujGvHKYC1CdI7br9c1I1KehsNA+c8QUBm63Jgb9G2B0ZyOUZ1/uJlFO4E1zp/Lch/0Vx9R8mBJ+XMU9NgWL4ldqntxa6tO2HoTtDYffZWZ3FDJipPctxc6HUxXetGT+R2+63BMSkQXSpzJrNoCFgyJI5BtPOto= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM5PR0801MB1988.eurprd08.prod.outlook.com (2603:10a6:203:4b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.239.5; Mon, 20 Nov 2017 16:51:16 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Mon, 20 Nov 2017 19:50:58 +0300 Message-Id: <1511196664-85304-2-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511196664-85304-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1511196664-85304-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0202CA0042.eurprd02.prod.outlook.com (2603:10a6:3:e4::28) To AM5PR0801MB1988.eurprd08.prod.outlook.com (2603:10a6:203:4b::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c5df26c-9284-426f-3b92-08d53036eaf3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603258); SRVR:AM5PR0801MB1988; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1988; 3:Ias/iIeBs6ePG9Ckm4p10XMZKPAN95Ul4/4rUGWENTfgcbusPwR/ar0+dzO2hUCosSGmolLk59Jp3cJxEjqXWfQDGsbpJzFn2Dn1WgYFIZPpdYriaZpHSRLz3gOIIvbL+KHh694lMW7QODiwctUOJgH8fup/lng/9t6Z2QH+LQyy+EoQkJowM6B8lxAy+WCxCTtAsB+t+KB8k+C08DgFa1H7KDsZMvfgix33OLX+9DQ7OQGD6MTCAMru2cndp/V3; 25:jfeOK9Q10txwPtg9zJJ5eARZt9xBnLil/z+PX0/p5IMoL8mSs7o3NRx/MIW9T/4B/QMUcTL6mpmRw4iRtdUK7Hy7nAYiRwMng2zP274oxxck5GhCdaec3HkF/qcDS1Sm30SapIu+3uXTNcnjhhS1nGomb8pMsJib7+DyEqisp6cv816fCmGNLMvtIBKjp2v+oJ5cF5FW4sXG7EhBk566ZPR47Kg0Ed1498AJ4y9KcMa/mPstJ+vmWbtWAdgC7WfIEPqUXmsZEbj1p/JlS7UznkgeW0rF5X1G/Ywh7Yw74nLgOWc76AelE1TxVLqiptKXr5iX0+PossigBST9D2/TNg==; 31:gWmndPfMe1qb8BAMubJ50Ymt0cgPRUoZqUE6GLGCAp7kgW9ZM+PIyI9Vcap/H4s7SojoiiAFRFpQN4FK2yML1BdAIYO75+cIDs1nm8+BE8VR9TzOG/R0liYUw1XlYsg+lEq6R9B4n7LzdRdUSWbNw88RDj8dFeOiw1Lu2RdcqA17RS4J7Bc2ZBNb/FbfU3AgHrHFE/42OVXrlfV6wvdQWwuxvJTcWmrZCaazcced73Y= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1988: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1988; 20:IxhzbHCgLWbYjvxnyVl0zO4Q04jnG6NTk8j/gFejL1SCaoDHsEyPTfkY09pCQppSa5Qy/8yUMCkNC5mlkR5dxVekISHdNwcB+azf9M/+nXe+yx+S1ZEJKLe3hsIX8SMojFlYoYB3uIk+MlBaW9jMQvm/td+/0EK5FinQv8LRrjMHcwk/9GSYPx3q8zXOuDezjlfxq424HkdUi4U8OjmCPMFPGESjZaI9xOpmIwfW5L12N/THBVbkmUqWL8ugiRZXZzZ6lMFYopFXxgc5GIZD7TTgi589fAoS21+8sNqGcR+peapvWOU/7eSJ6A0bu/WhOzsWEhiRHMwzC8vxfmJvwYbPfnxdPIJqgYeNfnSMnXQGBIKB5GO4jJwKE8cEVLcwmANlnuZLJr0G6CoLDzkDADLoYY7BKP92h8djVkI6pYI=; 4:u8Xm+ZjAaoPaG8RdWUrPDBGVfYLoqWSLujDE/LN4emfgaJ1H/QhqS9frNwbEODZ6ZmG1YOo8Pupqw+P+ER4+bqef6CN5pWs9zkgmjBmo77BqkQ10PbAxvhqt0JEZanU0Eb4jdUSyp3u5Dqnor5POAB8pwWymbaK0W+WMFB0sKOhbldrvCC4/MsPWFDgYgUdK5VNNGq3Tlz353qTYttUfuDOO2p0oLg+YCTz6hisNqSQ1rajUBs2SL5kpKB66hxYs+PfCuGbbMDkL9xwccP05PA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(3231022)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0801MB1988; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0801MB1988; X-Forefront-PRVS: 04976078F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(376002)(346002)(189002)(199003)(6506006)(6486002)(25786009)(189998001)(6512007)(16586007)(86362001)(50226002)(478600001)(575784001)(316002)(68736007)(8936002)(69596002)(16526018)(50986999)(55236003)(76176999)(47776003)(5003940100001)(48376002)(50466002)(7736002)(305945005)(106356001)(101416001)(105586002)(66066001)(2906002)(3846002)(2950100002)(6666003)(53416004)(97736004)(5660300001)(107886003)(8676002)(81166006)(6116002)(33646002)(4326008)(81156014)(36756003)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1988; H:xantnef-ws.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1988; 23:uiNQFjX9ZQPHF83yo5v/NAdr4Cw0412F7HI0Gqa?= =?us-ascii?Q?K1WfSVwtg+mkQY7wGvYXcqSLq3YiHtaE88cx1JfCsCQjObajEVAV2KCpvzqH?= =?us-ascii?Q?MzNX/D/lBYIrV7qhiWhVHs03ZZrP6XrYiAVKARdxv/5LauWiNcKu0OX6icnm?= =?us-ascii?Q?fIEJQorkDm7652MjyNzSOLQSEhP/pyAREI4O2Li25MidG+ShuEU0p2H788KO?= =?us-ascii?Q?tWnkynl3mbYjU2SPX5znXNsk2Y/MTY4eMaaDec0/5g+Qxi4Buf3HMwjhwVmp?= =?us-ascii?Q?5KvCR50+mLF+8CRSlnRFzP8LzWweEpLrDmMS8UjTJzf7dF7Dbqx8/jIO/4Y7?= =?us-ascii?Q?6nHELNwf6df4fo1E6BM0R+2niBy+YsrSvmAFawLomcw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tZe6Vubu0Hfx497X/EGLnbymMU15HQtU1xhNuE61a2cgN6CJPXtg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2017 16:51:16.3938 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c5df26c-9284-426f-3b92-08d53036eaf3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1988 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.2.93 Subject: [Qemu-devel] [PATCH 1/7] qapi: add unmap to BlockDeviceStats X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Anton Nefedov , den@virtuozzo.com, armbru@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- qapi/block-core.json | 20 ++++++++++++++++++++ include/block/accounting.h | 1 + block/qapi.c | 6 ++++++ 3 files changed, 27 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index 76bf50f..ba2705d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -730,6 +730,23 @@ # @timed_stats: Statistics specific to the set of previously defined # intervals of time (Since 2.5) # +# @unmap_bytes: The number of bytes unmapped by the device (Since 2.12) +# +# @unmap_operations: The number of unmap operations performed by the device +# (Since 2.12) +# +# @unmap_total_time_ns: Total time spent on unmap operations in nano-seconds +# (Since 2.12) +# +# @unmap_merged: Number of unmap requests that have been merged into another +# request (Since 2.12) +# +# @failed_unmap_operations: The number of failed unmap operations performed +# by the device (Since 2.12) +# +# @invalid_unmap_operations: The number of invalid unmap operations performed +# by the device (Since 2.12) +# # Since: 0.14.0 ## { 'struct': 'BlockDeviceStats', @@ -741,6 +758,9 @@ 'failed_rd_operations': 'int', 'failed_wr_operations': 'int', 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'int', + 'unmap_bytes' : 'int', 'unmap_operations': 'int', + 'unmap_total_time_ns': 'int', 'unmap_merged': 'int', + 'failed_unmap_operations': 'int', 'invalid_unmap_operations': 'int', 'account_invalid': 'bool', 'account_failed': 'bool', 'timed_stats': ['BlockDeviceTimedStats'] } } diff --git a/include/block/accounting.h b/include/block/accounting.h index b833d26..4e53c4a 100644 --- a/include/block/accounting.h +++ b/include/block/accounting.h @@ -35,6 +35,7 @@ enum BlockAcctType { BLOCK_ACCT_READ, BLOCK_ACCT_WRITE, BLOCK_ACCT_FLUSH, + BLOCK_ACCT_UNMAP, BLOCK_MAX_IOTYPE, }; diff --git a/block/qapi.c b/block/qapi.c index fc10f0a..6e110f2 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -396,24 +396,30 @@ static void bdrv_query_blk_stats(BlockDeviceStats *ds, BlockBackend *blk) ds->rd_bytes = stats->nr_bytes[BLOCK_ACCT_READ]; ds->wr_bytes = stats->nr_bytes[BLOCK_ACCT_WRITE]; + ds->unmap_bytes = stats->nr_bytes[BLOCK_ACCT_UNMAP]; ds->rd_operations = stats->nr_ops[BLOCK_ACCT_READ]; ds->wr_operations = stats->nr_ops[BLOCK_ACCT_WRITE]; + ds->unmap_operations = stats->nr_ops[BLOCK_ACCT_UNMAP]; ds->failed_rd_operations = stats->failed_ops[BLOCK_ACCT_READ]; ds->failed_wr_operations = stats->failed_ops[BLOCK_ACCT_WRITE]; ds->failed_flush_operations = stats->failed_ops[BLOCK_ACCT_FLUSH]; + ds->failed_unmap_operations = stats->failed_ops[BLOCK_ACCT_UNMAP]; ds->invalid_rd_operations = stats->invalid_ops[BLOCK_ACCT_READ]; ds->invalid_wr_operations = stats->invalid_ops[BLOCK_ACCT_WRITE]; ds->invalid_flush_operations = stats->invalid_ops[BLOCK_ACCT_FLUSH]; + ds->invalid_unmap_operations = stats->invalid_ops[BLOCK_ACCT_UNMAP]; ds->rd_merged = stats->merged[BLOCK_ACCT_READ]; ds->wr_merged = stats->merged[BLOCK_ACCT_WRITE]; + ds->unmap_merged = stats->merged[BLOCK_ACCT_UNMAP]; ds->flush_operations = stats->nr_ops[BLOCK_ACCT_FLUSH]; ds->wr_total_time_ns = stats->total_time_ns[BLOCK_ACCT_WRITE]; ds->rd_total_time_ns = stats->total_time_ns[BLOCK_ACCT_READ]; ds->flush_total_time_ns = stats->total_time_ns[BLOCK_ACCT_FLUSH]; + ds->unmap_total_time_ns = stats->total_time_ns[BLOCK_ACCT_UNMAP]; ds->has_idle_time_ns = stats->last_access_time_ns > 0; if (ds->has_idle_time_ns) {