
                               					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

0001    !
0002    !			  COPYRIGHT (c) 1982 BY
0003    !	      MOSTEK CORPORATION, CARROLLTON TX
0004    !
0005    ! This software is furnished under a license and may be used and  copied
0006    ! only  in  accordance  with  the  terms  of  such  license and with the
0007    ! inclusion of the above copyright notice.  This software or  any  other
0008    ! copies  thereof may not be provided or otherwise made available to any
0009    ! other person.  No title to and ownership of  the  software  is  hereby
0010    ! transferred.
0011    !
0012    ! The information in this software is subject to change  without  notice
0013    ! and  should  not  be  construed  as  a commitment by MOSTEK
0014    ! CORPORATION.
0015    !
0016    ! MOSTEK assumes no responsibility for the use or  reliability  of  its
0017    ! software on equipment which is not supplied by MOSTEK.
0018    !
0019     
0020    !++
0021    ! FACILITY:
0022    !   MOSTEK CORPORATION
0023    !
0024    ! ABSTRACT:
0025    !   DEC does not supply a very good program for getting the performance of the
0026    !   system. Thus MOUSE was born as part of a two part system stats program.
0027    !   MOUSE gathers the system information and stores it away in a file for
0028    !   use by the program STATS. 
0029    !
0030    ! ENVIRONMENT:
0031    !   VAX11 VMS
0032    !
0033    ! AUTHOR: Gary Smith, CREATION DATE: 6/24/82
0034    !
0035    ! MODIFIED BY:
0036    !
0037    !--
0038    !
0039    ! TABLE OF CONTENTS:
0040    !
0041    !
0042    ! INCLUDE FILES:
0043    !   mousesubs.for
0044    !   defrec.for
0045    !
0046    ! MACROS:
0047    !   none
0048    !
0049    ! EQUATED SYMBOLS:
0050    !   see mousesubs.for, defrec.for
0051    !
0052    ! EXTERNAL REFERENCES:
0053    !   SYS$TIMR, SYS$GETTIM, SYS$WAITFR, SYS$CANTIM, SYS$GETMSG
0054    !
0055    !++
0056    ! FUNCTIONAL DESCRIPTION:
0057    !   MOUSE as part of the system stats package wakes up at regualr intervals

                               					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

0058    !   and scurries about the system gathering all the types of information
0059    !   that the system keeps on itself. Once this information has been gathered
0060    !   it is put into a keyed file for use by the STATS program. The file of
0061    !   information is a binary file keyed by the system time of day.
0062    !
0063    !
0064    ! FORMAL PARAMETERS:
0065    !   none
0066    !
0067    !
0068    ! IMPLICIT INPUTS:
0069    !   none
0070    !
0071    !
0072    ! IMPLICIT OUTPUTS:
0073    !   none
0074    !
0075    !
0076    ! ROUTINE VALUE and
0077    ! COMPLETION CODES:
0078    !   none
0079    !
0080    !
0081    ! SIDE EFFECTS:
0082    !   none to date
0083    !
0084    !
0085    !--
0086            PROGRAM MOUSE ! MOnitor USage Evaluator
0087     
0088     
0089            include  'mousesubs.for'
0292            include  'defrec.for'
0394     
0395    !++
0396    ! local subs
0397    !--
0398     
0399            parameter init       = 1
0400            parameter end        = 2
0401     
0402            character * 16 time_key
0403            character * 80 msg
0404     
0405            integer status, rms_status, mouse_unit, err_unit
0406            integer SYS$GETTIM, SYS$GETMSG, SYS$CANTIM, SYS$SETIMR
0407            integer SYS$WAITFR, SYS$BINTIM
0408            
0409     
0410            logical first_time
0411     
0412            real * 8 timdel, current_time
0413     
0414            external SYS$GETTIM, SYS$GETMSG, SYS$CANTIM, SYS$SETIMR
0415            external SYS$WAITFR, SS$_NORMAL
0416     
0417            data         first_time / .true. /

MOUSE                          					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

