diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_stats.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_stats.h | 65 | ||||
-rw-r--r-- | fs/xfs/xfs_btree.h | 28 |
3 files changed, 97 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_stats.c b/fs/xfs/linux-2.6/xfs_stats.c index 3d5b67c075c7..64f4ec90b8b2 100644 --- a/fs/xfs/linux-2.6/xfs_stats.c +++ b/fs/xfs/linux-2.6/xfs_stats.c | |||
@@ -53,6 +53,10 @@ xfs_read_xfsstats( | |||
53 | { "icluster", XFSSTAT_END_INODE_CLUSTER }, | 53 | { "icluster", XFSSTAT_END_INODE_CLUSTER }, |
54 | { "vnodes", XFSSTAT_END_VNODE_OPS }, | 54 | { "vnodes", XFSSTAT_END_VNODE_OPS }, |
55 | { "buf", XFSSTAT_END_BUF }, | 55 | { "buf", XFSSTAT_END_BUF }, |
56 | { "abtb2", XFSSTAT_END_ABTB_V2 }, | ||
57 | { "abtc2", XFSSTAT_END_ABTC_V2 }, | ||
58 | { "bmbt2", XFSSTAT_END_BMBT_V2 }, | ||
59 | { "ibt2", XFSSTAT_END_IBT_V2 }, | ||
56 | }; | 60 | }; |
57 | 61 | ||
58 | /* Loop over all stats groups */ | 62 | /* Loop over all stats groups */ |
diff --git a/fs/xfs/linux-2.6/xfs_stats.h b/fs/xfs/linux-2.6/xfs_stats.h index e83820febc9f..736854b1ca1a 100644 --- a/fs/xfs/linux-2.6/xfs_stats.h +++ b/fs/xfs/linux-2.6/xfs_stats.h | |||
@@ -118,6 +118,71 @@ struct xfsstats { | |||
118 | __uint32_t xb_page_retries; | 118 | __uint32_t xb_page_retries; |
119 | __uint32_t xb_page_found; | 119 | __uint32_t xb_page_found; |
120 | __uint32_t xb_get_read; | 120 | __uint32_t xb_get_read; |
121 | /* Version 2 btree counters */ | ||
122 | #define XFSSTAT_END_ABTB_V2 (XFSSTAT_END_BUF+15) | ||
123 | __uint32_t xs_abtb_2_lookup; | ||
124 | __uint32_t xs_abtb_2_compare; | ||
125 | __uint32_t xs_abtb_2_insrec; | ||
126 | __uint32_t xs_abtb_2_delrec; | ||
127 | __uint32_t xs_abtb_2_newroot; | ||
128 | __uint32_t xs_abtb_2_killroot; | ||
129 | __uint32_t xs_abtb_2_increment; | ||
130 | __uint32_t xs_abtb_2_decrement; | ||
131 | __uint32_t xs_abtb_2_lshift; | ||
132 | __uint32_t xs_abtb_2_rshift; | ||
133 | __uint32_t xs_abtb_2_split; | ||
134 | __uint32_t xs_abtb_2_join; | ||
135 | __uint32_t xs_abtb_2_alloc; | ||
136 | __uint32_t xs_abtb_2_free; | ||
137 | __uint32_t xs_abtb_2_moves; | ||
138 | #define XFSSTAT_END_ABTC_V2 (XFSSTAT_END_ABTB_V2+15) | ||
139 | __uint32_t xs_abtc_2_lookup; | ||
140 | __uint32_t xs_abtc_2_compare; | ||
141 | __uint32_t xs_abtc_2_insrec; | ||
142 | __uint32_t xs_abtc_2_delrec; | ||
143 | __uint32_t xs_abtc_2_newroot; | ||
144 | __uint32_t xs_abtc_2_killroot; | ||
145 | __uint32_t xs_abtc_2_increment; | ||
146 | __uint32_t xs_abtc_2_decrement; | ||
147 | __uint32_t xs_abtc_2_lshift; | ||
148 | __uint32_t xs_abtc_2_rshift; | ||
149 | __uint32_t xs_abtc_2_split; | ||
150 | __uint32_t xs_abtc_2_join; | ||
151 | __uint32_t xs_abtc_2_alloc; | ||
152 | __uint32_t xs_abtc_2_free; | ||
153 | __uint32_t xs_abtc_2_moves; | ||
154 | #define XFSSTAT_END_BMBT_V2 (XFSSTAT_END_ABTC_V2+15) | ||
155 | __uint32_t xs_bmbt_2_lookup; | ||
156 | __uint32_t xs_bmbt_2_compare; | ||
157 | __uint32_t xs_bmbt_2_insrec; | ||
158 | __uint32_t xs_bmbt_2_delrec; | ||
159 | __uint32_t xs_bmbt_2_newroot; | ||
160 | __uint32_t xs_bmbt_2_killroot; | ||
161 | __uint32_t xs_bmbt_2_increment; | ||
162 | __uint32_t xs_bmbt_2_decrement; | ||
163 | __uint32_t xs_bmbt_2_lshift; | ||
164 | __uint32_t xs_bmbt_2_rshift; | ||
165 | __uint32_t xs_bmbt_2_split; | ||
166 | __uint32_t xs_bmbt_2_join; | ||
167 | __uint32_t xs_bmbt_2_alloc; | ||
168 | __uint32_t xs_bmbt_2_free; | ||
169 | __uint32_t xs_bmbt_2_moves; | ||
170 | #define XFSSTAT_END_IBT_V2 (XFSSTAT_END_BMBT_V2+15) | ||
171 | __uint32_t xs_ibt_2_lookup; | ||
172 | __uint32_t xs_ibt_2_compare; | ||
173 | __uint32_t xs_ibt_2_insrec; | ||
174 | __uint32_t xs_ibt_2_delrec; | ||
175 | __uint32_t xs_ibt_2_newroot; | ||
176 | __uint32_t xs_ibt_2_killroot; | ||
177 | __uint32_t xs_ibt_2_increment; | ||
178 | __uint32_t xs_ibt_2_decrement; | ||
179 | __uint32_t xs_ibt_2_lshift; | ||
180 | __uint32_t xs_ibt_2_rshift; | ||
181 | __uint32_t xs_ibt_2_split; | ||
182 | __uint32_t xs_ibt_2_join; | ||
183 | __uint32_t xs_ibt_2_alloc; | ||
184 | __uint32_t xs_ibt_2_free; | ||
185 | __uint32_t xs_ibt_2_moves; | ||
121 | /* Extra precision counters */ | 186 | /* Extra precision counters */ |
122 | __uint64_t xs_xstrat_bytes; | 187 | __uint64_t xs_xstrat_bytes; |
123 | __uint64_t xs_write_bytes; | 188 | __uint64_t xs_write_bytes; |
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 |