
                               					20-May-1983 10:18:11	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 10:31:22	CAD$VOLSET:[GARY.STATS.SOURCE]STATSCH.FOR;21

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    !   STATSCH gathers the information on the the scheduler states system
0026    !   wide.
0027    !
0028    ! ENVIRONMENT:
0029    !   VAX11 VMS
0030    !
0031    ! AUTHOR: Gary Smith, CREATION DATE: 6/24/82
0032    !
0033    ! MODIFIED BY:
0034    !
0035    !--
0036    !
0037    ! TABLE OF CONTENTS:
0038    !
0039    !
0040    ! INCLUDE FILES:
0041    !   mousesubs.for
0042    !
0043    ! MACROS:
0044    !   none
0045    !
0046    ! EQUATED SYMBOLS:
0047    !   see mousesubs.for
0048    !
0049    ! EXTERNAL REFERENCES:
0050    !   SYS$GETJPI
0051    !   JPI$_STATE
0052    !   JPI$_PID
0053    !   SS$_NOMOREPROC
0054    !
0055     
0056    !++
0057    ! FUNCTIONAL DESCRIPTION:

                               					20-May-1983 10:18:11	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 10:31:22	CAD$VOLSET:[GARY.STATS.SOURCE]STATSCH.FOR;21

0058    !   Every process in the system is in one of the various scheduler
0059    !   states. By  running thru all the processes in the system, and
0060    !   examining their state of scheduling, we form the output of the 
0061    !   subroutine, sch_state.
0062    !
0063    !
0064    ! FORMAL PARAMETERS:
0065    !   none
0066    !
0067    !
0068    ! IMPLICIT INPUTS:
0069    !   sch_state
0070    !
0071    !
0072    ! IMPLICIT OUTPUTS:
0073    !   sch_state
0074    !
0075    !
0076    ! ROUTINE VALUE and
0077    ! COMPLETION CODES:
0078    !   none
0079    !
0080    !
0081    ! SIDE EFFECTS:
0082    !   none  to date.
0083    !
0084    !
0085    !--
0086              SUBROUTINE STATSCH !! Scheduler states
0087     
0088     
0089              external SYS$GETJPI
0090              external JPI$_STATE
0091              external JPI$_PID
0092              external SS$_NOMOREPROC
0093     
0094              include 'mousesubs.for'
0297              include 'defrec.for'
0399     
0400              integer pid_search, status, SYS$GETJPI
0401              integer prc_state, pid, state_item_list(3), pid_item_list(3)
0402     
0403              pid_search = -1
0404     
0405              do i = 1, sch_size
0406                 rec_sch_state(i) = 0
0407              enddo
0408     
0409    !++
0410    ! set up the control block for retrieving the pid
0411    !--
0412              pid_item_list(1) = 4 + %LOC(JPI$_PID) * (2**16) 
0413              pid_item_list(2) = %LOC(pid)
0414              status = SYS$GETJPI( %VAL(0), pid_search, %VAL(0),
0415         .                         pid_item_list, %VAL(0), %VAL(0),
0416         .                         %VAL(0) )
0417     

STATSCH                        					20-May-1983 10:18:11	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 10:31:22	CAD$VOLSET:[GARY.STATS.SOURCE]STATSCH.FOR;21

0418    !++
0419    ! set up the control block for retrieving the scheduler state
0420    !--
0421     
0422              state_item_list(1) = 4 + %LOC(JPI$_STATE) * (2**16)
0423              state_item_list(2) = %LOC(prc_state)
0424     
0425    !++
0426    ! go thru all the processes there are and record their state
0427    !--
0428     
0429              do while ( status .ne. %LOC(SS$_NOMOREPROC) )
0430                 status = SYS$GETJPI( %VAL(0), pid, %VAL(0),
0431         .                            state_item_list, %VAL(0), %VAL(0),
0432         .                            %VAL(0) )
0433                 rec_sch_state(prc_state) = rec_sch_state(prc_state) + 1
0434                 pid_item_list(1) = 4 + %LOC(JPI$_PID) * (2**16) 
0435                 pid_item_list(2) = %LOC(pid)
0436                 status = SYS$GETJPI( %VAL(0), pid_search, %VAL(0),
0437         .                            pid_item_list, %VAL(0), %VAL(0),
0438         .                            %VAL(0) )
0439                 state_item_list(1) = 4 + %LOC(JPI$_STATE) * (2**16)
0440                 state_item_list(2) = %LOC(prc_state)
0441              end do
0442     
0443              return
0444              end




PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  179   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  2 $LOCAL                                 108   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG
  3 REC_COMMON                             348   PIC OVR REL GBL   SHR NOEXE   RD   WRT LONG

    Total Space Allocated                  635