0418            data         mouse_unit / 42     /
0419            data         err_unit   / 66     /
0420     
0421    !++
0422    ! Open up the stats file. Note that it is keyed by system time in the
0423    ! first sixteen bytes. Note also that is opened SHARED so that STATS can
0424    ! read the file as MOUSE is writing new info into it. The gyrations
0425    ! with opening, closing etc. is to ensure that the RATSNEST file has
0426    ! the proper protection to it.
0427    !--
0428     
0429              status = SYS$BINTIM( ascii_delta_time, timdel )
0430     
0431              open( unit=mouse_unit, status='UNKNOWN',
0432         .          organization='INDEXED', access='KEYED',
0433         .          recordtype='FIXED', form='UNFORMATTED',
0434         .          recl=(key_size+rec_size), key=(1:16:character),
0435         .          iostat=ios, err=999, shared,
0436         .          carriagecontrol='NONE',
0437         .          extendsize=3,
0438         .          file=standard_nest_file )
0439     
0440              close( unit=mouse_unit )
0441              status = MK$MOD_PROT( standard_nest_file, '10ff'x, '10ff'x )
0442     
0443              open( unit=mouse_unit, status='OLD',
0444         .          organization='INDEXED', access='KEYED',
0445         .          recordtype='FIXED', form='UNFORMATTED',
0446         .          recl=(key_size+rec_size), key=(1:16:character),
0447         .          iostat=ios, err=999, shared,
0448         .          carriagecontrol='NONE',
0449         .          extendsize=3,
0450         .          file=standard_nest_file )
0451     
0452    40      continue
0453            do while ( .true. )  !! do this forever 
0454     
0455                 status = SYS$SETIMR( %VAL(1),timdel,,) !!set delay unit
0456     
0457    !+
0458    ! Cycle thru all the various stat gathering subroutines
0459    !_
0460                 status = SYS$GETTIM( current_time )         !! current time
0461     
0462                 call STATRESP( init )  !! Initialize for response
0463                 call STATCPU           !! Cpu
0464                 call STATFCP           !! FCP usage
0465                 call STATMISC          !! Miscellaneous
0466                 call STATMEM           !! Memory
0467                 call STATPGFLT         !! Page faults
0468                 call STATSCH           !! Scheduler states
0469                 call STATSWAP          !! Swapping
0470                 call STATUP            !! Uptime
0471                 call STATNET           !! DECnet 
0472                 call STATLOCK          !! ENQ/DEQ stats
0473                 call STATPOOL          !! Non-paged pool
0474     

MOUSE                          					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   4
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

0475                 encode( 16, 100, time_key ) current_time 
0476    100          format( z16 )
0477     
0478     
0479    !++
0480    ! Throw away the first set of data since we don't know if MOUSE was
0481    ! started at the time the system was brought up. Unless this is done,
0482    ! erroneously high counts will be put into the performance file.
0483    !--
0484     
0485                 if ( .not. first_time ) then
0486                    write( unit=mouse_unit, iostat=ios, err=999 ) time_key,
0487         .                                                        stats_rec
0488                 end if 
0489     
0490                 call STATRESP( end )
0491     
0492                 status = SYS$WAITFR( %VAL(wait_ef) )
0493                 status = SYS$CANTIM( , )
0494     
0495                 first_time = .false. 
0496     
0497            end do
0498     
0499    !++
0500    ! In case of failure due to writing or to initially opening the stats file,
0501    ! the "err=" conditional bounces you to here and all execution ceases.
0502    ! With any luck, the "ios" can be transmogrified to a meaningful
0503    ! system error msg and put away for later use.
0504    !--
0505     
0506    999     continue
0507            close( unit=mouse_unit )
0508            call ERRSNS( ios, rms_status , , mouse_unit, )
0509            status = SYS$GETMSG( %VAL(rms_status), , msg, , )
0510            open( unit=err_unit, file='MOUSE.ERR', status='NEW' )
0511            write( unit=err_unit, fmt=9991 ) msg(1:MK$LENGTH(msg)), 
0512         .                                   rms_status
0513    9991    format( ' ', 'MOUSE died due to ', A, '. RMS status is', z8 )
0514            close( unit=err_unit )
0515            stop ' '
0516            end

MOUSE                          					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   5
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  447   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                 108   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                 600   PIC CON REL LCL NOSHR NOEXE   RD   WRT QUAD
  3 REC_COMMON                             348   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                 1503


ENTRY POINTS

    Address  Type  Name                                        References

  0-00000000       MOUSE                                          86     


VARIABLES

    Address  Type  Name                            Attributes  References

  2-00000068  R*8  CURRENT_TIME                                  412       460A      475     
  2-0000007C  I*4  ERR_UNIT                                      405       419D      510A      511       514A    
  2-00000080  L*4  FIRST_TIME                                    410       417D      485       495=    
  2-00000084  I*4  IOS                                           431=A     443=A     486=      508A    
  2-00000078  I*4  MOUSE_UNIT                                    405       418D      431A      440A      443A      486     
							         507A      508A    

  2-00000010  CHAR MSG                                           403       509A      511(2)A 
  3-00000108  I*4  REC_RESPONSE                    COMM EQUIV    295       352     
  2-00000074  I*4  RMS_STATUS                                    405       508A      509       511     
  2-00000070  I*4  STATUS                                        405       429=      441=      455=      460=      492=    
							         493=      509=    
  2-00000060  R*8  TIMDEL                                        412       429A      455A    

  2-00000000  CHAR TIME_KEY                                      402       475       486     


