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