ENTRY POINTS

    Address  Type  Name                                        References

  0-00000000       STATSCH                                        86     


VARIABLES

    Address  Type  Name                            Attributes  References

  2-00000028  I*4  I                                             405=      406     
  2-00000024  I*4  PID                                           401       413       430A      435     
  2-00000018  I*4  PID_SEARCH                                    400       403=      414A      436A    
  2-00000020  I*4  PRC_STATE                                     401       423       433(2)    440     

STATSCH                        					20-May-1983 10:18:11	VAX-11 FORTRAN V3.2-37              Page   4
								10-May-1983 10:31:22	CAD$VOLSET:[GARY.STATS.SOURCE]STATSCH.FOR;21

  3-00000108  I*4  REC_RESPONSE                    COMM EQUIV    300       357     

  2-0000001C  I*4  STATUS                                        400       414=      429       430=      436=    


ARRAYS

    Address  Type  Name                            Attributes        Bytes  Dimensions       References

  2-0000000C  I*4  PID_ITEM_LIST                                       12  (3)                 401       412=      413=    
											       414A      434=      435=    
											       436A    
  3-00000000  I*4  REC_CPU_MODES                   COMM EQUIV          36  (9)                 302       314     
  3-00000024  I*4  REC_FCP                         COMM EQUIV          20  (5)                 308       321     
  3-00000120  I*4  REC_LOCK_MODES                  COMM EQUIV          28  (7)                 310       376     
  3-00000080  I*4  REC_MEM_MODES                   COMM EQUIV           8  (2)                 303       326     

  3-00000038  I*4  REC_MISC                        COMM EQUIV          72  (18)                305       323     
  3-0000010C  I*4  REC_NET_MODES                   COMM EQUIV          20  (5)                 309       366     
  3-00000088  I*4  REC_PGFLT                       COMM EQUIV          28  (7)                 307       330     
  3-0000013C  I*4  REC_POOL_MODES                  COMM EQUIV          32  (8)                 311       387     
  3-000000A4  I*4  REC_SCH_STATE                   COMM EQUIV          56  (14)                306       335       406=    
											       433(2)= 

  3-000000DC  I*4  REC_SWAP                        COMM EQUIV          36  (9)                 304       341     
  3-00000100  I*4  REC_TIME                        COMM EQUIV           8  (2)                 301       348     
  2-00000000  I*4  STATE_ITEM_LIST                                     12  (3)                 401       422=      423=    
											       430A      439=      440=    
  3-00000000  I*4  STATS_REC                       COMM EQUIV         348  (87)                298       312       314     
											       321       323       326     
											       330       335       341     
											       348       357       366     
											       376       387     


PARAMETER CONSTANTS

  Type  Name                                                   References

   I*2  ARRLOCPK                                                 241#    
   I*2  ARRTRAPK                                                 242#    
   CHAR ASCII_DELTA_TIME                                          99       100#    
   I*2  BIGHOLE                                                  275#    
   I*2  BJOBCNT                                                  131#    

   I*2  BUFIO                                                    152#    
   I*2  CEF                                                      198#    
   I*2  COLPG                                                    196#    
   I*2  COM                                                      207#    
   I*2  COMO                                                     208#    

   I*2  COMPAT                                                   129#    
   I*2  CPU_SIZE                                                 134#      291       302       321       323       326     
							         330       335       341       348       357       366     
							         376       387     
   I*2  CUR                                                      209#    
   I*2  DEPLOCPK                                                 243#    