ARRAYS

    Address  Type  Name                            Attributes        Bytes  Dimensions       References

  3-00000000  I*4  REC_CPU_MODES                   COMM EQUIV          36  (9)                 297       309     
  3-00000024  I*4  REC_FCP                         COMM EQUIV          20  (5)                 303       316     
  3-00000120  I*4  REC_LOCK_MODES                  COMM EQUIV          28  (7)                 305       371     
  3-00000080  I*4  REC_MEM_MODES                   COMM EQUIV           8  (2)                 298       321     
  3-00000038  I*4  REC_MISC                        COMM EQUIV          72  (18)                300       318     

  3-0000010C  I*4  REC_NET_MODES                   COMM EQUIV          20  (5)                 304       361     
  3-00000088  I*4  REC_PGFLT                       COMM EQUIV          28  (7)                 302       325     
  3-0000013C  I*4  REC_POOL_MODES                  COMM EQUIV          32  (8)                 306       382     
  3-000000A4  I*4  REC_SCH_STATE                   COMM EQUIV          56  (14)                301       330     
  3-000000DC  I*4  REC_SWAP                        COMM EQUIV          36  (9)                 299       336     

  3-00000100  I*4  REC_TIME                        COMM EQUIV           8  (2)                 296       343     

MOUSE                          					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   6
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

  3-00000000  I*4  STATS_REC                       COMM EQUIV         348  (87)                293       307       309     
											       316       318       321     
											       325       330       336     
											       343       352       361     
											       371       382       486     


PARAMETER CONSTANTS

  Type  Name                                                   References

   I*2  ARRLOCPK                                                 236#    
   I*2  ARRTRAPK                                                 237#    
   CHAR ASCII_DELTA_TIME                                          94        95#      429     
   I*2  BIGHOLE                                                  270#    
   I*2  BJOBCNT                                                  126#    

   I*2  BUFIO                                                    147#    
   I*2  CEF                                                      193#    
   I*2  COLPG                                                    191#    
   I*2  COM                                                      202#    
   I*2  COMO                                                     203#    

   I*2  COMPAT                                                   124#    
   I*2  CPU_SIZE                                                 129#      286       297       316       318       321     
							         325       330       336       343       352       361     
							         371       382     
   I*2  CUR                                                      204#    
   I*2  DEPLOCPK                                                 238#    
   I*2  DEQ                                                      252#    

   I*2  DIRHIT                                                   156#    
   I*2  DIRIO                                                    146#    
   I*2  DIRMISS                                                  157#    
   I*2  DLCKFND                                                  253#    
   I*2  DLCKSRCH                                                 254#    

   I*2  DZROFLTS                                                 178#    
   I*2  END                                                      400#      490     
   I*2  ENQCVT                                                   255#    
   I*2  ENQNEW                                                   250#    
   I*2  ENQNOTQD                                                 256#    

   I*2  ENQWAIT                                                  251#    
   I*2  EXEC                                                     121#    
   I*2  EXTHIT                                                   158#    
   I*2  EXTMISS                                                  159#    
   I*2  FAULTS                                                   179#    

   I*2  FCP_CACHE                                                136#    
   I*2  FCP_CALLS                                                135#    
   I*2  FCP_CPU                                                  137#    
   I*2  FCP_READ                                                 138#    
   I*2  FCP_SIZE                                                 141#      286       303       318       321       325     
							         330       336       343       352       361       371     
							         382     


MOUSE                          					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   7
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

   I*2  FCP_WRITE                                                139#    
   I*2  FIDHIT                                                   160#    
   I*2  FIDMISS                                                  161#    
   I*2  FPG                                                      201#    
   I*2  FREECNT                                                  170#    

   I*2  GETDVI_EF                                                109#    
   I*2  HIB                                                      197#    
   I*2  HIBO                                                     198#    
   I*2  HISWPCNT                                                 216#    
   I*2  HIT                                                      153#    

   I*2  HOLECNT                                                  269#    
   I*2  HOLESUM                                                  273#    
   I*2  HOSWPCNT                                                 215#    
   I*2  IDLE                                                     125#    
   I*2  IJOBCNT                                                  127#    

   I*2  INIT                                                     399#      462     
   I*2  INT                                                      123#    
   I*2  IRPCNT                                                   268#    
   I*2  ISPAGCNT                                                 211#    
   I*2  ISWPCNT                                                  212#    

   I*2  KERNEL                                                   119#    
   I*2  KEY_SIZE                                                 115#      431       443     
   I*2  LEF                                                      195#    
   I*2  LEFO                                                     196#    
   I*2  LOCK_SIZE                                                261#      286       305       382     

   I*2  LOGNAM                                                   148#    
   I*2  LRPCNT                                                   274#    
   I*2  MBREADS                                                  149#    
   I*2  MBWRITES                                                 150#    
   I*2  MEM_SIZE                                                 173#      286       298       325       330       336     
							         343       352       361       371       382     

   I*2  MFYCNT                                                   171#    
   I*2  MISC_SIZE                                                165#      286       300       321       325       330     
							         336       343       352       361       371       382     
   I*2  MWAIT                                                    192#    
   I*2  NET_SIZE                                                 245#      286       304       371       382     
   I*2  NUM_MODES                                                130#    

   I*2  OPEN                                                     155#    
   I*2  OPENS                                                    154#    
   I*2  OSWPCNT                                                  214#    
   I*2  PFW                                                      194#    
   I*2  PGFLT_SIZE                                               186#      286       302       330       336       343     
							         352       361       371       382     

   I*2  POOL_SIZE                                                281#      286       306     
   I*2  PREADIO                                                  180#    
   I*2  PREADS                                                   182#    
   I*2  PROCCNT                                                  213#    
   I*2  PWRITES                                                  183#    


