pre-2.3.4..
[davej-history.git] / include / linux / coda_proc.h
blobc86a588edcd431f8b0f337aa53da8272a8747428
1 /*
2 * coda_statis.h
3 *
4 * CODA operation statistics
6 * (c) March, 1998
7 * by Michihiro Kuramochi, Zhenyu Xia and Zhanyong Wan
8 * zhanyong.wan@yale.edu
12 #ifndef _CODA_PROC_H
13 #define _CODA_PROC_H
15 void coda_sysctl_init(void);
16 void coda_sysctl_clean(void);
17 void coda_upcall_stats(int opcode, unsigned long jiffies);
19 #include <linux/sysctl.h>
20 #include <linux/coda_fs_i.h>
21 #include <linux/coda.h>
23 /* these four files are presented to show the result of the statistics:
25 * /proc/fs/coda/vfs_stats
26 * upcall_stats
27 * permission_stats
28 * cache_inv_stats
30 * these four files are presented to reset the statistics to 0:
32 * /proc/sys/coda/vfs_stats
33 * upcall_stats
34 * permission_stats
35 * cache_inv_stats
38 /* VFS operation statistics */
39 struct coda_vfs_stats
41 /* file operations */
42 int file_read;
43 int file_write;
44 int file_mmap;
45 int open;
46 int release;
47 int fsync;
49 /* dir operations */
50 int readdir;
52 /* inode operations */
53 int create;
54 int lookup;
55 int link;
56 int unlink;
57 int symlink;
58 int mkdir;
59 int rmdir;
60 int rename;
61 int permission;
62 int readpage;
64 /* symlink operatoins*/
65 int follow_link;
66 int readlink;
69 struct coda_upcall_stats_entry
71 int count;
72 unsigned long time_sum;
73 unsigned long time_squared_sum;
78 /* cache hits for permissions statistics */
79 struct coda_permission_stats
81 int count;
82 int hit_count;
85 /* cache invalidation statistics */
86 struct coda_cache_inv_stats
88 int flush;
89 int purge_user;
90 int zap_dir;
91 int zap_file;
92 int zap_vnode;
93 int purge_fid;
94 int replace;
97 /* these global variables hold the actual statistics data */
98 extern struct coda_vfs_stats coda_vfs_stat;
99 extern struct coda_permission_stats coda_permission_stat;
100 extern struct coda_cache_inv_stats coda_cache_inv_stat;
102 /* reset statistics to 0 */
103 void reset_coda_vfs_stats( void );
104 void reset_coda_upcall_stats( void );
105 void reset_coda_permission_stats( void );
106 void reset_coda_cache_inv_stats( void );
108 /* some utitlities to make it easier for you to do statistics for time */
109 void do_time_stats( struct coda_upcall_stats_entry * pentry,
110 unsigned long jiffy );
112 double get_time_average( const struct coda_upcall_stats_entry * pentry );
113 double get_time_std_deviation( const struct coda_upcall_stats_entry * pentry );
115 unsigned long get_time_average( const struct coda_upcall_stats_entry * pentry );
116 unsigned long get_time_std_deviation( const struct coda_upcall_stats_entry * pentry );
118 /* like coda_dointvec, these functions are to be registered in the ctl_table
119 * data structure for /proc/sys/... files
121 int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
122 void * buffer, size_t * lenp );
123 int do_reset_coda_upcall_stats( ctl_table * table, int write,
124 struct file * filp, void * buffer,
125 size_t * lenp );
126 int do_reset_coda_permission_stats( ctl_table * table, int write,
127 struct file * filp, void * buffer,
128 size_t * lenp );
129 int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
130 struct file * filp, void * buffer,
131 size_t * lenp );
133 /* these functions are called to form the content of /proc/fs/coda/... files */
134 int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset,
135 int length, int dummy );
136 int coda_upcall_stats_get_info( char * buffer, char ** start, off_t offset,
137 int length, int dummy );
138 int coda_permission_stats_get_info( char * buffer, char ** start, off_t offset,
139 int length, int dummy );
140 int coda_cache_inv_stats_get_info( char * buffer, char ** start, off_t offset,
141 int length, int dummy );
144 #endif /* _CODA_PROC_H */