From patchwork Fri Jan 19 12:50:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10175197 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 E01A1601E7 for ; Fri, 19 Jan 2018 12:52:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D092A28696 for ; Fri, 19 Jan 2018 12:52:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3DEE28699; Fri, 19 Jan 2018 12:52:20 +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 1D17B28696 for ; Fri, 19 Jan 2018 12:52:20 +0000 (UTC) Received: from localhost ([::1]:47352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecW9b-0008RX-7S for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Jan 2018 07:52:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecW7x-0006uj-EW for qemu-devel@nongnu.org; Fri, 19 Jan 2018 07:50:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecW7w-0003B9-9c for qemu-devel@nongnu.org; Fri, 19 Jan 2018 07:50:37 -0500 Received: from mail-db5eur01on070e.outbound.protection.outlook.com ([2a01:111:f400:fe02::70e]:26048 helo=EUR01-DB5-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 1ecW7w-0003A7-1a; Fri, 19 Jan 2018 07:50:36 -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=g10+Lv3+OfA5bzD2rehKUouDC5a3Mphh8bB2LUsjhpA=; b=Jeobp2ejnDg0xf0s1EDuE1A47Ino20HtMQZ1wzLDsCyCR9LTexOj9rYlenJ4rGRJxE2mydrNmyVMInkpH3GsNtgPgZ6QUuWXna9IlbRk/LoNooAyNqfz244XXKYoPx2iwY9BIQv/d5FTTcV1reeOvZ4WJbA5IiuyQPyfTg03imo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB1999.eurprd08.prod.outlook.com (2603:10a6:800:8a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 19 Jan 2018 12:50:33 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Fri, 19 Jan 2018 15:50:07 +0300 Message-Id: <1516366207-109842-9-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516366207-109842-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1516366207-109842-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR0202CA0008.eurprd02.prod.outlook.com (2603:10a6:4:29::18) To VI1PR0801MB1999.eurprd08.prod.outlook.com (2603:10a6:800:8a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bac5fd51-17d9-4932-ced3-08d55f3b3b7f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0801MB1999; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 3:dRg6hRcC2bTJggB1pz9KNDea1/20+vsOdyaFSfKZjiBOzCS5jfslxLGqrwnE8f/61Jbdi7jaqQ+DZz/jBKGMYysE3CxzVN8vW4D+xMh+Bx6xPNSPmoeaDGunRPjZWUPxuDEXAbnIBwi2/qIpzyXI68547PRBf6Jwp0lKnRlOTUAYfd/Ii1UZOKFeFAmY+5cjipWNO0TliA2ZWuNWg2Jt4M+GXm33QFogHfe0kuu2s60XGqdbwc3lypIKcd99Gn+2; 25:58mPjr4/EBBr4bNVRH4edDCymoLdNe0m94HBKF68yi34qiqa7bLm8P4KN6NZ2NmyuZ5+64FKRa98+sTDAt8Lvd8XGNOB1bsshmO3EVjemHGuek3cqMfKFsSZ8+jW8j30MEA2VBEqtoaEXAnIitZM/y7gM1L7HGHVM7t5E99KtU5+wJL086OsE2oPewqw/SksstSlHefab07iWzTEJrRcxzLNXLfRjSbTPUX+GeTlA/A+IgQQCmNmmQAz+qkhfOSpwWInVe8n8Fodh+CV/QvvUaaAJ6d46FQwBomDTfnH6vb9HorGQzmHBM/89OF+dRNrQmOrZAiZ62JJLKtv4v7WUw==; 31:77duK5TeoJC9zhOO42hWSOfL1zlRkOjhqRfJpsaqghP6e/J/yF0cELx/YCMZpMVYI8nxxc60QnKaWWXfyi/rUmrzotBfL0dCshch8SqQAv40QLocVDbqpBXTaQMwPeYiM5Nq1//Ud4nOcj7MEKhlJ5tFtZ27+POHjECICEYT8ya8VS153+xSdYMxDfJCMJST1ypOsZKw1tTg9t5g3B/rihHv7j94jIew7WWZQlO3qE8= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1999: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 20:ZazHkjdy/VE9c2muX9bbtdtuYOAQDMz1FlTTSdfwJsXEQTHR61Q/nsD3WDd772dNML2cD5MXvBY6k3AB3vE0dRDh/GvPw08e018WnE3PsmawYN/5HWCbtlTmL9pJRs2n9sfp78CI2fGFioY8RwU1cpneQD8mB5Qfkq4sl1weJQ3RD7bKhqa+ln8HVBtb2W36wGA5Q6hhfU9ravK0fngfSg/RZWf7Lf2WyPSyQ4idtxMFwVDeh4toXCrx+F+3t3h5dMeC5Mdel4i9+k3JycxcVTdUOAS5iBW0wN6Krore5CZKYRJtNAafrgsM3+N8Y/yIDD1k3GuDSh7r7BfvSW92gPoQ7P8nOIuMC7sFOq1WVpDEqSJp8+OlJQBzI53bItNpaHE8c5FP0aO6fqDIGVSCSoCAM9seKBnCW2+QBLM6eBk=; 4:1xuLgq8iwTn1yvu1ZEv/0vdzEJTeLVMHUkADnZuSS1ppUAYMa5plo11r4xfgFNN8yMY/MYdoGElpGmJhwPndc51Qluxd/ksipsYyl/ZBjeCuzVTSJaO3NnQrV+LwKPHoUksPSXUULhCqWefUVnJXQcJICzvPnSH499/gAMBeNFn0htZUfWcTpAMbVUt0F0AfPLXLWbGK3NhtEqiBpETxMbG3Ieq3SYyf9ii7Y631vCAh7i1n+mLi+gQ/tRY+m4xI6BlnF8jCYO3XWailtQ6w0D9cafDxQjC9ury88fKuB9GnyssQsMWbMIJwbrIktHWl X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231023)(2400077)(944501161)(10201501046)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:VI1PR0801MB1999; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR0801MB1999; X-Forefront-PRVS: 0557CBAD84 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(346002)(39850400004)(376002)(396003)(39380400002)(189003)(199004)(16586007)(5660300001)(53936002)(6666003)(6916009)(6512007)(36756003)(2950100002)(53416004)(6116002)(69596002)(105586002)(6486002)(50466002)(48376002)(2361001)(3846002)(52116002)(81166006)(106356001)(2351001)(66066001)(305945005)(47776003)(107886003)(59450400001)(7736002)(81156014)(86362001)(6506007)(478600001)(8676002)(386003)(316002)(2906002)(16526018)(76176011)(4326008)(25786009)(50226002)(68736007)(51416003)(26005)(97736004)(8936002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1999; 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; VI1PR0801MB1999; 23:MdOAscSrY/UXxxTWYeuG12wGRFA+dDl53qhoJhV?= =?us-ascii?Q?MaF5tYDuDWs0PuJZUF4aerDLdj+0+EN12oAEQiykN+VhQ9UlW4Tgjx6AD6en?= =?us-ascii?Q?UiBbMkJgMKtFKiSoillJ/RXoU1FqwsBSX1SCAWUtQA8/renoSOlWJBi+jf8y?= =?us-ascii?Q?4dWc2jSrjMbS+0JlnzT0w8dG9Xsg4qiobQfqoZ0yZASwKK/shap0kC4VW13Q?= =?us-ascii?Q?kqGU+PV98bxui/rirPXnVF1ZobjI+uEIdoik20OReWsWLKX3S4gXmoSp4TN6?= =?us-ascii?Q?QGO7+5vsV3e2oC6Cptt/lFqvE+SEKTFiyZlDBRFabIkyfHt+6aYqx25gvG7v?= =?us-ascii?Q?M+RezA/1cgP/KRiz0Nd0RCTnQPk2DhtjxTtmR4Jwa9L7azyZEl27wZDtc6PG?= =?us-ascii?Q?n5yGHco03e/kk3GEINwz6nAVh9/g3i8vOk32CyVt7YLXIhsCS50mjSV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R4= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 12:50:33.7171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bac5fd51-17d9-4932-ced3-08d55f3b3b7f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1999 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe02::70e Subject: [Qemu-devel] [PATCH v2 8/8] qapi: query-blockstat: add driver specific file-posix stats 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, qemu-block@nongnu.org, 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 A block driver can provide a callback to report driver-specific statistics. file-posix driver now reports discard statistics Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 37 +++++++++++++++++++++++++++++++++++++ include/block/block.h | 1 + include/block/block_int.h | 1 + block.c | 9 +++++++++ block/file-posix.c | 21 +++++++++++++++++++++ block/qapi.c | 5 +++++ 6 files changed, 74 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index 3fa2d3a..0d9dc01 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -774,6 +774,40 @@ 'timed_stats': ['BlockDeviceTimedStats'] } } ## +# @BlockDriverStatsFile: +# +# File driver statistics +# +# @discard_nb_ok: The number of succeeded discard operations performed by +# the driver. +# +# @discard_nb_failed: The number of failed discard operations performed by +# the driver. +# +# @discard_bytes_ok: The number of bytes discarded by the driver. +# +# Since 2.12 +## +{ 'struct': 'BlockDriverStatsFile', + 'data': { + 'discard_nb_ok': 'int', + 'discard_nb_failed': 'int', + 'discard_bytes_ok': 'int' + } } + +## +# @BlockDriverStats: +# +# Statistics of a block driver (driver-specific) +# +# Since: 2.12 +## +{ 'union': 'BlockDriverStats', + 'data': { + 'file': 'BlockDriverStatsFile' + } } + +## # @BlockStats: # # Statistics of a virtual block device or a block backing device. @@ -785,6 +819,8 @@ # # @stats: A @BlockDeviceStats for the device. # +# @driver-stats: Optional driver-specific statistics. (Since 2.12) +# # @parent: This describes the file block device if it has one. # Contains recursively the statistics of the underlying # protocol (e.g. the host file for a qcow2 image). If there is @@ -798,6 +834,7 @@ { 'struct': 'BlockStats', 'data': {'*device': 'str', '*node-name': 'str', 'stats': 'BlockDeviceStats', + '*driver-stats': 'BlockDriverStats', '*parent': 'BlockStats', '*backing': 'BlockStats'} } diff --git a/include/block/block.h b/include/block/block.h index 9b12774..2f20697 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -473,6 +473,7 @@ const char *bdrv_get_device_or_node_name(const BlockDriverState *bs); int bdrv_get_flags(BlockDriverState *bs); int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs); +BlockDriverStats *bdrv_get_driver_stats(BlockDriverState *bs); void bdrv_round_to_clusters(BlockDriverState *bs, int64_t offset, int64_t bytes, int64_t *cluster_offset, diff --git a/include/block/block_int.h b/include/block/block_int.h index 29cafa4..6f56aeb 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -269,6 +269,7 @@ struct BlockDriver { Error **errp); int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *(*bdrv_get_specific_info)(BlockDriverState *bs); + BlockDriverStats *(*bdrv_get_stats)(BlockDriverState *bs); int coroutine_fn (*bdrv_save_vmstate)(BlockDriverState *bs, QEMUIOVector *qiov, diff --git a/block.c b/block.c index a8da4f2..8c03587 100644 --- a/block.c +++ b/block.c @@ -4062,6 +4062,15 @@ ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs) return NULL; } +BlockDriverStats *bdrv_get_driver_stats(BlockDriverState *bs) +{ + BlockDriver *drv = bs->drv; + if (!drv || !drv->bdrv_get_stats) { + return NULL; + } + return drv->bdrv_get_stats(bs); +} + void bdrv_debug_event(BlockDriverState *bs, BlkdebugEvent event) { if (!bs || !bs->drv || !bs->drv->bdrv_debug_event) { diff --git a/block/file-posix.c b/block/file-posix.c index 544ae58..3ab92e6 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2240,6 +2240,25 @@ static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) return 0; } +static BlockDriverStats *raw_get_stats(BlockDriverState *bs) +{ + BDRVRawState *s = bs->opaque; + BlockDriverStats *stats = g_new(BlockDriverStats, 1); + + *stats = (BlockDriverStats){ + .type = BLOCK_DRIVER_STATS_KIND_FILE, + .u.file.data = g_new(BlockDriverStatsFile, 1), + }; + + *stats->u.file.data = (BlockDriverStatsFile){ + .discard_nb_ok = s->stats.discard_nb_ok, + .discard_nb_failed = s->stats.discard_nb_failed, + .discard_bytes_ok = s->stats.discard_bytes_ok, + }; + + return stats; +} + static QemuOptsList raw_create_opts = { .name = "raw-create-opts", .head = QTAILQ_HEAD_INITIALIZER(raw_create_opts.head), @@ -2312,6 +2331,7 @@ BlockDriver bdrv_file = { .bdrv_get_info = raw_get_info, .bdrv_get_allocated_file_size = raw_get_allocated_file_size, + .bdrv_get_stats = raw_get_stats, .bdrv_check_perm = raw_check_perm, .bdrv_set_perm = raw_set_perm, .bdrv_abort_perm_update = raw_abort_perm_update, @@ -2790,6 +2810,7 @@ static BlockDriver bdrv_host_device = { .bdrv_get_info = raw_get_info, .bdrv_get_allocated_file_size = raw_get_allocated_file_size, + .bdrv_get_stats = raw_get_stats, .bdrv_check_perm = raw_check_perm, .bdrv_set_perm = raw_set_perm, .bdrv_abort_perm_update = raw_abort_perm_update, diff --git a/block/qapi.c b/block/qapi.c index 6e110f2..4191e6c 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -489,6 +489,11 @@ static BlockStats *bdrv_query_bds_stats(BlockDriverState *bs, s->stats->wr_highest_offset = stat64_get(&bs->wr_highest_offset); + s->driver_stats = bdrv_get_driver_stats(bs); + if (s->driver_stats) { + s->has_driver_stats = true; + } + if (bs->file) { s->has_parent = true; s->parent = bdrv_query_bds_stats(bs->file->bs, blk_level);