STATSCH                        					20-May-1983 10:18:11	VAX-11 FORTRAN V3.2-37              Page   5
								10-May-1983 10:31:22	CAD$VOLSET:[GARY.STATS.SOURCE]STATSCH.FOR;21

   I*2  DEQ                                                      257#    

   I*2  DIRHIT                                                   161#    
   I*2  DIRIO                                                    151#    
   I*2  DIRMISS                                                  162#    
   I*2  DLCKFND                                                  258#    
   I*2  DLCKSRCH                                                 259#    

   I*2  DZROFLTS                                                 183#    
   I*2  ENQCVT                                                   260#    
   I*2  ENQNEW                                                   255#    
   I*2  ENQNOTQD                                                 261#    
   I*2  ENQWAIT                                                  256#    

   I*2  EXEC                                                     126#    
   I*2  EXTHIT                                                   163#    
   I*2  EXTMISS                                                  164#    
   I*2  FAULTS                                                   184#    
   I*2  FCP_CACHE                                                141#    

   I*2  FCP_CALLS                                                140#    
   I*2  FCP_CPU                                                  142#    
   I*2  FCP_READ                                                 143#    
   I*2  FCP_SIZE                                                 146#      291       308       323       326       330     
							         335       341       348       357       366       376     
							         387     
   I*2  FCP_WRITE                                                144#    

   I*2  FIDHIT                                                   165#    
   I*2  FIDMISS                                                  166#    
   I*2  FPG                                                      206#    
   I*2  FREECNT                                                  175#    
   I*2  GETDVI_EF                                                114#    

   I*2  HIB                                                      202#    
   I*2  HIBO                                                     203#    
   I*2  HISWPCNT                                                 221#    
   I*2  HIT                                                      158#    
   I*2  HOLECNT                                                  274#    

   I*2  HOLESUM                                                  278#    
   I*2  HOSWPCNT                                                 220#    
   I*2  IDLE                                                     130#    
   I*2  IJOBCNT                                                  132#    
   I*2  INT                                                      128#    

   I*2  IRPCNT                                                   273#    
   I*2  ISPAGCNT                                                 216#    
   I*2  ISWPCNT                                                  217#    
   I*2  KERNEL                                                   124#    
   I*2  KEY_SIZE                                                 120#    

   I*2  LEF                                                      200#    
   I*2  LEFO                                                     201#    
   I*2  LOCK_SIZE                                                266#      291       310       387     
   I*2  LOGNAM                                                   153#    
   I*2  LRPCNT                                                   279#    

STATSCH                        					20-May-1983 10:18:11	VAX-11 FORTRAN V3.2-37              Page   6
								10-May-1983 10:31:22	CAD$VOLSET:[GARY.STATS.SOURCE]STATSCH.FOR;21


   I*2  MBREADS                                                  154#    
   I*2  MBWRITES                                                 155#    
   I*2  MEM_SIZE                                                 178#      291       303       330       335       341     
							         348       357       366       376       387     
   I*2  MFYCNT                                                   176#    
   I*2  MISC_SIZE                                                170#      291       305       326       330       335     
							         341       348       357       366       376       387     

   I*2  MWAIT                                                    197#    
   I*2  NET_SIZE                                                 250#      291       309       376       387     
   I*2  NUM_MODES                                                135#    
   I*2  OPEN                                                     160#    
   I*2  OPENS                                                    159#    

   I*2  OSWPCNT                                                  219#    
   I*2  PFW                                                      199#    
   I*2  PGFLT_SIZE                                               191#      291       307       335       341       348     
							         357       366       376       387     
   I*2  POOL_SIZE                                                286#      291       311     
   I*2  PREADIO                                                  185#    

   I*2  PREADS                                                   187#    
   I*2  PROCCNT                                                  218#    
   I*2  PWRITES                                                  188#    
   I*2  PWRITIO                                                  186#    
   I*2  QUOHIT                                                   167#    

   I*2  QUOMISS                                                  168#    
   I*2  RCVBUFFL                                                 244#    
   I*2  RDFLTS                                                   189#    
   I*2  REC_SIZE                                                 291#      312     
   I*2  RES                                                      236#    

   I*2  RESPONSE_SIZE                                            235#      291       366       376       387     
   I*2  SCH_SIZE                                                 211#      291       306       341       348       357     
							         366       376       387       405     
   I*2  SMALLCNT                                                 277#    
   I*2  SMALLHOLE                                                276#    
   I*2  SPLIT                                                    157#    

   I*2  SRPCNT                                                   280#    
   CHAR STANDARD_NEST_FILE                                       106       107#    
   I*2  SUPER                                                    125#    
   I*2  SUSP                                                     204#    
   I*2  SUSPO                                                    205#    

   I*2  SWAP_SIZE                                                223#      291       304       348       357       366     
							         376       387     
   I*2  SWAP_SPARES                                              224#    
   I*2  TIME_SIZE                                                229#      291       301       357       366       376     
							         387     
   I*2  TRCNGLOS                                                 245#    
   I*2  TURN                                                     156#    

   I*2  USER                                                     127#    
   I*2  WAIT_EF                                                  113#    

STATSCH                        					20-May-1983 10:18:11	VAX-11 FORTRAN V3.2-37              Page   7
								10-May-1983 10:31:22	CAD$VOLSET:[GARY.STATS.SOURCE]STATSCH.FOR;21

FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                                   References

        JPI$_PID                                                  91       412       434     
        JPI$_STATE                                                90       422       439     
        SS$_NOMOREPROC                                            92       429     
   I*4  SYS$GETJPI                                                89       400       414       430       436     


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

  /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:           2.73 seconds
  Elapsed Time:       11.69 seconds
  Page Faults:        473
  Dynamic Memory:     843 pages
