From 2224e5ca1dacef1e3f8ec4854f08b4abe86f5d75 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 17 Oct 2017 15:49:22 -0400 Subject: [PATCH] librbd: moved performance counter enums to common location Signed-off-by: Jason Dillaman --- src/librbd/ImageCtx.cc | 1 + src/librbd/ImageWatcher.cc | 1 + src/librbd/Operations.cc | 1 + src/librbd/Types.h | 40 ++++++++++++++++++++++++++++++++++ src/librbd/internal.h | 38 -------------------------------- src/librbd/io/AioCompletion.cc | 2 +- src/librbd/io/ImageRequest.cc | 1 + 7 files changed, 45 insertions(+), 39 deletions(-) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 2008a07a769..822e7e9f96e 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -22,6 +22,7 @@ #include "librbd/ObjectMap.h" #include "librbd/Operations.h" #include "librbd/operation/ResizeRequest.h" +#include "librbd/Types.h" #include "librbd/Utils.h" #include "librbd/LibrbdWriteback.h" #include "librbd/exclusive_lock/AutomaticPolicy.h" diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index 487eabaa69c..f8ffda4a75c 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -8,6 +8,7 @@ #include "librbd/internal.h" #include "librbd/Operations.h" #include "librbd/TaskFinisher.h" +#include "librbd/Types.h" #include "librbd/Utils.h" #include "librbd/exclusive_lock/Policy.h" #include "librbd/image_watcher/NotifyLockOwner.h" diff --git a/src/librbd/Operations.cc b/src/librbd/Operations.cc index 65dea8f8c41..f6073b57877 100644 --- a/src/librbd/Operations.cc +++ b/src/librbd/Operations.cc @@ -12,6 +12,7 @@ #include "librbd/ImageState.h" #include "librbd/ImageWatcher.h" #include "librbd/ObjectMap.h" +#include "librbd/Types.h" #include "librbd/Utils.h" #include "librbd/journal/DisabledPolicy.h" #include "librbd/journal/StandardPolicy.h" diff --git a/src/librbd/Types.h b/src/librbd/Types.h index 8efe8a7763c..9cc16b79877 100644 --- a/src/librbd/Types.h +++ b/src/librbd/Types.h @@ -10,6 +10,46 @@ namespace librbd { +// Performance counters +enum { + l_librbd_first = 26000, + + l_librbd_rd, // read ops + l_librbd_rd_bytes, // bytes read + l_librbd_rd_latency, // average latency + l_librbd_wr, + l_librbd_wr_bytes, + l_librbd_wr_latency, + l_librbd_discard, + l_librbd_discard_bytes, + l_librbd_discard_latency, + l_librbd_flush, + l_librbd_flush_latency, + + l_librbd_ws, + l_librbd_ws_bytes, + l_librbd_ws_latency, + + l_librbd_cmp, + l_librbd_cmp_bytes, + l_librbd_cmp_latency, + + l_librbd_snap_create, + l_librbd_snap_remove, + l_librbd_snap_rollback, + l_librbd_snap_rename, + + l_librbd_notify, + l_librbd_resize, + + l_librbd_readahead, + l_librbd_readahead_bytes, + + l_librbd_invalidate_cache, + + l_librbd_last, +}; + /** @brief Unique identification of a parent in clone relationship. * Cloning an image creates a child image that keeps a reference * to its parent. This allows copy-on-write images. */ diff --git a/src/librbd/internal.h b/src/librbd/internal.h index daedaa42e2f..d6401380557 100644 --- a/src/librbd/internal.h +++ b/src/librbd/internal.h @@ -17,44 +17,6 @@ #include "common/WorkQueue.h" #include "librbd/Types.h" -enum { - l_librbd_first = 26000, - - l_librbd_rd, // read ops - l_librbd_rd_bytes, // bytes read - l_librbd_rd_latency, // average latency - l_librbd_wr, - l_librbd_wr_bytes, - l_librbd_wr_latency, - l_librbd_discard, - l_librbd_discard_bytes, - l_librbd_discard_latency, - l_librbd_flush, - l_librbd_flush_latency, - l_librbd_ws, - l_librbd_ws_bytes, - l_librbd_ws_latency, - - l_librbd_cmp, - l_librbd_cmp_bytes, - l_librbd_cmp_latency, - - l_librbd_snap_create, - l_librbd_snap_remove, - l_librbd_snap_rollback, - l_librbd_snap_rename, - - l_librbd_notify, - l_librbd_resize, - - l_librbd_readahead, - l_librbd_readahead_bytes, - - l_librbd_invalidate_cache, - - l_librbd_last, -}; - namespace librbd { struct ImageCtx; diff --git a/src/librbd/io/AioCompletion.cc b/src/librbd/io/AioCompletion.cc index e668ecd9cc7..e30a083e136 100644 --- a/src/librbd/io/AioCompletion.cc +++ b/src/librbd/io/AioCompletion.cc @@ -12,8 +12,8 @@ #include "librbd/ImageCtx.h" #include "librbd/internal.h" - #include "librbd/Journal.h" +#include "librbd/Types.h" #ifdef WITH_LTTNG #include "tracing/librbd.h" diff --git a/src/librbd/io/ImageRequest.cc b/src/librbd/io/ImageRequest.cc index c38300a5393..f4a10094ecb 100644 --- a/src/librbd/io/ImageRequest.cc +++ b/src/librbd/io/ImageRequest.cc @@ -5,6 +5,7 @@ #include "librbd/ImageCtx.h" #include "librbd/internal.h" #include "librbd/Journal.h" +#include "librbd/Types.h" #include "librbd/Utils.h" #include "librbd/cache/ImageCache.h" #include "librbd/io/AioCompletion.h" -- 2.39.5