From patchwork Tue Nov 15 06:37:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9429503 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 3726D60484 for ; Tue, 15 Nov 2016 11:22:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E8D286C9 for ; Tue, 15 Nov 2016 11:22:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16CE5289BB; Tue, 15 Nov 2016 11:22:54 +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 13700286C9 for ; Tue, 15 Nov 2016 11:22:52 +0000 (UTC) Received: from localhost ([::1]:45615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6bpD-0003zM-Sj for patchwork-qemu-devel@patchwork.kernel.org; Tue, 15 Nov 2016 06:22:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6bhN-0006Fn-Le for qemu-devel@nongnu.org; Tue, 15 Nov 2016 06:14:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6bhI-00031d-M9 for qemu-devel@nongnu.org; Tue, 15 Nov 2016 06:14:45 -0500 Received: from mail-db5eur01on0107.outbound.protection.outlook.com ([104.47.2.107]:11494 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 1c6bhI-00030K-BT; Tue, 15 Nov 2016 06:14:40 -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=tyWjc7Nh3OEmQ55N2Sj9rVJWLSFsg39n+t12trNCo2Q=; b=broDhSIGo/UdKSmMIDdtbXFCO1rzsmKoYT9mxG0H4O0qTJf+IREUjNitwA4U9bgyI6yHmnZ1fMrCXd6IDEMMBpC02K14DPH+q55ugw4ZaRx3mw2+7L0ciceECFSakWDs0Kyejkh+9QnUR4E3w/45Xbmi4JW0M9FMtKWkzoGnBvM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pbutsykin@virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.10) by VI1PR0802MB2558.eurprd08.prod.outlook.com (10.172.255.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10; Tue, 15 Nov 2016 06:38:33 +0000 From: Pavel Butsykin To: , Date: Tue, 15 Nov 2016 09:37:14 +0300 Message-ID: <20161115063715.12561-18-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161115063715.12561-1-pbutsykin@virtuozzo.com> References: <20161115063715.12561-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: AM5PR0101CA0010.eurprd01.prod.exchangelabs.com (10.169.240.20) To VI1PR0802MB2558.eurprd08.prod.outlook.com (10.172.255.136) X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2558; 2:rq6bfsvEzUIvY9PIQocHd06F6faKiuTqmyYVZBElOiMqzk5EOJ6S0D4aYRoSma32e06UElcYIwMfui7ygoB13fr6Gu4CDTxu24E44Q2BjQAK7z/iprkxlLXkFV5QoeanctQXxSkqFyRKbNBSaBhismSFjbha+q9VUeGTF0GhoyM=; 3:rB8NeSoNHufHhZh3pk9XRw4ddMmboNtLtjFuPsg77/6Jz17Em8ig7FisAui8Jl+K/B0ht+6mkNKXu6SiuWH8xgP95s725gmuNVkfiQ//IP1jiUUCEKXRKZfvSEUiNYKyJbVEVgCqqebf9/WCqPvec/1rm0EJiJVb3kc6/fEbMto=; 25:lqGO/1p6Gup4ydkQWTRA1M24Aqrg5xa2IbQ7H5rPjccQPjv4Uehean+Tmu9l3ehuSnfyA7RMMUpSle/deY2T78BqcAAfQGesrSGdxVvqxTTxOE7IUOIxceS0XO0Gz/bLnevfovyZWtGXCoJTs3rXohg8ocSwK5aeYhV10mV+/A/zsVK+Iiag+cpSmhl+h4ILIZ73npbcmAIkADLhVU79l4po6aABhiGgHnr1VqoQogE4WbvqeJ2ZoYDCLzO8zmXqQT1532JQRBFtWiLoJ2mWlPRrkQF05jX1JrICdG+AW9FAuBSx4j1xVf63ivCfsobUSSwqQWb7iLw3TDIAdt5I6xs5HWUvY/S7kSPQoKQwNvBOEdL3omrgLd9Kim7xQCGgSwDEc8zNkOtfh9/JXqbKOTZhH+sRaegE8e3FPs+v/0JC7IfTrZc3OSLnEH8lGVE6 X-MS-Office365-Filtering-Correlation-Id: bca5708c-5c79-4d17-2d48-08d40d220591 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:VI1PR0802MB2558; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2558; 31:0EefkmlyLtzSzB0OzeE36eHxGuTCdFqmq3gYwCheDwARkSM+sh+ike5Dr40mJOBaV2CKEDyt6VNnMfoDhBgG/UsCHh+bb4bXEDrwc78ACp8Imrl0QiHrtotN/PC5yjl+PTwB/Vdow8FqXHE8rHeuRugkoRfCGt5s4RXyiu39w6wly9bg3Hqz0SZpcWd0Gx/EnPj715k9NpNBhw3vYEeZfhUgkZAsBeIL74kFNkHJUzVaF2kZl3E/6vEoK3yKAKHchT3kfa0wWIrexv0CtXNctA==; 20:Cl4oRW6YQ8qzcbf8XZ42mHzbQ77vOh8xCzXlyyKCV1HAQOkDRaHQrq3o20GTcc/zQ6ki67Aw+1HkE3lpgA3JN3IYW1RXjx/SlMCwK8BWAqdc0JK6zTnY4sR6io/JI99xiUfvqF8l8vjxHAxJlxtKOoF998oECmxp/PjdAsiXTuQ=; 4:ZSU3KIQfaoYvmFtZLFvY6kezoDlfe1m6J38r2FHrns5jITeClSTAhqmazdtjFmW8UzHz19oN7amd2DUfjkUP9oXdf2xeT8XmUCpJ1PnJGljnRXt4ssLxAJjj1itdzGK9s3Q5xDGb5S1M3Que601uoWrif4kN6ss3z9mWihAte91wY1IA+KNoQ88SsJzcphK1RmKjOPntkY11wXvv6U72ia2+Vn7hwuIPaI31zLDBYJ8kWiP93GQC6dK+Df99JmBZzDzMGNI7GCIlA2SLMtRNunpgIHfF8jZv0KPcJaSRNlQY8eHJZaeoGHeWFEBo8Fuk3oERsWHeNs+NlZor4JT/Y3pf0YNrp9iPESrLHXl3GEpXT2bqZku4vBsfV5roKA4GbJMQrlDfUYb7k20dr6KbPCRKeHiasbGC/fDp6BytM9sZBYc8/dKcgkCcHa4/VHyM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6061324)(6043046); SRVR:VI1PR0802MB2558; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0802MB2558; X-Forefront-PRVS: 012792EC17 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(47776003)(105586002)(101416001)(1076002)(68736007)(106356001)(6666003)(76176999)(305945005)(4326007)(97736004)(66066001)(53416004)(189998001)(42186005)(69596002)(2906002)(7736002)(5001770100001)(7846002)(86362001)(48376002)(50226002)(2950100002)(50466002)(50986999)(5003940100001)(33646002)(77096005)(81156014)(8676002)(92566002)(81166006)(3846002)(36756003)(6116002)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0802MB2558; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; VI1PR0802MB2558; 23:HKBCAzSSKnyC3ZJbZhc+1Y7X179lmj1ccinu5aJ?= =?us-ascii?Q?Op8m1DHoIfENJB5gpYj7DbaymOZ0Goau2uZMLiLbkYzb/pOMx3kTpb+yPnyG?= =?us-ascii?Q?VHD5y0ptj0pH7Bqp1JQ9D3Ngc607bqBXDfhcpoq6fJ4OFj17ZNLYu4AZnqbW?= =?us-ascii?Q?2YD9Jn2YCeslG2Nr/BGyJNk0QsvjRFCoU8skvhL2cPMI4X73/PGl4Bs/Y8fS?= =?us-ascii?Q?ayhoIpVhoc1mf+ThrCJI+mg7SjJhCFyfS6deJCRSTLPPfZI1k7VGOzieaVcC?= =?us-ascii?Q?NU3REMtis/Tzzw4XFdameo9KkCgpEZuMKlh8tSii7yeMprJH3d5vsPgNc+Dl?= =?us-ascii?Q?6WwySheeTcgw1dxWF4x5KuxF7k3ZvRc6imWsBU6V2Ju0Znq2OzqJeUfnoI/S?= =?us-ascii?Q?SWfkZAQ83GRCHgwvBJbePB+BiBYdRRVORdfSo72GADPC1+tFhl95haed+9lU?= =?us-ascii?Q?aPCmjx6jKBK3hbLokDmMUz+H0e/jNU2asFqd38cMDeGjGeMCnfYeI4pG8ER/?= =?us-ascii?Q?I92Y/x3wbVvrRiBsIUJlkwDrJke9fk0v/Zil7q7sn3bc/Wv7odvuBeJukc+D?= =?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/jmWSji5Tzv51YqmQVlodjMRh3ut8mNRY7HaQiA/JqbqdCbOAy84z2WA4sV+N8UKDXhJZ32sz6NqkgBm7fEHv1oxRCHsE7WS5Ceqn0m8LiybuBcWyb5GaZlvPoiQ=; 24:bEdiDddMsfKSl7Vtpc9JcQuaFtXnTQF1CpX4wskWs4+sKqwiqrHZOUUdvaYB5vJ6KDhJ66BcOA1EhUQWJ12sZPlFaIAbxwqZmxYDqMtjvmg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2558; 7:TiTfrRg/6ReW8/bb2A76z9uDVT5MBqBLU3zBKVAx4wYNmX8VEmNDWzIewE7OgldZIvlb6JROp8VmeTylsPq9Fop969gngBG6j8hY5dchGjiXJv8avlO2ssjn/oczYFFeDnmtSdxga1G2b+u9+j8jKt9rMcokbbu38KT1tMsjOKhLV9LMOvS5eibEuja1/y0j3mE7hV7Y2j9dmR/YbL55oNdQuGtqoTBXNRRAzHZLUR/POMgRUBrTbypNjx9G3g+WsUAnlsc9P6+PPNH/4aqkIr1P5FWVFoSt2vNuYtb2bZy5bPGo2gDavHL7ZXaHc5EqSlInJvpzocbY6m4DmfyOujzeqNC5vNI93+mLbjSJdsg=; 20:Hwqob0U95YOxEG38Q/h4TJMHN9diFBi1MqdjnhIKmq3woeKtVSO31cCQZFBBXLlTWGaSKRpQ63ch8FXgCLMmGMzJH7Gy4icB9k0lWCvsldERMh/6Sos+zfHtN2sZv5nVBgoV7vvX+h8U/P1dHalGit8Ho5KG3AqklU0UKfquLA8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2016 06:38:33.2736 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2558 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.107 Subject: [Qemu-devel] [PATCH v1 17/18] block/pcache: add tracepoints 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, famz@redhat.com, mreitz@redhat.com, stefanha@redhat.com, den@openvz.org 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: Pavel Butsykin --- block/pcache.c | 21 +++++++++++++++++++++ block/trace-events | 9 +++++++++ 2 files changed, 30 insertions(+) diff --git a/block/pcache.c b/block/pcache.c index a592ea0..1821557 100644 --- a/block/pcache.c +++ b/block/pcache.c @@ -14,6 +14,7 @@ #include "qapi/error.h" #include "qapi/qmp/qstring.h" #include "qemu/rbcache.h" +#include "trace.h" #define PCACHE_OPT_STATS_SIZE "pcache-stats-size" #define PCACHE_OPT_MAX_AIO_SIZE "pcache-max-aio-size" @@ -206,7 +207,15 @@ static void pcache_aio_read_cb(void *opaque, int ret) { PCacheAIOCBRead *acb = opaque; + if (ret < 0) { + trace_pcache_aio_read_cb_fail(ret, acb->offset, acb->bytes); + } + if (acb->part.qiov.niov != 0) { + if (ret < 0) { + trace_pcache_aio_read_cb_part_fail(ret, acb->part.offset, + acb->part.bytes); + } qemu_iovec_destroy(&acb->part.qiov); } @@ -227,6 +236,8 @@ static void pcache_aio_readahead_cb(void *opaque, int ret) node->status = NODE_STATUS_COMPLETED; } else { BDRVPCacheState *s = acb->bs->opaque; + trace_pcache_aio_readahead_cb_fail(ret, node->common.offset, + node->common.bytes); rbcache_remove(s->cache, &node->common); } } @@ -240,6 +251,9 @@ static void pcache_aio_readahead_cb(void *opaque, int ret) if (ret == 0) { read_cache_data(acb_read, node, acb_read->offset, acb_read->bytes); } + trace_pcache_aio_readahead_cb_read_complete( + ret, node->common.offset, node->common.bytes, + acb_read->offset, acb_read->bytes); aio_read_complete(acb_read, ret); } @@ -598,6 +612,8 @@ static void pcache_aio_write_cb(void *opaque, int ret) if (node->status == NODE_STATUS_COMPLETED) { write_cache_data(acb->qiov, node, acb->offset, acb->bytes); + trace_pcache_aio_write_cb_through(acb->offset, acb->bytes, + node->common.offset, node->common.bytes); } } while (end_offs > offset); @@ -639,6 +655,9 @@ static void pcache_state_init(QemuOpts *opts, BDRVPCacheState *s) RBCACHE_LRU, s); s->readahead_size = qemu_opt_get_size(opts, PCACHE_OPT_READAHEAD_SIZE, PCACHE_DEFAULT_READAHEAD_SIZE); + + trace_pcache_state_init(stats_size, s->max_aio_size, cache_size, + s->readahead_size); } static int pcache_file_open(BlockDriverState *bs, QDict *options, int flags, @@ -674,6 +693,8 @@ static void pcache_close(BlockDriverState *bs) { BDRVPCacheState *s = bs->opaque; + trace_pcache_close(s->req_stats, s->cache); + rbcache_destroy(s->req_stats); rbcache_destroy(s->cache); } diff --git a/block/trace-events b/block/trace-events index 05fa13c..30223da 100644 --- a/block/trace-events +++ b/block/trace-events @@ -114,3 +114,12 @@ qed_aio_write_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64 qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64 qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu" + +# block/pcache.c +pcache_aio_readahead_cb_fail(int ret, uint64_t offset, uint64_t bytes) "ret: %d offset: %"PRIu64" bytes: %"PRIu64 +pcache_aio_readahead_cb_read_complete(int ret, uint64_t node_offset, uint64_t node_bytes, uint64_t read_offset, uint64_t read_bytes) "ret: %d node: %"PRIu64" %"PRIu64" pending read: %"PRIu64" %"PRIu64 +pcache_aio_read_cb_fail(int ret, uint64_t offset, uint64_t bytes) "ret: %d offset: %"PRIu64" bytes: %"PRIu64 +pcache_aio_read_cb_part_fail(int ret, uint64_t offset, uint64_t bytes) "ret: %d offset: %"PRIu64" bytes: %"PRIu64 +pcache_aio_write_cb_through(uint64_t req_offset, uint64_t req_bytes, uint64_t node_offset, uint64_t node_bytes) "request: %"PRIu64" %"PRIu64" node: %"PRIu64" %"PRIu64 +pcache_state_init(uint64_t stats_size, uint64_t max_aio_size, uint64_t cache_size, uint64_t readahead_size) "pool statistics size: %"PRIu64" max aio size: %"PRIu64" cache size: %"PRIu64" readahead size: %"PRIu64 +pcache_close(void *req_stats, void *cache) "pool statistics: %p cache: %p"