From patchwork Fri Dec 30 14:31:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9492247 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 D585C60488 for ; Fri, 30 Dec 2016 15:12:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C51BA1FF29 for ; Fri, 30 Dec 2016 15:12:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6FAB223B2; Fri, 30 Dec 2016 15:12:19 +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 AE60E1FF29 for ; Fri, 30 Dec 2016 15:12:18 +0000 (UTC) Received: from localhost ([::1]:40247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMyqv-0005v8-Po for patchwork-qemu-devel@patchwork.kernel.org; Fri, 30 Dec 2016 10:12:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMykb-0000xM-4O for qemu-devel@nongnu.org; Fri, 30 Dec 2016 10:05:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMykX-0001Xw-35 for qemu-devel@nongnu.org; Fri, 30 Dec 2016 10:05:45 -0500 Received: from mail-db5eur01on0109.outbound.protection.outlook.com ([104.47.2.109]:42358 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 1cMykW-0001VW-OG; Fri, 30 Dec 2016 10:05:41 -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=3zHk6Xj/TkcD2Tr2RtFX8jOdBFh+R3DqSBS45hvWGWQ=; b=YOkJBInucPfYjk0vOKvhqm7MYM26UvJGLO1wL2YzDH9tMzOuaH+PYqr9wn4uDv6nTCdkqIQZErmJ2rI+yYbU1W+lcySVuvV5Hcw9pJG+rDOo4RHzAK1ydEtOzq5adlz6cFqQBEPx9+suUzA3V30h7oEvs5HyQ8Zn7pKb0v9qEtA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pbutsykin@virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.6) by HE1PR0802MB2555.eurprd08.prod.outlook.com (10.175.35.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Fri, 30 Dec 2016 14:32:16 +0000 From: Pavel Butsykin To: , Date: Fri, 30 Dec 2016 17:31:42 +0300 Message-ID: <20161230143142.18214-19-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161230143142.18214-1-pbutsykin@virtuozzo.com> References: <20161230143142.18214-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0802CA0010.eurprd08.prod.outlook.com (10.172.123.148) To HE1PR0802MB2555.eurprd08.prod.outlook.com (10.175.35.148) X-MS-Office365-Filtering-Correlation-Id: f799e220-dd49-41c4-6a55-08d430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teBv9uRJe65lInB6jSfD69HwsomyAnrJfjcIMlarihJUnBdr8y7eSRXGbHdAhMwOTAJlFm7ZwNsIrsGlz3baTizrmeQuCW; 20:AiHZim9xZNj1BdCyXYDo2rmZx6eNOq3aVFSs4NiWnlKdU8ftrA3/ZIi/tHGHkhKCoR9Bmf8RfNvr52zfV20Z4qwalkkfjIgDiYSdGL9z5Pb9s4MSvv10bYj8fUAkG6O436ZbL17Zb76VGrwIizsm8JiZozQ6ioYcToSTU5N1xz6EgnYZcndp9ydiilOREbtmalYML+5364sVtHC6s3u3KoIl6Oofw7nm58B2zghL/LveyAEHGLYw7IXW8CcECHhm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123558021)(20161123560025)(6072148); SRVR:HE1PR0802MB2555; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0802MB2555; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2555; 4:ZqJX33k1EN7g60cg28HEIp6dq704oxH986WdIjAZyIF0xoWULQkjQDR/wSHOZYXkKuRuuP5b5blLuk0+wlsYGzDk4auhSf7TQbp4WxcNO4yb1IizGFQiQesK7wc87eurhZ3tPQTntpQ4nUl2AZGSOeloqXJgaKmEQd/ix0i6LnegUBeO90zQKx4ZoQAo5OIo8qad/41BTjcAmIQKduSfOQ7HL9sljG4SNVzmtJmGb+x2xJ4XA+lLeoItj5MlXsInzwOn3CYJUimMdE8alYlzM5XERVF2dCJXQ3YY7zyrvuxKLJMKxPD6LKkumFHtAaLCjELvxLEOVUZn8Ay+iTNnWFjGdyOi2mujTrNOPEv3tvfCg/h2T3mntWD2VvNBwBOJYlP+cqbk1vbmc5y8y1IwGf/G8FPUQGZ7fm70AGDQP21TUqkARYxoEp8qbjnTB44deDsTv2NxyNtjrcwh4tSP5VZS4SpfNLGHEBaorswoYHJU55LfCEDfecCA+P/ih3t9j3V2VVeoD4ng1AH5cDv1WbBLHC5GEvQDdG6JVfNIAZRFDwQAw6zJvInSooTwXUGFCFLwK6KbgPfZXn32TnIc50s/8ycJGnmfcMd8AKl7gUw= X-Forefront-PRVS: 0172F0EF77 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(39450400003)(199003)(189002)(6666003)(5660300001)(189998001)(5001770100001)(50226002)(81156014)(81166006)(5003940100001)(8676002)(97736004)(47776003)(66066001)(6486002)(36756003)(6116002)(3846002)(76176999)(105586002)(33646002)(92566002)(305945005)(38730400001)(50466002)(106356001)(50986999)(1076002)(6506006)(6512006)(69596002)(4326007)(2950100002)(25786008)(2906002)(7736002)(68736007)(53416004)(42186005)(48376002)(101416001)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0802MB2555; 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; HE1PR0802MB2555; 23:EAHNh8FinW2PTvdPP/eSgM0N4Fq1+yyYD6N4vYp?= =?us-ascii?Q?rkL9a2m4VMBcaPx0gqeaD8xGjFpUVlaAzhTtehucdJsPW/6ZmutCi7nZvuQR?= =?us-ascii?Q?ccbEenWlIdkRtyhmTsRWCsm8cJAg4sc8M7BT5xulKBKDN5jrjsGcc3Q2Iszq?= =?us-ascii?Q?A7DkIWoCQvrt3N/UNsG09phnlFiR8s8nRLC95dgBtuSgmv081twQ5ColWlU7?= =?us-ascii?Q?fCVKLTvyTXGO0x2Avkfgng0HSFo0eGRXdWu5DOcH6xN9AEE4zPNRJ4PB01k6?= =?us-ascii?Q?23CkNAGKqYbYmhz2l+UeHjeOtTgcMA2DRDvywB5eooxBDrcugqSYW5GiFOK9?= =?us-ascii?Q?H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fvdokvT/w1D4Yanvqau/VX1yAU00ae2ZE5n7XZiPYhjBYVzuZBP9j9Mpv6VAt+70ZnEb6jZ8hGFFQH2ruUKUQ1CucF+ctYsNnGimfaOOiCfU9w==; 20:vwF0IOdxdb7ivDhVcdhCjsOH0H+UBLcP0tSUA6rzTFbeDXzd71DtUNctLNemW3dBCuO407Ubg93n86D5SWSbEGotOJhPwiuG4J/gu5LqR0er+PkC73oALfxe7Od2U6PX/8xDi7Rxy7w3WBYYxtUf1HEYOR7tqGhw35wgOXZZojo= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2016 14:32:16.5414 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2555 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.109 Subject: [Qemu-devel] [PATCH v2 18/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, den@openvz.org, armbru@redhat.com, mreitz@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: Pavel Butsykin --- block/pcache.c | 20 ++++++++++++++++++++ block/trace-events | 10 ++++++++++ 2 files changed, 30 insertions(+) diff --git a/block/pcache.c b/block/pcache.c index 6d2b54cf78..2bce3efc59 100644 --- a/block/pcache.c +++ b/block/pcache.c @@ -15,6 +15,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" @@ -348,12 +349,18 @@ static void coroutine_fn pcache_co_readahead(BlockDriverState *bs, node->status |= NODE_STATUS_COMPLETED; if (ret < 0) { + trace_pcache_readahead_fail(ret, node->common.offset, + node->common.bytes); rbcache_remove(s->cache, &node->common); } QTAILQ_FOREACH_SAFE(rlink, &node->wait_list, entry, next) { QTAILQ_REMOVE(&node->wait_list, rlink, entry); rlink->ret = ret; + + trace_pcache_readahead_pending_node_complete(ret, node->common.offset, + node->common.bytes, offset, bytes); + qemu_coroutine_enter(rlink->co); } @@ -509,6 +516,10 @@ static int pickup_parts_of_cache(BlockDriverState *bs, PCacheNode *node, ret = part->rlink.ret; } } + if (part->rlink.ret < 0) { + trace_pcache_read_part_fail(ret, part->node->common.offset, + part->node->common.bytes); + } pcache_node_unref(part->node); } @@ -618,6 +629,8 @@ static void pcache_write_through(BlockDriverState *bs, uint64_t offset, if (node->status & NODE_STATUS_COMPLETED) { write_cache_data(node, offset, bytes, qiov); + trace_pcache_write_through(offset, bytes, node->common.offset, + node->common.bytes); } } while (end_offs > chunk_offset); @@ -631,6 +644,8 @@ static void pcache_write_through(BlockDriverState *bs, uint64_t offset, continue; } write_cache_data(node, offset, bytes, qiov); + trace_pcache_write_through_removed_node(offset, bytes, + node->common.offset, node->common.bytes); } } @@ -663,6 +678,9 @@ static int pcache_state_init(QemuOpts *opts, BDRVPCacheState *s) PCACHE_DEFAULT_READAHEAD_SIZE); QLIST_INIT(&s->remove_node_list); + trace_pcache_state_init(stats_size, s->max_aio_size, cache_size, + s->readahead_size); + if (s->readahead_size < s->max_aio_size) { error_report("Readahead size can't be less than maximum request size" "that can be handled by pcache"); @@ -704,6 +722,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 cfc05f2478..d9cef3bcec 100644 --- a/block/trace-events +++ b/block/trace-events @@ -112,3 +112,13 @@ 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_readahead_fail(int ret, uint64_t offset, uint64_t bytes) "ret: %d offset: %"PRIu64" bytes: %"PRIu64 +pcache_readahead_pending_node_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_read_part_fail(int ret, uint64_t offset, uint64_t bytes) "ret: %d offset: %"PRIu64" bytes: %"PRIu64 +pcache_write_through(uint64_t req_offset, uint64_t req_bytes, uint64_t node_offset, uint64_t node_bytes) "request: %"PRIu64" %"PRIu64" node: %"PRIu64" %"PRIu64 +pcache_write_through_removed_node(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"