xfs: add rmap btree stats infrastructure
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 3 Aug 2016 01:31:11 +0000 (11:31 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 3 Aug 2016 01:31:11 +0000 (11:31 +1000)
Originally-From: Dave Chinner <dchinner@redhat.com>

The rmap btree will require the same stats as all the other generic
btrees, so add all the code for that now.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_btree.h
fs/xfs/xfs_stats.c
fs/xfs/xfs_stats.h

index 25f1b69e75150c333e33e3be6c45f25ad7abb2bd..a480947f094b86b8bb0e82dcaedfffade19dcb10 100644 (file)
@@ -110,7 +110,7 @@ do {    \
        case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(__mp, bmbt, stat); break; \
        case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(__mp, ibt, stat); break; \
        case XFS_BTNUM_FINO: __XFS_BTREE_STATS_INC(__mp, fibt, stat); break; \
-       case XFS_BTNUM_RMAP: break;     \
+       case XFS_BTNUM_RMAP: __XFS_BTREE_STATS_INC(__mp, rmap, stat); break; \
        case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break;       \
        }       \
 } while (0)
@@ -131,7 +131,8 @@ do {    \
                __XFS_BTREE_STATS_ADD(__mp, ibt, stat, val); break; \
        case XFS_BTNUM_FINO:    \
                __XFS_BTREE_STATS_ADD(__mp, fibt, stat, val); break; \
-       case XFS_BTNUM_RMAP: break; \
+       case XFS_BTNUM_RMAP:    \
+               __XFS_BTREE_STATS_ADD(__mp, rmap, stat, val); break; \
        case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \
        }       \
 } while (0)
index 8686df6c76095b907b2e1b78c144f5b1c271a62d..f04f547fe5b27ad1c40a11d026f91a0f1b0e8c7a 100644 (file)
@@ -61,6 +61,7 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
                { "bmbt2",              XFSSTAT_END_BMBT_V2             },
                { "ibt2",               XFSSTAT_END_IBT_V2              },
                { "fibt2",              XFSSTAT_END_FIBT_V2             },
+               { "rmapbt",             XFSSTAT_END_RMAP_V2             },
                /* we print both series of quota information together */
                { "qm",                 XFSSTAT_END_QM                  },
        };
index 483b0eff198836ca1516cf56bdffc5f283af8dad..657865f51e78332dae8ff7892e93213c07f71e6e 100644 (file)
@@ -197,7 +197,23 @@ struct xfsstats {
        __uint32_t              xs_fibt_2_alloc;
        __uint32_t              xs_fibt_2_free;
        __uint32_t              xs_fibt_2_moves;
-#define XFSSTAT_END_XQMSTAT            (XFSSTAT_END_FIBT_V2+6)
+#define XFSSTAT_END_RMAP_V2            (XFSSTAT_END_FIBT_V2+15)
+       __uint32_t              xs_rmap_2_lookup;
+       __uint32_t              xs_rmap_2_compare;
+       __uint32_t              xs_rmap_2_insrec;
+       __uint32_t              xs_rmap_2_delrec;
+       __uint32_t              xs_rmap_2_newroot;
+       __uint32_t              xs_rmap_2_killroot;
+       __uint32_t              xs_rmap_2_increment;
+       __uint32_t              xs_rmap_2_decrement;
+       __uint32_t              xs_rmap_2_lshift;
+       __uint32_t              xs_rmap_2_rshift;
+       __uint32_t              xs_rmap_2_split;
+       __uint32_t              xs_rmap_2_join;
+       __uint32_t              xs_rmap_2_alloc;
+       __uint32_t              xs_rmap_2_free;
+       __uint32_t              xs_rmap_2_moves;
+#define XFSSTAT_END_XQMSTAT            (XFSSTAT_END_RMAP_V2+6)
        __uint32_t              xs_qm_dqreclaims;
        __uint32_t              xs_qm_dqreclaim_misses;
        __uint32_t              xs_qm_dquot_dups;