MOUSE                          					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   8
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

   I*2  PWRITIO                                                  181#    
   I*2  QUOHIT                                                   162#    
   I*2  QUOMISS                                                  163#    
   I*2  RCVBUFFL                                                 239#    
   I*2  RDFLTS                                                   184#    

   I*2  REC_SIZE                                                 286#      307       431       443     
   I*2  RES                                                      231#    
   I*2  RESPONSE_SIZE                                            230#      286       361       371       382     
   I*2  SCH_SIZE                                                 206#      286       301       336       343       352     
							         361       371       382     
   I*2  SMALLCNT                                                 272#    

   I*2  SMALLHOLE                                                271#    
   I*2  SPLIT                                                    152#    
   I*2  SRPCNT                                                   275#    
   CHAR STANDARD_NEST_FILE                                       101       102#      431       441       443     
   I*2  SUPER                                                    120#    

   I*2  SUSP                                                     199#    
   I*2  SUSPO                                                    200#    
   I*2  SWAP_SIZE                                                218#      286       299       343       352       361     
							         371       382     
   I*2  SWAP_SPARES                                              219#    
   I*2  TIME_SIZE                                                224#      286       296       352       361       371     
							         382     

   I*2  TRCNGLOS                                                 240#    
   I*2  TURN                                                     151#    
   I*2  USER                                                     122#    
   I*2  WAIT_EF                                                  108#      492     


LABELS

    Address   Label                                            References

  0-00000048  40                                                 452#    
  1-0000003D  100'                                               475       476#    
  0-00000139  999                                                431       443       486       506#    
  1-00000040  9991'                                              511       513#    


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                                   References

        FOR$CLOSE                                                440       507       514     
        FOR$ERRSNS                                               508     
        FOR$OPEN                                                 431       443       510     
   I*4  MK$LENGTH                                                511     
   I*4  MK$MOD_PROT                                              441     

        SS$_NORMAL                                               415     
        STATCPU                                                  463     
        STATFCP                                                  464     
        STATLOCK                                                 472     

MOUSE                          					20-May-1983 10:17:04	VAX-11 FORTRAN V3.2-37              Page   9
								10-May-1983 09:59:58	CAD$VOLSET:[GARY.STATS.SOURCE]MOUSE.FOR;229 

        STATMEM                                                  466     

        STATMISC                                                 465     
        STATNET                                                  471     
        STATPGFLT                                                467     
        STATPOOL                                                 473     
        STATRESP                                                 462       490     

        STATSCH                                                  468     
        STATSWAP                                                 469     
        STATUP                                                   470     
   I*4  SYS$BINTIM                                               407       429     
   I*4  SYS$CANTIM                                               406       414       493     

   I*4  SYS$GETMSG                                               406       414       509     
   I*4  SYS$GETTIM                                               406       414       460     
   I*4  SYS$SETIMR                                               406       414       455     
   I*4  SYS$WAITFR                                               407       415       492     


  +----------------------------------------------+
  |           KEY TO REFERENCE FLAGS             |
  |   =   - Value Modified                       |
  |   #   - Defining Reference                   |
  |   A   - Actual Argument, possibly modified   |
  |   D   - Data Initialization                  |
  |  (n)  - Number of occurrences on line        |
  +----------------------------------------------+



COMMAND QUALIFIERS

  FORTRAN /DEBUG/OBJECT=OBJ:MOUSE/LIST=LIS:MOUSE/CONT=99/CROSS/NOOPT SRC:MOUSE

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(SYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP)
  /F77  /NOG_FLOATING  /I4  /NOOPTIMIZE  /WARNINGS  /NOD_LINES  /CROSS_REFERENCE  /NOMACHINE_CODE  /CONTINUATIONS=99


COMPILATION STATISTICS

  Run Time:           3.47 seconds
  Elapsed Time:       15.18 seconds
  Page Faults:        318
  Dynamic Memory:     852 pages
