/*static char *SCCSID = "@(#)pvwdef.h   6.1 90/11/18";*/
/*static char *SCCSID = "@(#)pvwdef.h    13.3 90/04/28";*/

/*********************************************************************
 *
 *  8/19/92 25118 add cache hit and cache miss counters
 *                       PerfView Variables
 *
 *      This file defines all the HPFS variables used by PerfView to
 *  monitor the performance of the file system.
 *
 *  Variable definitions are of the form:
 *
 *      PVWDEF(<Type>, <Category>, <Name>)
 *
 *      <Type>      Specifies the type of the variable and can be
 *                  one of the following:
 *
 *                  CNT   - Counter
 *                  TIMR  - Timer
 *                  SUMSQ - Sum of squares
 *                  QCT   - Counter that increases and descreases   25106
 *
 *      <Category>  Is the file system category to which the variable
 *                  belongs.
 *                  For example, variables used to monitor the cache
 *                  belong to the "Cache" category.
 *
 *                  The category names and their meaning are:
 *
 *                  Name            Meaning
 *                  ----            -------
 *
 *                  Ca              Cache
 *                  Hp              Heap
 *                  FO              File Open
 *                  FC              File Close
 *                  FR              File Read
 *                  FW              File Write
 *                  FA              File Access
 *                  RA              Read Ahead
 *                  Rd              Read
 *                  IO              Disk IO
 *
 *
 *      <Name>      Is the specific name of the event or object
 *                  that the variable monitors. It is used to give a
 *                  unique name to variables belonging to the same
 *                  category.
 *
 *      Each definition creates a variable with the name
 *  Abrev(<Type>)<Category><Name>.
 *
 *  where Abrev(<Type>) is the abreviated form of <Type>. This is so
 *  because the display tool will not display the entire name if it
 *  is too long.
 *
 *  The abreviated forms are:
 *
 *      for CNT:    CT
 *          TIMR:   TM
 *          SUMSQ   SS
 *          QCT:    QC
 *
 *
 *  Examples:
 *
 *  Definition:                 Name of variable:
 *  ----------                  -----------------
 *
 *  PVWDEF(CNT,Ca,NHints)       CTCaNHints
 *  PVWDEF(TIMR,Rd,Total)       TMRdTotal
 *
 *  Note that the first two characters indicate the type, the
 *  next two characters indicate the category, and the rest indicate
 *  the specific name.
 *
 *
 *********************************************************************/



/*********************************************************************
 *
 *                          Counters
 *
 *      In order for the PerfView display tool to show the complete
 *  names, the variable names are somewhat cryptic. Before the
 *  definitions for each category there is a list of the specific
 *  names and their meaning.
 *
 *********************************************************************/



/*********************************************************************
 *
 *                          Cache
 *
 *
 *  NHints          Number of times that the file system used the
 *                  pbufNextHint field of a BufNode. This is an
 *                  advisory pointer telling where the next buffer
 *                  of a file might be.
 *
 *  NHits           Number of times that the advisory field
 *                  pbufNextHint was valid (i.e. the buffer pointed
 *                  to contained the desired data).
 *
 *  NSelf           Number of times that the advisory pointer
 *                  pbufNextHint was self-referencing (i.e. the
 *                  pointer was not to be followed).
 *
 *  BHints          Number of times that the file system used the
 *                  pbufHint field of a SECPTR structure. (i.e.
 *                  the number of times that someone refered to
 *                  a buffer in the cache -- except in those cases
 *                  where following a buffer chain, which is
 *                  covered by NHints).
 *
 *  BHits           Number of times that the pbufHint was valid.
 *
 *  ForceL          Number of times that the cache was flushed due
 *                  to no free buffers (for "Force Lazy").
 *
 *  Hit             Number of cache hits              25118
 *  Miss            Number of cache misses            25118
 *
 *******************
 *
 *  From these variables, the following data can be obtained:
 *
 *  CacheHints      Cache hints
 *  CacheHits       Cache hits
 *  CacheMiss       Cache misses
 *  HitRatio        Hit ratio
 *  MissRatio       Miss ratio
 *
 *
 *  CacheHints = NHints + NHits - NSelf
 *
 *  CacheHits  = NHits + BHits
 *
 *  CacheMiss  = CacheHints - CacheHits
 *
 *  HitRatio   = CacheHits/CacheHints
 *
 *  MissRatio  = CacheMiss/CacheHints
 *
 *********************************************************************/

