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