
                               					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   1
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

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: STATDISK gathers the important info on disk activity going
0025    !           on on the system.
0026    !   
0027    !
0028    ! ENVIRONMENT: VAX/VMS unpriv
0029    !   
0030    !
0031    ! AUTHOR: Gary Smith, CREATION DATE: 3/30/83
0032    !
0033    ! MODIFIED BY:
0034    !
0035    !--
0036    !
0037    ! TABLE OF CONTENTS:
0038    !
0039    !
0040    ! INCLUDE FILES: mousesubs.for
0041    !
0042    !
0043    ! MACROS: none
0044    !
0045    !
0046    ! EQUATED SYMBOLS: see mousesubs.for
0047    !
0048    !
0049    ! EXTERNAL REFERENCES: DVI$_FREEBLOCKS  -> number of free block on the volume
0050    !                      DVI$_OPCNT       -> operation count
0051    !                      DVI$_REFCNT      -> number of channels assigned to the
0052    !                                          device
0053    !                      DVI$_TRANSCNT    -> volume transaction count
0054    !
0055     
0056    !++
0057    ! FUNCTIONAL DESCRIPTION: The disks currently known to the system are kept

                               					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   2
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

0058    !                         in a device database along with the all the other
0059    !                         devices hung off the system. The subroutine
0060    !                         GETDISK is called to build up the list of these
0061    !                         disks. Armed with this info, STATDISK uses
0062    !                         SYS$GETDVI to get the info needed.
0063    !
0064    !
0065    !
0066    ! FORMAL PARAMETERS: none
0067    !
0068    !
0069    !
0070    ! IMPLICIT INPUTS: none
0071    !
0072    !
0073    !
0074    ! IMPLICIT OUTPUTS: the disk list created by GETDISK
0075    !
0076    !
0077    !
0078    ! ROUTINE VALUE and
0079    ! COMPLETION CODES: none
0080    !
0081    !
0082    !
0083    ! SIDE EFFECTS: STATDISK calls GETDISK which runs momentarily in
0084    !               <<<KERNEL>>> mode.
0085    !
0086    !
0087    !
0088    !--
0089              SUBROUTINE STATDISK
0090     
0091              include 'mousesubs.for'
0308     
0309              integer disk_count, temp, d_offset
0310              integer ucb_list(max_disks), last(max_disks)
0311              integer itmlst(3)
0312              integer disk(disk_size)
0313              
0314              character * (name_siz) name_list(max_disks)
0315     
0316              common / disk_com1 / disk_count, name_list, ucb_list
0317              common / disk_common / disk
0318     
0319              external DVI$_FREEBLOCKS
0320              external DVI$_ERRCNT
0321              external DVI$_OPCNT
0322              external DVI$_REFCNT
0323              external DVI$_TRANSCNT
0324     
0325    !++
0326    ! find out what disks are in the system
0327    !--
0328     
0329              call getdisk
0330     

STATDISK                       					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   3
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

0331    !++
0332    ! now retrieve onfo on those disks
0333    !--
0334     
0335              disk(d_count) = disk_count
0336     
0337              do i = 1, disk_count
0338     
0339    !++
0340    ! the name of the disk and the number of free blocks
0341    !--
0342     
0343                 d_offset = 2 + (i-1) * per_disk
0344                 status = ML$L_POKE( %loc(name_list(i)(3:6)),
0345         .                           %loc(disk(d_offset)) )
0346                 itmlst(1) = 4 + ( %loc(DVI$_FREEBLOCKS) * 2 ** 16 )
0347                 itmlst(2) = %loc( disk(d_offset + freeblocks) )
0348                 status = SYS$GETDVI( %val(getdvi_ef), %val(0),
0349         .                            name_list(i)(3:6), itmlst, %val(0),
0350         .                            %val(0), %val(0), %val(0) )
0351                 status = SYS$WAITFR( %val(getdvi_ef) )
0352     
0353    !++
0354    ! operation count
0355    !--
0356     
0357                 itmlst(1) = 4 + ( %loc(DVI$_OPCNT) * 2 ** 16 )
0358                 itmlst(2) = %loc( disk(d_offset + opcnt) )
0359                 status = SYS$GETDVI( %val(getdvi_ef), %val(0),
0360         .                            name_list(i)(3:6), itmlst, %val(0),
0361         .                            %val(0), %val(0), %val(0) )
0362                 status = SYS$WAITFR( %val(getdvi_ef) )
0363     
0364     
0365    !++
0366    ! reference count, ie the number of channel assigned to the disk
0367    !--
0368     
0369                 itmlst(1) = 4 + ( %loc(DVI$_REFCNT) * 2 ** 16 )
0370                 itmlst(2) = %loc( disk(d_offset + refcnt) )
0371                 status = SYS$GETDVI( %val(getdvi_ef), %val(0),
0372         .                            name_list(i)(3:6), itmlst, %val(0),
0373         .                            %val(0), %val(0), %val(0) )
0374                 status = SYS$WAITFR( %val(getdvi_ef) )
0375     
0376    !++
0377    ! the transaction count to the disk
0378    !--
0379     
0380                 itmlst(1) = 4 + ( %loc(DVI$_TRANSCNT) * 2 ** 16 )
0381                 itmlst(2) = %loc( disk(d_offset + transcnt) )
0382                 status = SYS$GETDVI( %val(getdvi_ef), %val(0),
0383         .                            name_list(i)(3:6), itmlst, %val(0),
0384         .                            %val(0), %val(0), %val(0) )
0385                 status = SYS$WAITFR( %val(getdvi_ef) )
0386     
0387              end do