PVWDEF(CNT,Ca,NHints)
PVWDEF(CNT,Ca,NHits)
PVWDEF(CNT,Ca,NSelf)
PVWDEF(CNT,Ca,BHints)
PVWDEF(CNT,Ca,BHits)
PVWDEF(CNT,Ca,ForceL)
PVWDEF(CNT,Ca,Hit)                       /*25118*/
PVWDEF(CNT,Ca,Miss)                      /*25118*/


/*********************************************************************
 *
 *                          Heap
 *
 *  Size            Total Heap Space (allocated + free).
 *
 *  Alloc           Heap allocated.
 *
 *  Sbdirs          Heap allocated to sub-directories.
 *
 *  ObjCnt          Number of objects allocated in heap
 *
 *******************
 *
 *  From these variables, the following data can be obtained:
 *
 *  PercUsed        Percentage of heap in use.
 *  PercSubdirs     Percentage of heap used by sub-directories
 *  ObjSize         Average object size
 *
 *
 *  PercUsed    =  (Alloc * 100)/Size
 *
 *  PercSubdirs = (Sbdirs * 100)/Size
 *
 *  ObjSize     =  Alloc/ObjCnt
 *
 *********************************************************************/

PVWDEF(CNT,Hp,Size)
/*PVWDEF(CNT,Hp,Alloc) 25106*/
PVWDEF(QCT,Hp,Alloc)
/*PVWDEF(CNT,Hp,Sbdirs) 25106 */
PVWDEF(QCT,Hp,Sbdirs)
/*PVWDEF(CNT,Hp,ObjCnt) 25106 */
PVWDEF(QCT,Hp,ObjCnt)



/*********************************************************************
 *
 *                       File Management
 *
 *  FO Count        File Open count.
 *
 *  FC Count        File Close count.
 *
 *  FW CurCnt       Number of files currently being written.
 *
 *  FR FilCnt       Number of files closed that have been only read.
 *
 *  FR SeqFil       Number of files closed that have been read
 *                  strictly sequentially.
 *
 *  FA Count        Number of accesses to the file allocation (i.e.
 *                  number of times that we followed the tree structure
 *                  looking for a particular leaf).
 *
 *  FA Oft          Number of accesses to file allocation using the
 *                  OFT (Open File Table).  In the Oft we keep a copy of
 *                  the first-level structures of the file allocation
 *                  tree. Thus for trees only one level deep we can
 *                  locate a particular leaf immediately.
 *                  This variable can be seen as the number of accesses
 *                  to file allocation trees only one level deep.
 *
 *******************
 *
 *  From these variables, the following data can be obtained:
 *
 *  CurrOpen        Number of files currently open
 *  DeepTreeRatio   Ratio of trees more than one level deep
 *                  (This can give us an idea of how much
 *                  is file fragmentation affecting performance)
 *
 *  CurrOpen      = FOCount - FCCount
 *  DeepTreeRatio = FAOft/FACount
 *ÿ
 *********************************************************************/

PVWDEF(CNT,FO,Count)
PVWDEF(CNT,FC,Count)
/*PVWDEF(CNT,FW,CurCnt) 25106 */
PVWDEF(QCT,FW,CurCnt)
PVWDEF(CNT,FR,FilCnt)
PVWDEF(CNT,FR,SeqFil)
PVWDEF(CNT,FA,Count)
PVWDEF(CNT,FA,Oft)



/*********************************************************************
 *
 *                         Read Ahead
 *
 *  BufCnt          Number of cache blocks read by read ahead
 *
 *  BufAcc          Number of times a buffer was accessed thinking
 *                  that the data should be valid because of
 *                  the read ahead.
 *
 *  BufHit          Number of times the data in the buffer accessed
 *                  (see BufAcc) was valid.
 *
 *  OvrWrt          Number of blocks read by the read ahead that
 *                  were overwritten before being used.
 *ÿ
 *******************
 *
 *  From these variables, the following data can be obtained:
 *
 *  RAHitRatio      Read Ahead hit ratio
 *  RAWasteRatio    Ratio of wasteful read-aheads (i.e. of those blocks
 *                  that were read and then overwritten without being
 *                  accessed)
 *
 *  RAHitRatio   = BufHit/BufAcc
 *  RAWasteRatio = OvrWrt/BufCnt
 *
 *********************************************************************/

PVWDEF(CNT,RA,BufCnt)
/*PVWDEF(CNT,RA,BufAcc) 25106 */
PVWDEF(QCT,RA,BufAcc)
PVWDEF(CNT,RA,BufHit)
PVWDEF(CNT,RA,OvrWrt)


/***********************************************************************/

#ifdef PERFVIEW2

#include "pvwdef2.h"

#endif
