All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Butsykin <pbutsykin@virtuozzo.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: den@openvz.org, famz@redhat.com, stefanha@redhat.com,
	mreitz@redhat.com, kwolf@redhat.com, eblake@redhat.com
Subject: [Qemu-devel] [PATCH v1 17/18] block/pcache: add tracepoints
Date: Tue, 15 Nov 2016 09:37:14 +0300	[thread overview]
Message-ID: <20161115063715.12561-18-pbutsykin@virtuozzo.com> (raw)
In-Reply-To: <20161115063715.12561-1-pbutsykin@virtuozzo.com>

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
---
 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"
-- 
2.10.1

  parent reply	other threads:[~2016-11-15 11:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15  6:36 [Qemu-devel] [PATCH v1 00/18] I/O prefetch cache Pavel Butsykin
2016-11-15  6:36 ` [Qemu-devel] [PATCH v1 01/18] block/io: add bdrv_aio_{preadv, pwritev} Pavel Butsykin
2016-11-23 14:28   ` Kevin Wolf
2016-11-24 10:58     ` Pavel Butsykin
2016-11-24 12:36       ` Kevin Wolf
2016-11-24 15:10         ` Pavel Butsykin
2016-11-15  6:36 ` [Qemu-devel] [PATCH v1 02/18] block/pcache: empty pcache driver filter Pavel Butsykin
2016-11-23 15:15   ` Kevin Wolf
2016-11-24 15:48     ` Pavel Butsykin
2016-11-24 16:39       ` Kevin Wolf
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 03/18] util/rbtree: add rbtree from linux kernel Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 04/18] util/rbcache: range-based cache core Pavel Butsykin
2016-11-23 21:25   ` Kevin Wolf
2016-11-24 19:23     ` Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 05/18] tests/test-rbcache: add test cases Pavel Butsykin
2016-11-24 12:20   ` Kevin Wolf
2016-11-25  9:58     ` Pavel Butsykin
2016-11-25 10:11       ` Kevin Wolf
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 06/18] block/pcache: statistics collection read requests Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 07/18] block/pcache: skip large aio read Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 08/18] block/pcache: updating statistics for overlapping requests Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 09/18] block/pcache: add AIO readahead Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 10/18] block/pcache: skip readahead for unallocated clusters Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 11/18] block/pcache: cache invalidation on AIO write requests Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 12/18] block/pcache: add reading data from the cache Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 13/18] block/pcache: inflight readahead request waiting for aio read Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 14/18] backup/pcache: pick up parts of the cache Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 15/18] block/pcache: drop used pcache nodes Pavel Butsykin
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 16/18] block/pcache: write through Pavel Butsykin
2016-11-15  6:37 ` Pavel Butsykin [this message]
2016-11-15  6:37 ` [Qemu-devel] [PATCH v1 18/18] block/pcache: debug build Pavel Butsykin
2016-11-15 16:18 ` [Qemu-devel] [PATCH v1 00/18] I/O prefetch cache no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161115063715.12561-18-pbutsykin@virtuozzo.com \
    --to=pbutsykin@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.