diff options
author | David Chinner <david@fromorbit.com> | 2008-10-30 01:55:03 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:55:03 -0400 |
commit | 854929f05831d3a290a802815ee955b96c740c61 (patch) | |
tree | 6a0ff769e72eaed88c210dc3725594a7d53dfdb7 /fs/xfs/xfs_btree.h | |
parent | a23f6ef8ce966abc0f6e24a81ceb6a74ed30693b (diff) |
[XFS] add new btree statistics
From: Dave Chinner <dgc@sgi.com>
Introduce statistics coverage of all the btrees and cover all the btree
operations, not just some.
Invaluable for determining test code coverage of all the btree
operations....
SGI-PV: 985583
SGI-Modid: xfs-linux-melb:xfs-kern:32184a
Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Bill O'Donnell <billodo@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_btree.h')
-rw-r--r-- | fs/xfs/xfs_btree.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h index a57918276d9f..57d3bd37526e 100644 --- a/fs/xfs/xfs_btree.h +++ b/fs/xfs/xfs_btree.h | |||
@@ -121,6 +121,34 @@ union xfs_btree_rec { | |||
121 | extern const __uint32_t xfs_magics[]; | 121 | extern const __uint32_t xfs_magics[]; |
122 | 122 | ||
123 | /* | 123 | /* |
124 | * Generic stats interface | ||
125 | */ | ||
126 | #define __XFS_BTREE_STATS_INC(type, stat) \ | ||
127 | XFS_STATS_INC(xs_ ## type ## _2_ ## stat) | ||
128 | #define XFS_BTREE_STATS_INC(cur, stat) \ | ||
129 | do { \ | ||
130 | switch (cur->bc_btnum) { \ | ||
131 | case XFS_BTNUM_BNO: __XFS_BTREE_STATS_INC(abtb, stat); break; \ | ||
132 | case XFS_BTNUM_CNT: __XFS_BTREE_STATS_INC(abtc, stat); break; \ | ||
133 | case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(bmbt, stat); break; \ | ||
134 | case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(ibt, stat); break; \ | ||
135 | case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ | ||
136 | } \ | ||
137 | } while (0) | ||
138 | |||
139 | #define __XFS_BTREE_STATS_ADD(type, stat, val) \ | ||
140 | XFS_STATS_ADD(xs_ ## type ## _2_ ## stat, val) | ||
141 | #define XFS_BTREE_STATS_ADD(cur, stat, val) \ | ||
142 | do { \ | ||
143 | switch (cur->bc_btnum) { \ | ||
144 | case XFS_BTNUM_BNO: __XFS_BTREE_STATS_ADD(abtb, stat, val); break; \ | ||
145 | case XFS_BTNUM_CNT: __XFS_BTREE_STATS_ADD(abtc, stat, val); break; \ | ||
146 | case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_ADD(bmbt, stat, val); break; \ | ||
147 | case XFS_BTNUM_INO: __XFS_BTREE_STATS_ADD(ibt, stat, val); break; \ | ||
148 | case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ | ||
149 | } \ | ||
150 | } while (0) | ||
151 | /* | ||
124 | * Maximum and minimum records in a btree block. | 152 | * Maximum and minimum records in a btree block. |
125 | * Given block size, type prefix, and leaf flag (0 or 1). | 153 | * Given block size, type prefix, and leaf flag (0 or 1). |
126 | * The divisor below is equivalent to lf ? (e1) : (e2) but that produces | 154 | * The divisor below is equivalent to lf ? (e1) : (e2) but that produces |