From: Mykola Golub Date: Wed, 4 Nov 2015 10:18:52 +0000 (+0200) Subject: librbd: perf counter for cache invalidates X-Git-Tag: v10.0.1~111^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=39503f5841d84d7dc6fbacc4df5ff6349a808540;p=ceph.git librbd: perf counter for cache invalidates Signed-off-by: Mykola Golub --- diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 031893c6e36..ecb246ca39a 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -294,6 +294,7 @@ public: plb.add_u64_counter(l_librbd_resize, "resize", "Resizes"); plb.add_u64_counter(l_librbd_readahead, "readahead", "Read ahead"); plb.add_u64_counter(l_librbd_readahead_bytes, "readahead_bytes", "Data size in read ahead"); + plb.add_u64_counter(l_librbd_invalidate_cache, "invalidate_cache", "Cache invalidates"); perfcounter = plb.create_perf_counters(); cct->get_perfcounters_collection()->add(perfcounter); diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 812ef459373..da0c9bcf0d0 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -3617,6 +3617,7 @@ reprotect_and_return_err: RWLock::RLocker owner_locker(ictx->owner_lock); RWLock::WLocker md_locker(ictx->md_lock); r = ictx->invalidate_cache(); + ictx->perfcounter->inc(l_librbd_invalidate_cache); return r; } diff --git a/src/librbd/internal.h b/src/librbd/internal.h index 3d35ee0bc29..4245b43f810 100644 --- a/src/librbd/internal.h +++ b/src/librbd/internal.h @@ -42,6 +42,8 @@ enum { l_librbd_readahead, l_librbd_readahead_bytes, + l_librbd_invalidate_cache, + l_librbd_last, };