STATDISK                       					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   4
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

0388     
0389    !++
0390    ! compute the differences between the number of operations
0391    !--
0392     
0393              do i = 1, disk_count
0394                 d_offset = 2 + (i-1) * per_disk
0395                 temp = disk(d_offset + opcnt)
0396                 disk(d_offset + opcnt) = disk(d_offset + opcnt) - last(i)
0397                 last(i) = temp
0398              end do
0399     
0400              return
0401              end




PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  462   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  2 $LOCAL                                 164   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG
  3 DISK_COM1                              324   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG
  4 DISK_COMMON                            324   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                 1274


ENTRY POINTS

    Address  Type  Name                                        References

  0-00000000       STATDISK                                       89     


VARIABLES

    Address  Type  Name                            Attributes  References

  3-00000000  I*4  DISK_COUNT                      COMM          309       316       335       337       393     
  2-00000050  I*4  D_OFFSET                                      309       343=      344       347       358       370     
							         381       394=      395       396(2)  
  2-00000054  I*4  I                                             337=      343       344       348       359       371     
							         382       393=      394       396       397     
  2-00000058  R*4  STATUS                                        344=      348=      351=      359=      362=      371=    
							         374=      382=      385=    
  2-0000004C  I*4  TEMP                                          309       395=      397     


STATDISK                       					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   5
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

ARRAYS

    Address  Type  Name          Attributes        Bytes  Dimensions       References

  4-00000000  I*4  DISK          COMM               324  (81)              312       317       335=      344       347     
									   358       370       381       395       396(2)= 
  2-00000040  I*4  ITMLST                            12  (3)               311       346=      347=      348A      357=    
									   358=      359A      369=      370=      371A    
									   380=      381=      382A    
  2-00000000  I*4  LAST                              64  (16)              310       396       397=    
  3-00000004  CHAR NAME_LIST     COMM               256  (16)              314       316       344       348A      359A    
									   371A      382A    
  3-00000104  I*4  UCB_LIST      COMM                64  (16)              310       316     



PARAMETER CONSTANTS

  Type  Name                                                   References

   I*2  ARRLOCPK                                                 238#    
   I*2  ARRTRAPK                                                 239#    
   CHAR ASCII_DELTA_TIME                                          96        97#    
   I*2  BIGHOLE                                                  272#    
   I*2  BJOBCNT                                                  127#    

   I*2  BUFIO                                                    149#    
   I*2  CEF                                                      195#    
   I*2  COLPG                                                    193#    
   I*2  COM                                                      204#    
   I*2  COMO                                                     205#    

   I*2  COMPAT                                                   126#    
   I*2  CPU_SIZE                                                 131#      302     
   I*2  CUR                                                      206#    
   I*2  DEPLOCPK                                                 240#    
   I*2  DEQ                                                      254#    

   I*2  DIRHIT                                                   158#    
   I*2  DIRIO                                                    148#    
   I*2  DIRMISS                                                  159#    
   I*2  DISK_SIZE                                                297#      302       312     
   I*2  DLCKFND                                                  255#    

   I*2  DLCKSRCH                                                 256#    
   I*2  DZROFLTS                                                 180#    
   I*2  D_COUNT                                                  289#      335     
   I*2  ENQCVT                                                   257#    
   I*2  ENQNEW                                                   252#    

   I*2  ENQNOTQD                                                 258#    
   I*2  ENQWAIT                                                  253#    
   I*2  EXEC                                                     123#    
   I*2  EXTHIT                                                   160#    
   I*2  EXTMISS                                                  161#    

   I*2  FAULTS                                                   181#    

