2 * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
35 struct xfsstats xfsstats;
47 static struct xstats_entry {
51 { "extent_alloc", XFSSTAT_END_EXTENT_ALLOC },
52 { "abt", XFSSTAT_END_ALLOC_BTREE },
53 { "blk_map", XFSSTAT_END_BLOCK_MAPPING },
54 { "bmbt", XFSSTAT_END_BLOCK_MAP_BTREE },
55 { "dir", XFSSTAT_END_DIRECTORY_OPS },
56 { "trans", XFSSTAT_END_TRANSACTIONS },
57 { "ig", XFSSTAT_END_INODE_OPS },
58 { "log", XFSSTAT_END_LOG_OPS },
59 { "push_ail", XFSSTAT_END_TAIL_PUSHING },
60 { "xstrat", XFSSTAT_END_WRITE_CONVERT },
61 { "rw", XFSSTAT_END_READ_WRITE_OPS },
62 { "attr", XFSSTAT_END_ATTRIBUTE_OPS },
63 { "icluster", XFSSTAT_END_INODE_CLUSTER },
64 { "vnodes", XFSSTAT_END_VNODE_OPS },
67 for (i=j=len = 0; i < sizeof(xstats)/sizeof(struct xstats_entry); i++) {
68 len += sprintf(buffer + len, xstats[i].desc);
69 /* inner loop does each group */
70 while (j < xstats[i].endpoint) {
71 len += sprintf(buffer + len, " %u",
72 *(((__u32*)&xfsstats) + j));
77 /* extra precision counters */
78 len += sprintf(buffer + len, "xpc %ju %ju %ju\n",
79 (uintmax_t)xfsstats.xs_xstrat_bytes,
80 (uintmax_t)xfsstats.xs_write_bytes,
81 (uintmax_t)xfsstats.xs_read_bytes);
88 *start = buffer + offset;
89 if ((len -= offset) > count)
99 if (&xfs_read_xfsstats != NULL);
103 xfs_cleanup_procfs(void)