23 static int counter_val(
int idx)
35 __uint64_t xs_xstrat_bytes = 0;
36 __uint64_t xs_write_bytes = 0;
37 __uint64_t xs_read_bytes = 0;
39 static const struct xstats_entry {
43 {
"extent_alloc", XFSSTAT_END_EXTENT_ALLOC },
44 {
"abt", XFSSTAT_END_ALLOC_BTREE },
45 {
"blk_map", XFSSTAT_END_BLOCK_MAPPING },
46 {
"bmbt", XFSSTAT_END_BLOCK_MAP_BTREE },
47 {
"dir", XFSSTAT_END_DIRECTORY_OPS },
48 {
"trans", XFSSTAT_END_TRANSACTIONS },
49 {
"ig", XFSSTAT_END_INODE_OPS },
50 {
"log", XFSSTAT_END_LOG_OPS },
51 {
"push_ail", XFSSTAT_END_TAIL_PUSHING },
52 {
"xstrat", XFSSTAT_END_WRITE_CONVERT },
53 {
"rw", XFSSTAT_END_READ_WRITE_OPS },
54 {
"attr", XFSSTAT_END_ATTRIBUTE_OPS },
55 {
"icluster", XFSSTAT_END_INODE_CLUSTER },
56 {
"vnodes", XFSSTAT_END_VNODE_OPS },
57 {
"buf", XFSSTAT_END_BUF },
58 {
"abtb2", XFSSTAT_END_ABTB_V2 },
59 {
"abtc2", XFSSTAT_END_ABTC_V2 },
60 {
"bmbt2", XFSSTAT_END_BMBT_V2 },
61 {
"ibt2", XFSSTAT_END_IBT_V2 },
63 {
"qm", XFSSTAT_END_QM },
70 for (; j < xstats[
i].endpoint; j++)
76 xs_xstrat_bytes +=
per_cpu(xfsstats, i).xs_xstrat_bytes;
77 xs_write_bytes +=
per_cpu(xfsstats, i).xs_write_bytes;
78 xs_read_bytes +=
per_cpu(xfsstats, i).xs_read_bytes;
82 xs_xstrat_bytes, xs_write_bytes, xs_read_bytes);
99 .open = xfs_stat_proc_open,
106 #ifdef CONFIG_XFS_QUOTA
107 static int xqm_proc_show(
struct seq_file *m,
void *v)
112 counter_val(XFSSTAT_END_XQMSTAT),
114 counter_val(XFSSTAT_END_XQMSTAT + 1));
125 .open = xqm_proc_open,
132 static int xqmstat_proc_show(
struct seq_file *m,
void *v)
137 for (j = XFSSTAT_END_IBT_V2; j < XFSSTAT_END_XQMSTAT; j++)
150 .open = xqmstat_proc_open,
163 if (!proc_create(
"fs/xfs/stat", 0,
NULL,
164 &xfs_stat_proc_fops))
165 goto out_remove_xfs_dir;
166 #ifdef CONFIG_XFS_QUOTA
167 if (!proc_create(
"fs/xfs/xqmstat", 0,
NULL,
169 goto out_remove_stat_file;
170 if (!proc_create(
"fs/xfs/xqm", 0,
NULL,
172 goto out_remove_xqmstat_file;
176 #ifdef CONFIG_XFS_QUOTA
177 out_remove_xqmstat_file:
179 out_remove_stat_file:
191 #ifdef CONFIG_XFS_QUOTA