STATDISK                       					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   6
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

   I*2  FCP_CACHE                                                138#    
   I*2  FCP_CALLS                                                137#    
   I*2  FCP_CPU                                                  139#    
   I*2  FCP_READ                                                 140#    

   I*2  FCP_SIZE                                                 143#      302     
   I*2  FCP_WRITE                                                141#    
   I*2  FIDHIT                                                   162#    
   I*2  FIDMISS                                                  163#    
   I*2  FPG                                                      203#    

   I*2  FREEBLOCKS                                               290#      347     
   I*2  FREECNT                                                  172#    
   I*2  GETDVI_EF                                                111#      348       351       359       362       371     
							         374       382       385     
   I*2  HIB                                                      199#    
   I*2  HIBO                                                     200#    

   I*2  HISWPCNT                                                 218#    
   I*2  HIT                                                      155#    
   I*2  HOLECNT                                                  271#    
   I*2  HOLESUM                                                  275#    
   I*2  HOSWPCNT                                                 217#    

   I*2  IJOBCNT                                                  128#    
   I*2  INT                                                      125#    
   I*2  IRPCNT                                                   270#    
   I*2  ISPAGCNT                                                 213#    
   I*2  ISWPCNT                                                  214#    

   I*2  KERNEL                                                   121#    
   I*2  KEY_SIZE                                                 117#    
   I*2  LEF                                                      197#    
   I*2  LEFO                                                     198#    
   I*2  LOCK_SIZE                                                263#      302     

   I*2  LOGNAM                                                   150#    
   I*2  LRPCNT                                                   276#    
   I*2  MAX_DISKS                                                295#      297       310(2)    314     
   I*2  MBREADS                                                  151#    
   I*2  MBWRITES                                                 152#    

   I*2  MEM_SIZE                                                 175#      302     
   I*2  MFYCNT                                                   173#    
   I*2  MISC_SIZE                                                167#      302     
   I*2  MWAIT                                                    194#    
   I*2  NAME_SIZ                                                 296#      314     

   I*2  NET_SIZE                                                 247#      302     
   I*2  NJOBCNT                                                  129#    
   I*2  NUM_MODES                                                132#    
   I*2  OPCNT                                                    291#      358       395       396(2)  
   I*2  OPEN                                                     165#    

   I*2  OPENS                                                    156#    
   I*2  OSWPCNT                                                  216#    
   I*2  PER_DISK                                                 294#      297       343       394     

STATDISK                       					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   7
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

   I*2  PFW                                                      196#    
   I*2  PGFLT_SIZE                                               188#      302     

   I*2  POOL_SIZE                                                283#      302     
   I*2  PREADIO                                                  182#    
   I*2  PREADS                                                   184#    
   I*2  PROCCNT                                                  215#    
   I*2  PWRITES                                                  185#    

   I*2  PWRITIO                                                  183#    
   I*2  QUOHIT                                                   164#    
   I*2  QUOMISS                                                  157#    
   I*2  RCVBUFFL                                                 241#    
   I*2  RDFLTS                                                   186#    

   I*2  REC_SIZE                                                 302#    
   I*2  REFCNT                                                   292#      370     
   I*2  RES                                                      233#    
   I*2  RESPONSE_SIZE                                            232#      302     
   I*2  SCH_SIZE                                                 208#      302     

   I*2  SMALLCNT                                                 274#    
   I*2  SMALLHOLE                                                273#    
   I*2  SPLIT                                                    154#    
   I*2  SRPCNT                                                   277#    
   CHAR STANDARD_NEST_FILE                                       103       104#    

   I*2  SUPER                                                    122#    
   I*2  SUSP                                                     201#    
   I*2  SUSPO                                                    202#    
   I*2  SWAP_SIZE                                                220#      302     
   I*2  SWAP_SPARES                                              221#    

   I*2  TIME_SIZE                                                226#      302     
   I*2  TRANSCNT                                                 293#      381     
   I*2  TRCNGLOS                                                 242#    
   I*2  TURN                                                     153#    
   I*2  USER                                                     124#    

   I*2  WAIT_EF                                                  110#    


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                                   References

        DVI$_ERRCNT                                              320     
        DVI$_FREEBLOCKS                                          319       346     
        DVI$_OPCNT                                               321       357     
        DVI$_REFCNT                                              322       369     
        DVI$_TRANSCNT                                            323       380     

        GETDISK                                                  329     
   I*4  ML$L_POKE                                                344     
   R*4  SYS$GETDVI                                               348       359       371       382     
   R*4  SYS$WAITFR                                               351       362       374       385     

STATDISK                       					 6-Apr-1983 17:45:10	VAX-11 FORTRAN V3.2-37              Page   8
								 6-Apr-1983 17:45:02	CAD$VOLSET:[GARY.STATS.SOURCE]STATDISK.FOR;8

  +----------------------------------------------+
  |           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:STATDISK/LIST=LIS:STATDISK/CONT=99/CROSS/NOOPT SRC:STATDISK

  /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.27 seconds
  Elapsed Time:       34.03 seconds
  Page Faults:        298
  Dynamic Memory:     847 pages
