~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/linux/coda_proc.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.