Whamcloud - gitweb
LU-744 obdclass: revise stats for cl_object cache
[fs/lustre-release.git] / lustre / include / cl_object.h
index 9ba73c5..c8b4cb9 100644 (file)
@@ -2548,22 +2548,29 @@ struct cl_req_slice {
 
 /* @} cl_req */
 
+enum cache_stats_item {
+       /** how many cache lookups were performed */
+       CS_lookup = 0,
+       /** how many times cache lookup resulted in a hit */
+       CS_hit,
+       /** how many entities are in the cache right now */
+       CS_total,
+       /** how many entities in the cache are actively used (and cannot be
+        * evicted) right now */
+       CS_busy,
+       /** how many entities were created at all */
+       CS_create,
+       CS_NR
+};
+
+#define CS_NAMES { "lookup", "hit", "total", "busy", "create" }
+
 /**
  * Stats for a generic cache (similar to inode, lu_object, etc. caches).
  */
 struct cache_stats {
         const char    *cs_name;
-        /** how many entities were created at all */
-        cfs_atomic_t   cs_created;
-        /** how many cache lookups were performed */
-        cfs_atomic_t   cs_lookup;
-        /** how many times cache lookup resulted in a hit */
-        cfs_atomic_t   cs_hit;
-        /** how many entities are in the cache right now */
-        cfs_atomic_t   cs_total;
-        /** how many entities in the cache are actively used (and cannot be
-         * evicted) right now */
-        cfs_atomic_t   cs_busy;
+        cfs_atomic_t   cs_stats[CS_NR];
 };
 
 /** These are not exported so far */