coda_opstats.h revision 1.1 1 /*
2
3 Coda: an Experimental Distributed File System
4 Release 3.1
5
6 Copyright (c) 1987-1998 Carnegie Mellon University
7 All Rights Reserved
8
9 Permission to use, copy, modify and distribute this software and its
10 documentation is hereby granted, provided that both the copyright
11 notice and this permission notice appear in all copies of the
12 software, derivative works or modified versions, and any portions
13 thereof, and that both notices appear in supporting documentation, and
14 that credit is given to Carnegie Mellon University in all documents
15 and publicity pertaining to direct or indirect use of this code or its
16 derivatives.
17
18 CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
19 SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
20 FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
21 DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
22 RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
23 ANY DERIVATIVE WORK.
24
25 Carnegie Mellon encourages users of this software to return any
26 improvements or extensions that they make, and to grant Carnegie
27 Mellon the rights to redistribute these changes without encumbrance.
28 */
29
30 /* $Header: /tank/opengrok/rsync2/NetBSD/src/sys/coda/coda_opstats.h,v 1.1 1998/08/29 21:26:46 rvb Exp $ */
31
32
33 /*
34 * operation stats: what the minicache can intercept that
35 * *isn't* seen by venus. These stats are kept to augment
36 * the stats maintained by the Volume-Session mechanism.
37 */
38
39 /* vfsops:
40 * mount: not currently bounced to Venus
41 * umount: nope
42 * root: only first call, rest is cached.
43 * statfs: none (bogus)
44 * sync: none (bogus)
45 * vget: all
46 */
47
48 #define CFS_MOUNT_STATS 0
49 #define CFS_UMOUNT_STATS 1
50 #define CFS_ROOT_STATS 2
51 #define CFS_STATFS_STATS 3
52 #define CFS_SYNC_STATS 4
53 #define CFS_VGET_STATS 5
54 #define CFS_VFSOPS_SIZE 6
55
56 /* vnodeops:
57 * open: all to venus
58 * close: all to venus
59 * rdrw: bogus. Maybe redirected to UFS.
60 * May call open/close for internal opens/closes
61 * (Does exec not call open?)
62 * ioctl: causes a lookupname
63 * passes through
64 * select: can't get there from here.
65 * getattr: can be satsified by cache
66 * setattr: all go through
67 * access: can be satisfied by cache
68 * readlink: can be satisfied by cache
69 * fsync: passes through
70 * inactive: passes through
71 * lookup: can be satisfied by cache
72 * create: passes through
73 * remove: passes through
74 * link: passes through
75 * rename: passes through
76 * mkdir: passes through
77 * rmdir: passes through
78 * symlink: passes through
79 * readdir: may be redirected to UFS
80 * may cause an "internal" open/close
81 */
82
83 #define CFS_OPEN_STATS 0
84 #define CFS_CLOSE_STATS 1
85 #define CFS_RDWR_STATS 2
86 #define CFS_IOCTL_STATS 3
87 #define CFS_SELECT_STATS 4
88 #define CFS_GETATTR_STATS 5
89 #define CFS_SETATTR_STATS 6
90 #define CFS_ACCESS_STATS 7
91 #define CFS_READLINK_STATS 8
92 #define CFS_FSYNC_STATS 9
93 #define CFS_INACTIVE_STATS 10
94 #define CFS_LOOKUP_STATS 11
95 #define CFS_CREATE_STATS 12
96 #define CFS_REMOVE_STATS 13
97 #define CFS_LINK_STATS 14
98 #define CFS_RENAME_STATS 15
99 #define CFS_MKDIR_STATS 16
100 #define CFS_RMDIR_STATS 17
101 #define CFS_SYMLINK_STATS 18
102 #define CFS_READDIR_STATS 19
103 #define CFS_VNODEOPS_SIZE 20
104
105
106 /*
107 * I propose the following structres:
108 */
109
110
111 struct cfs_op_stats {
112 int opcode; /* vfs opcode */
113 long entries; /* number of times call attempted */
114 long sat_intrn; /* number of times call satisfied by cache */
115 long unsat_intrn; /* number of times call failed in cache, but
116 was not bounced to venus proper. */
117 long gen_intrn; /* number of times call generated internally */
118 /* (do we need that?) */
119 };
120
121
122 /*
123 * With each call to the minicache, we'll bump the counters whenver
124 * a call is satisfied internally (through the cache or through a
125 * redirect), and whenever an operation is caused internally.
126 * Then, we can add the total operations caught by the minicache
127 * to the world-wide totals, and leave a caveat for the specific
128 * graphs later.
129 */
130