Trailing-Edge
-
PDP-10 Archives
-
tops20_v6_1_tcpip_distribution_tp_ft6
-
6-1-sources/watmai.mac
There are 18 other files named watmai.mac in the archive. Click here to see a list.
; UPD ID= 135, SNARK:<6.1.UTILITIES>WATMAI.MAC.8, 5-Jun-85 15:43:13 by MCCOLLUM
;TCO 6.1.1406 - Update copyright notice.
; UPD ID= 516, SNARK:<6.UTILITIES>WATMAI.MAC.7, 4-Apr-84 11:28:24 by MOSER
;TCO 6.2003 - CHANGES FOR GLOBAL JOB NUMBERS
; UPD ID= 474, SNARK:<6.UTILITIES>WATMAI.MAC.6, 8-Feb-84 10:42:08 by EVANS
;Add flag to edit number so I VER will display it in decimal.
; UPD ID= 167, SNARK:<6.UTILITIES>WATMAI.MAC.5, 5-Nov-82 17:51:46 by MURPHY
;TCO 6.1350 - Merge release 5 edits.
; UPD ID= 146, SNARK:<6.UTILITIES>WATMAI.MAC.4, 29-Sep-82 16:02:36 by LEACHE
;TCO 6.1289 - Add read verifiy counts for the interval
; UPD ID= 36, SNARK:<6.UTILITIES>WATMAI.MAC.3, 27-Apr-82 17:34:46 by MURPHY
;Take XBIO back out - it doesn't exist in monitor.
; UPD ID= 35, SNARK:<6.UTILITIES>WATMAI.MAC.2, 27-Apr-82 17:28:29 by MURPHY
;TCO 6.1106 - Count and report TTY wakeups.
; UPD ID= 39, FARK:<5-1-WORKING-SOURCES.UTILITIES>WATMAI.MAC.4, 14-Sep-82 14:27:20 by DONAHUE
;Edit 11 - Fix dummy disk statistics records at ODAGAN
; UPD ID= 13, FARK:<5-WORKING-SOURCES.UTILITIES>WATMAI.MAC.2, 3-May-82 12:22:54 by MOSER
; EDIT 10 - DO NOT REPORT COLUMN OVERFLOW. CHANGE EDIT # TO DECIMAL.
; UPD ID= 21, SNARK:<5.UTILITIES>WATMAI.MAC.10, 11-Aug-81 12:17:09 by MOSER
;<MOSER.SPR>WATMAI.MAC.7 11-Aug-81 12:16:12, Edit by MOSER
;TCO 5.1450 Make print monitor statistics question correctly accept all legal
; typins after an illegal typein.
;STRAIGHTEN OUT FIELD WIDTHS ON JOB DATA, PREVENT LINE OVERFLOW WITH SNOOP STUFF
; UPD ID= 1232, SNARK:<4.RP20-UTILITIES>WATMAI.MAC.3, 4-Nov-80 16:05:00 by UHLER
;UPDATE EDIT NUMBER FOR RP20 EDIT IN WATCH
;<4.UTILITIES>WATMAI.MAC.15, 3-Jan-80 15:28:03, EDIT BY R.ACE
;UPDATE COPYRIGHT DATE
;<4.UTILITIES>WATMAI.MAC.13, 10-Jul-79 09:49:21, Edit by WALLACE
;ADD MISSING RETURN TO THE DOCAV SUBROUTINE
;<4.UTILITIES>WATMAI.MAC.12, 25-Jun-79 09:10:17, EDIT BY ENGEL
;FIX PAGE WIDTH FOR OUTPUT DEVICE
;<4.UTILITIES>WATMAI.MAC.11, 3-May-79 09:20:56, EDIT BY KIRSCHEN
;LOAD # OF COLUMNS CORRECTLY IN LOAD AVG TYPOUT ROUTINE
;<4.UTILITIES>WATMAI.MAC.10, 2-Apr-79 12:11:44, Edit by MCLEAN
;<4.UTILITIES>WATMAI.MAC.9, 2-Apr-79 12:11:26, Edit by MCLEAN
;<4.UTILITIES>WATMAI.MAC.8, 2-Apr-79 11:27:01, Edit by MCLEAN
;<4.UTILITIES>WATMAI.MAC.7, 28-Mar-79 10:08:49, EDIT BY KIRSCHEN
;ADD DIRECTORY CACHE STATS
;<4.UTILITIES>WATMAI.MAC.6, 21-Mar-79 02:03:20, Edit by MCLEAN
;<4.UTILITIES>WATMAI.MAC.5, 21-Mar-79 02:00:09, Edit by MCLEAN
;MAKE FIT IN 132 COLS
;<4.UTILITIES>WATMAI.MAC.4, 12-Mar-79 14:40:11, Edit by KONEN
;UPDATE COPYRIGHT FOR RELEASE 4
;<4.UTILITIES>WATMAI.MAC.3, 9-Mar-79 00:26:18, Edit by MCLEAN
;ADD CLASS SCHEDULER VALUES
;<4.UTILITIES>WATMAI.MAC.2, 26-Feb-79 21:53:59, Edit by MCLEAN
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
;OR COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1976, 1985.
;ALL RIGHTS RESERVED.
TITLE WATMAI - MAIN PROGRAM FOR "WATCH"
SEARCH MACSYM,MONSYM
COPYRT (1985)
.REQUIRE SYS:MACREL
SALL
EXTERN SINIT,GSNPD,DOSNPH,DOSNPD,SNPSUM,TSTSNP
EXTERN SETHD,ODATM,GETFIL,PRIREC,OFLT,ONUM,NULJFN,RSTJFN,DOCACH
EXTERN OPCT,ORAT,PQFIL,.PQMAX,DCFIL,OUSER,OPGM,DETJOB,CLSOPN,DSKOUT
INTERN INTRVL,TUNEMF,NQUEUE,MAXCLS,STRING,SUMJOB
; VERSION NUMBER DEFINITIONS
VMAJOR==6 ;MAJOR VERSION OF WATCH
VMINOR==0 ;MINOR VERSION NUMBER
VEDIT==VI%DEC+^D601 ;EDIT NUMBER
VWHO==0 ;GROUP WHO LAST EDITED PROGRAM (0=DEC DEVELOPMENT)
VWATCH== <VWHO>B2+<VMAJOR>B11+<VMINOR>B17+VEDIT
;ACCUMULATORS
F=:0 ;FLAGS
A==1
T1=:A
B==2
T2=:B
C==3
T3=:C
D==4
T4=:4
E==5
FF==6 ; DITTO
G==7 ; DITTO
P1=:10
P2=:11
P3=:12
P=:17
NMIN==^D<15*60> ; NO. OF SECONDS IF UNDER JOB 0
FLDSIZ==12
JBMAX==^D1000 ;SIZE OF JOB TABLES
;FLAGS IN F
JOBSMF==1B0 ;PRINT JOB SUMMARY
STATF==1B1 ;PRINT MONITOR STATISTICS SUMMARY
NOTIMF==1B2 ;NO TIME PERIOD GIVEN
TUNEMF==:1B3 ;TUNE MODE
ALLF==1B4 ;ALL MODE (INCLUDING SNOOP DATA)
ODATFL==1B5 ;OUTPUT DATA RECORDS TO FILE
MAXCLS=40 ;MAXIMUM CLASS
;PROGRAM ENTRY VECTOR
ENTVEC: JRST WATCH ;STARTING LOCATION
JRST WATCH ;REENTER LOCATION
VWATCH ;VERSION NUMBER
WATCH:: RESET
MOVE P,[IOWD PDLEN,PDL]
SETZ F,
MOVE A,[SIXBIT/JOBRT/]
SYSGT
HLRE A,B
MOVNM A,NJOBS
CAMGE A,[-JBMAX] ; ENUFF ROOM?
JRST [HRROI A,[ASCIZ/
? NOT ENOUGH ROOM IN JOB TABLES!
/]
PSOUT
HALTF]
GJINF
JUMPE C,[MOVSI A,1
HRROI B,[ASCIZ/<SYSTEM>WATCH.LOG/]
GTJFN
JRST [ MOVSI A,400001
HRROI B,[ASCIZ/PS:<SYSTEM>WATCH.LOG/]
GTJFN
JRST [HRROI A,[ASCIZ/
? WATCH NOT BEING PERFORMED!
/]
PSOUT
HALTF
JRST WATCH]
JRST .+1]
MOVEM A,OJFN
MOVE B,[70000,,120000]
OPENF
JRST [HRROI A,[ASCIZ/
? WATCH NOT BEING PERFORMED!
/]
PSOUT
HALTF
JRST WATCH]
TXO F,JOBSMF+STATF ;DO ALL OUTPUT
MOVE B,[NMIN] ;USE DEFAULT TIME PERIOD
JRST GOTTIM]
TMSG <
WATCH >
MOVEI A,.PRIOU
MOVE B,[VWATCH] ;PRINT WATCH VERSION
CALL PVERID
TMSG <, /H for help.
>
GOJFN: TMSG <Output to file: >
PBIN ;CHECK FIRST CHAR
CAIN A,"?"
JRST [ TMSG < Output filespec for WATCH output.
>
JRST GOJFN]
CAIN A,"/" ;SWITCH?
JRST [ CALL RDLINE ;YES, GET NAME
LDB A,[POINT 7,STRING,6] ;GET FIRST CHAR OF SWITCH
CAIN A,"H" ;HELP?
JRST DOHLP ;YES, TYPE LONG MESSAGE
TMSG <?Invalid switch.
>
JRST GOJFN]
MOVEI A,.PRIIN
BKJFN ;PUT IT BACK
JFCL
MOVX A,GJ%MSG+GJ%CFM+GJ%FNS+GJ%SHT
MOVE B,[100,,101]
GTJFN
JRST [ CALL ERMSG
JRST WATCH]
MOVEM A,OJFN
MOVE B,[70000,,120000]
OPENF
JRST [ CALL ERMSG
MOVE A,OJFN
RLJFN
JFCL
JRST WATCH]
CALL GETFIL ;GET DATA FILE IF WANTED
MOVE A,OJFN
RFMOD ;GET PAGE WIDTH
LOAD B,TT%WID,B
MOVEI C,4 ;USE 4 COLUMNS FOR SYSTEM DATA
; CAIGE B,^D112 ;UNLESS PAGE 112 WIDE OR MORE
; MOVEI C,^D8 ;THEN USE 8
MOVEM C,NCOL
ASK: TMSG <Print monitor statistics? >
CALL RDLINE ;GET ANSWER
LDB B,[POINT 7,STRING,6]
CAIN B,"?"
JRST [ HRROI A,QHLPTX ;HELP MSG
PSOUT
JRST ASK] ;TRY AGN
CAIN B,"A"
JRST [ TXO F,STATF+JOBSMF+ALLF ;EVERYTHING
JRST TIMLOP]
CAIN B,"Y" ;DID HE TYPE "Y"
JRST [TXO F,STATF ;YES, FLAG PRINTING MONITOR STATS
JRST ASK1] ;AND ASK NEXT QUESTION
CAIE B,"N" ;DID HE TYPE "N"?
JRST ASK ;HE TYPED GARBAGE SO ASK AGAIN
ASK1: TMSG <Print job summary ? > ;ASK ABOUT JOB SUMMARY
CALL YESNO ;GET ANSWER
SKIPE A
TXO F,JOBSMF ;YES
TXNE F,STATF+JOBSMF ;NOTA?
JRST TIMLOP
TMSG <Tune mode? > ;yes, try another possibility
CALL YESNO
SKIPE A
TXO F,TUNEMF+STATF+JOBSMF+ALLF
; ..
TIMLOP: HRROI A,[ASCIZ/
Time period (MM:SS): /]
PSOUT
CALL RDLINE ;READ TO CR
LDB A,[POINT 7,STRING,6] ;GET FIRST CHAR
CAIN A,"?" ;HELP REQUEST?
JRST [ HRROI A,[ASCIZ /
For fixed period reporting, enter the period as MM:SS. Type CR
for variable period reporting. This means that a report will
be done only when requested by typing CR.
/]
PSOUT ;TYPE HELP
JRST TIMLOP] ;TRY AGAIN
CAIN A,.CHLFD ;ONLY CR TYPED?
JRST [ TXO F,NOTIMF ;YES, FLAG
HRROI A,[ASCIZ /
Type CR to get report.
/]
PSOUT
SETZ B, ;TIME IS 0
JRST GOTTIM]
CAIN A,":" ;STARTS WITH COLON?
JRST [ SETZM WAITIM ;YES, ASSUME SECONDS FOLLOW
MOVE A,[POINT 7,STRING,6]
JRST TIMLO1]
HRROI A,STRING
FLIN ;SEE IF INPUT CAN BE RECOGNIZED AS
JRST BADTIM ; FLOATING PT - JUMP IF NOT
LDB C,A ;OK, BUT MUST HAVE READ ENTIRE FIELD
CAIE C," "
CAIN C,.CHLFD
JRST [ FMPRI B,(60.0) ;OK, CONVERT TO SECONDS
FIXR B,B ;FIX
JRST GOTTIM]
CAIN C,":" ;COLON TERMINATOR?
JRST TIMLO2 ;YES, SECONDS GIVEN
BADTIM: TMSG <?Invalid time period specification.
>
JRST TIMLOP ;TRY AGAIN
TIMLO2: FIXR B,B ;FIX MINUTES
IMULI B,^D60 ;CONVERT TO SECONDS
MOVEM B,WAITIM
TIMLO1: MOVEI C,^D10
NIN ;YES, GET NUMBER
CALL LJSHLT
ADD B,WAITIM ;ADD TO MINUTES
; ..
;HERE WITH: B/ TIME PERIOD IN SECONDS
; ..
GOTTIM: IMULI B,^D1000 ;CONVERT TO MILLISECONDS
MOVEM B,WAITIM
TXNE F,ALLF
CALL SINIT ;INIT SNOOP STUFF
TMSG <
WATCH IN OPERATION -- >
MOVEI A,377777
EXCH A,OJFN
PUSH P,A
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL NULJFN ;SET OUTPUT DATA FILE TO NULL I/O
TIME
MOVEM A,STIME
SETZM INTRVL
CALL SETUP
JRST INTERR
CALL GETQS ;INIT QUEUE TIMES
CALL GSTATS ;INIT STATISTICS TABLES
TXNE F,ALLF
CALL GSNPD ;GET INITIAL SNOOP DATA
CALL HEADER
CALL STATS
CALL PQSUM
CALL DOAVS
CALL TYPE
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL RSTJFN ;RESTORE OUTPUT FILE DATA JFN
POP P,OJFN
JRST LPWAIT
QHLPTX: ASCIZ /
One of the following:
Y (yes) - include monitor statistics in report
N (no) - do not include monitor statistics in report
A (all) - include monitor statistics, job data, and snoop data in report
If you do not select A mode, the next question will allow you to
include or exclude the per-job data from the report.
If you answer N to both questions, you may select "tune" mode
which gives a single-line system summary each period.
"A" and "tune" modes require wheel capability enabled.
/
;MAIN LOOP
LOOP: TIME
SUBM A,STIME ;COMPUTE ACTUAL INTERVAL
EXCH A,STIME ;SAVE CURRENT TIME
MOVEM A,INTRVL
CALL ODATM ;SAVE CURRENT DATE AND TIME STRING
CALL GSTATS ;GET STATISTICS
TXNE F,ALLF
CALL GSNPD ;GET SNOOP DATA
CALL SETUP
JRST INTERR
TXNN F,TUNEMF
CALL GETQS ;GET QUEUE TIMES
TXNE F,TUNEMF ;TUNE MODE?
JRST [ SOSGE LINCNT ;YES, TIME FOR NEW HEADER?
CALL TUNHED ;YES
JRST .+1]
TXNN F,TUNEMF
CALL HEADER
JXE F,STATF,SKSTAT ;JUMP IF NOT PRINTING STATISTICS
CALL STATS
TXNN F,TUNEMF
CALL PQSUM ;PRINT QUEUE TIME SUMMARY
SKSTAT: TXNN F,TUNEMF
CALL DOAVS
MOVE T1,OJFN ;GET OUTPUT JFN
TXNE F,ALLF
JRST [ TXNN F,TUNEMF ;DO NOT DO CACHE STATS IF TUNE MODE
CALL DOCACH ;PRINT DIRECTORY CACHE STATS
JRST .+1 ]
TXNE F,JOBSMF ;SKIP IF JOB SUMMARY NOT WANTED
CALL TYPE
TXNN F,TUNEMF
TXNN F,ALLF
SKIPA
CALL DSKOUT ;DO DISK STATISTICS
;GJINF
;JUMPGE D,LPWAIT ;DON'T DO CLOSF/OPENF IF ATTACHED
JXE F,TUNEMF,SKPTN2 ;JUMP IF NOT DOING TUNE MODE
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL PRIREC ;OUTPUT THE DATA RECORD
SKPTN2: TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL CLSOPN ;CLOSE AND OPEN DATA FILE
MOVE A,OJFN
HRLI A,(1B0)
CLOSF
JFCL
HRRZ A,OJFN
MOVE B,[70000,,120000]
OPENF
JRST [MOVE B,A
HRROI A,[ASCIZ/
? CANNOT REOPEN OUTPUT FILE!
? /]
PSOUT
MOVEI A,101
SETZ C,
HRLI B,400000
ERSTR
JFCL
JFCL
HALTF
JRST WATCH]
LPWAIT: JXO F,NOTIMF,[PBIN ;INDEF PERIOD, GET TYPEIN
CAIE A,.CHLFD ;CR TYPED?
JRST LPWAIT ;NO, KEEP WAITING
JRST LOOP] ;YES, DO REPORT
TIME
SUB A,STIME
MOVNS A
ADD A,WAITIM
SKIPL A
DISMS
JRST LOOP
;TYPE JOB SUMMARY
TYPE: PUSH P,P1
PUSH P,P2
TXNE F,TUNEMFF
JRST TYPTM1
CALL CALPER ;CALCULATE PERCENTAGES
;CALL SORT ;SORT JOBS BY USED TIME
CALL CRLF
CALL IFLDW ;INIT FIELD WIDTHS FOR LINE
HRROI A,[ASCIZ/JOB/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
HRROI A,[ASCIZ/TTY/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
HRROI A,[ASCIZ/USER/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
HRROI A,[ASCIZ/PROGRAM/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
TXNE F,ALLF
JRST TYPA1 ;SKIP THIS FIELD IF SNOOP DATA
HRROI A,[ASCIZ/DELTA RT/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
TYPA1: HRROI A,[ASCIZ/ %RT/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
TXNE F,ALLF
JRST TYPA2
HRROI A,[ASCIZ/ JBUTIL/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
HRROI A,[ASCIZ/ CSHR/]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSTR
TYPA2: TXNE F,ALLF
CALL DOSNPH ;DO SNOOP HEADER
CALL CRLF
CALL CRLF
; ..
; ..
TYPTM1: MOVN P1,NJOBS
HRLZS P1
TYPLOP: CALL IFLDW ;INIT FIELD WIDTHS FOR LINE
MOVE P2,JOBNUM(P1)
SKIPN USER(P2)
JRST TYPNXT
SKIPG DRUNTM(P2)
JRST [ HRRZ T1,P2 ;NO RUN TIME HERE, SEE IF ANY SNOOP EVENTS
CALL TSTSNP
JUMPE T1,TYPNXT ;JUMP IF NONE
JRST .+1]
TXNE F,TUNEMF
JRST [ MOVE A,OJFN
HRRZ B,P2
CALL DOSNPD
JRST TYPNXT]
TXNE F,ALLF ;IF OUTPUT MODE IS ALL, THE EXPANDED JOB RECORD
MOVEI A,3 ; TYPE IS OUTPUT
TXNN F,ALLF ;IF OUTPUT MODE IS NOT ALL, THE NORMAL JOB
MOVEI A,4 ; RECORD TYPE IS OUTPU
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL SETHD ;SET OUTPUT RECORD HEADER
MOVE A,P2
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPDEC ;JOB NUMBER
SKIPGE A,TTYNUM(P2)
JRST [MOVE A,[ASCII/DET/]
MOVEM A,STRING
CALL GNFLDW
CALL TYPFLD
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL DETJOB ;OUTPUT DETACHED JOB NUMBER
JRST TYPE2]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPOCT ;TTY NUMBER
TYPE2: MOVE A,USER(P2)
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPUSR
MOVE A,PRGNAM(P2)
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPSIX
TXNE F,ALLF
JRST TYPB1
FLTR A,DRUNTM(P2)
FDVR A,[1000.0]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPFLT
TYPB1: MOVE A,PERCNT(P1)
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPPER
TXNE F,ALLF
JRST TYPB2
MOVEI T1,.SKRJP
MOVEI T2,SKJBP ;BLOCK ADDRESS
MOVEM P2,1(T2) ;STORE JOB NUMBER
SETZM SKJBP+.SAJSH ;ZERO SHARES AND FRIENDS
SETZM SKJBP+.SAJUS
SKED% ;SKED
ERJMP .+1 ;LOGGED OUT IS POSSIBLE HERE SO SHARE IS 0
MOVE A,SKJBP+.SAJUS
FMPR A,[100.]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPFLT
MOVE A,SKJBP+.SAJSH
FMPR A,[100.]
CALL GNFLDW ;GET NEXT FIELD WIDTH INTO B
CALL TYPFLT
TYPB2: MOVE A,OJFN
HRRZ T2,P2
TXNE F,ALLF
CALL DOSNPD ;DO SNOOP DATA FOR THIS JOB
CALL CRLF
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL PRIREC ;OUTPUT THE DATA RECORD
TYPNXT: AOBJN P1,TYPLOP
TXNN F,ALLF
JRST TYPC1
TXNE F,TUNEMF
JRST TYPTM3
CALL CRLF
HRROI A,[ASCIZ / System summary/]
MOVE B,SUMFLW
CALL TYPSTR
TYPTM3: MOVE A,OJFN
CALL SNPSUM ;DO SNOOP DATA SUMMARY
CALL CRLF
TYPC1: POP P,P2
POP P,P1
RET
;INIT LIST OF FIELD WIDTHS
IFLDW: MOVEI T1,PJFLDT ;REGULAR TABLE
TXNE F,ALLF ;SNOOP DATA?
MOVEI T1,PJFLDS ;YES, ALTERNATE TABLE
MOVEM T1,PJFLDW
RET
;GET NEXT FIELD WIDTH IN B
GNFLDW: MOVE B,@PJFLDW
AOS PJFLDW
RET
;TABLE OF FIELD WIDTHS, REGULAR
; JOB, TTY, USER, PGM, DELTA RT, %RT, JBUTIL, CSHR
PJFLDT: DEC 4,4,12,8,9,4,7,7
;TABLE OF FIELD WIDTHS, SNOOP DATA
; JOB, TTY, USER, PGM, %RT
PJFLDS: DEC 4,4,10,8,4
SUMFLW: ^D30 ;SUM OF ABOVE FIELDS
;TYPE STRING LEFT JUSTIFIED IN FIELD
; A/ STRING PTR
; B/ FIELD WIDTH
TYPSTR: PUSH P,B
MOVE B,A
HRROI A,STRING
SETZ C,
SOUT
POP P,A
JRST TYPFLD
TYPRT: PUSH P,B
ADDI A,^D50 ;ROUND TO 0.1 SECONDS
IDIVI A,^D100 ;GET 0.1 SECOND UNITS
IDIVI A,^D10 ;GET SECONDS, TENTHS
PUSH P,B ;SAVE TENTHS
IDIVI A,^D60 ; B = SECONDS, A = MINUTES
PUSH P,B
IDIVI A,^D60 ; B = MINUTES, A = HOURS
PUSH P,B
MOVE B,A
HRROI A,STRING ;WRITE TIME TO BUFFER STRING
MOVX C,<NO%LFL+NO%AST+FLD(3,NO%COL)+^D10>
JUMPE B,TYPRT1 ;SUPPRESS LEADING 0 HOURS
NOUT
JFCL
MOVEI B,":"
BOUT
MOVX C,<NO%LFL+NO%ZRO+FLD(2,NO%COL)+^D10>
TYPRT1: POP P,B ;RECOVER MINUTES
NOUT ;PRINT MINUES
JFCL
MOVEI B,":"
BOUT
POP P,B ;RECOVER SECONDS
MOVX C,<NO%LFL+NO%ZRO+FLD(2,NO%COL)+^D10>
NOUT ;PRINT SECONDS
JFCL
MOVEI B,"."
BOUT
POP P,B ;RECOVER TENTHS
MOVEI C,^D10
NOUT
NOP
POP P,A
JRST TYPFLD
TYPDEC: SKIPA C,[12]
TYPOCT: MOVEI C,10
PUSH P,B
SUBI B,1 ;SAVE 1 FOR FOLLOWING SPACE
STOR B,NO%COL,C ;SETUP NUMBER COLUMNS
TXO C,NO%LFL+NO%AST
MOVE B,A
HRROI A,STRING
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL ONUM ;OUTPUT NUMBER
NOUT
SETZM STRING
POP P,A
JRST TYPFLD
TYPPER: PUSH P,B
MOVE B,A
HRROI A,STRING
MOVE C,[1B4!1B6!37B17!2B23!1B29]
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL OFLT ;OUTPUT THE FLOATING POINT NUMBER
FLOUT
JRST TYPZER
MOVEI B,0
IDPB B,A
POP P,A
JRST TYPFLD
TYPUSR: PUSH P,B
MOVE B,A
HRROI A,STRING
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL OUSER ;OUTPUT USER NAME TO DATA FILE
DIRST
TYPZER: SETZM STRING
POP P,A
JRST TYPFLD
TYPSIX: PUSH P,B
CALL SIXTO7
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL OPGM ;OUTPUT PROGRAM NAME TO DATA FILE
POP P,A
JRST TYPFLD
SIXTO7: MOVE B,[POINT 7,STRING]
MOVE C,[POINT 6,A]
MOVEI D,6
ILDB E,C
ADDI E,40
IDPB E,B
SOJG D,.-3
MOVEI E,0
IDPB E,B
RET
TYPFLD: CAIG A,0 ;DEFAULT WIDTH?
MOVSI A,2 ;YES
MOVE D,[POINT 7,STRING]
MOVE E,A
MOVE A,OJFN
TYPFL1: ILDB B,D
JUMPE B,TYPFL2
BOUT
SOJG E,TYPFL1
TYPFL2: SOJL E,R
CALL SPACE
CAIL E,777777 ;DEFAULT?
RET ;YES, STOP AFTER ONE SPACE
JRST TYPFL2
; CRLF -- TURNS A NEW LINE
;
CRLF:: HRROI B,[ASCIZ/
/]
MOVE A,OJFN
SETZ C,
SOUT
RET
; JSYS ERROR ROUTINE
ERMSG: TMSG <
? >
JRST ERMSG0
LJSERR: TMSG <
?JSYS ERROR: >
ERMSG0: MOVEI A,101 ; SET UP OUTJFN
HRLOI B,.FHSLF
SETZ C, ;
ERSTR ; PRINT ERROR MESSAGE
JFCL ;
JFCL ; IGNORE ALL SCREWUP CONDITIONS
HRROI A,[ASCIZ/
/]
PSOUT ;
RET ;
LJSHLT: CALL LJSERR ;DO MESSAGE
HALTF ;QUIT
RET ;BUT IF CONTINUED...
INTERR: TMSG <
? WATCH: FATAL INTERNAL ERROR!
>
HALTF
JRST WATCH
;READ YES/NO ANSWER
YESNO: CALL RDLINE ;READ TYPEIN TO NEXT CR
YESNOX: LDB B,[POINT 7,STRING,6] ;GET FIRST CHAR OF ANSWER
CAIN B,"?" ;HELP?
JRST [ HRROI A,[ASCIZ /
"YES" OR "NO": /]
PSOUT
JRST YESNO] ;TRY AGAIN
CAIE B,"Y"
CAIN B,"Y"+40
JRST [ SETO A, ;YES, RETURN NON-0
RET]
CAIE B,"N"
CAIN B,"N"+40
JRST [ SETZ A, ;NO, RETURN 0
RET]
HRROI A,[ASCIZ /? YES OR NO REQUIRED: /]
PSOUT
JRST YESNO
;READ ONE LINE FROM PRIMARY
RDLINE: PBIN ;READ FIRST CHAR
CAIN A,"?" ;HELP REQUEST?
JRST [ SETZM STRING ;YES, RETURN IMMEDIATELY
DPB A,[POINT 7,STRING,6]
RET]
MOVEI A,.PRIIN
BKJFN ;NO, PUT IT BACK
CALL LJSERR
MOVE A,[.PRIIN,,.PRIOU]
HRROI B,STRING
MOVX C,<RD%BEL+RD%JFN+RD%RAI+RD%CRF+STRNGL*5-1>
RDTXT
CALL LJSHLT
RET
;PRINT VERSION IDENTIFICATION
; A/ OUTPUT DESIGNATOR
; B/ VERSION ID WORD
PVERID: SAVEAC <P1>
MOVEM T2,P1 ;SAVE WORD
MOVEI T3,^D8 ;ALL NUMBERS ARE OCTAL
LOAD T2,VI%MAJ,P1 ;MAJOR VERSION
NOUT
JFCL
LOAD T2,VI%MIN,P1 ;MINOR
JUMPE T2,PVER1 ;PRINT NOTHING IF 0
ADDI T2,"A"-1 ;CONVERT TO ALPHABETIC
BOUT
PVER1: MOVEI T2,"("
BOUT ;PUNCTUATE EDIT NUMBER
LOAD T2,VI%EDN,P1
NOUT
JFCL
MOVEI T2,")"
BOUT
LOAD T2,VI%WHO,P1 ;GET CUSTOMER CODE
JUMPE T2,PVER2 ;JUMP IF NONE
MOVEI T2,"-" ;PUNCTUATE IT
BOUT
LOAD T2,VI%WHO,P1
NOUT
JFCL
PVER2: RET
;
; HEADER CODE BEGINS HERE
;
HEADER: MOVE A,OJFN
HRROI T2,[BYTE (7) .CHFFD]
TXC F,STATF+JOBSMF ;BOTH FUNCTIONS ON?
TXCE F,STATF+JOBSMF
HRROI T2,[ASCIZ /
/]
SETZ C,
SOUT
FMSG <
SUMMARY at >
MOVNI B,1
SETZ C,
ODTIM
HRROI B,[ASCIZ/
for an interval of /]
SETZ C,
SOUT
MOVE A,INTRVL
MOVEI B,0
CALL TYPRT
MOVE A,OJFN
HRROI B,[ASCIZ/ with /]
SETZ C,
SOUT
CALL SUMJOB
MOVEI B,4
CALL TYPDEC
MOVE A,OJFN
HRROI B,[ASCIZ/ active jobs.
/]
SETZ C,
SOUT
RET
DOAVS: MOVEI A,2 ;SET ENTRY RECORD TYPE
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL SETHD ;SET THE RECORD HEADER
MOVE A,OJFN
HRROI B,[ASCIZ /
LOAD AVERAGES: /]
SETZ C,
SOUT
MOVE A,[SIXBIT/SYSTAT/]
SYSGT
PUSH P,B
MOVE A,0(P)
HRLI A,14
GETAB
JFCL
MOVEI B,10
CALL TYPFLT
MOVE A,0(P)
HRLI A,15
GETAB
JFCL
MOVEI B,10
CALL TYPFLT
POP P,A
HRLI A,16
GETAB
JFCL
MOVEI B,10
CALL TYPFLT
CALL CRLF
HRROI A,[ASCIZ /HIGH QUEUE AVERAGES: /]
MOVEI B,.HQLAV
CALL DOLAV
HRROI A,[ASCIZ /LOW QUEUE AVERAGES: /]
MOVEI B,.LQLAV
CALL DOLAV
CALL DOCAV ;DO CLASS AVERAGES
RET
DOCAV: CALL CRLF
HRROI A,[ASCIZ /CLASS SHARE UTILIZ CLASS LOAD AVERAGES/]
MOVEI B,56
CALL TYPSTR
CALL CRLF
CALL CRLF
PUSH P,P1
SETZ P1,0
SETZ P2, ;INITIALIZE COUNTER FOR NUMBER OF ITEMS OUTPUT
CLAVL: MOVEI A,.SKRCS
MOVEI B,SKLDA
CAIN P1,MAXCLS
JRST CLAVXT
MOVEM P1,SKLDA+.SACLS ;SET CLASS
SKED%
ERJMP NXTCLS
SKIPN SKLDA+.SASHR
JRST NXTCLS
AOJ P2, ;INCREMENT ITEM COUNTER
MOVE A,P1
MOVEI B,6
CALL TYPDEC
MOVE A,SKLDA+.SASHR
FMPR A,[100.]
MOVEI B,10
CALL TYPFLT
MOVE A,SKLDA+.SAUSE
FMPR A,[100.]
MOVEI B,10
CALL TYPFLT
MOVE A,SKLDA+.SA1ML
MOVEI B,10
CALL TYPFLT
MOVE A,SKLDA+.SA5ML
MOVEI B,10
CALL TYPFLT
MOVE A,SKLDA+.SA15L
MOVEI B,10
CALL TYPFLT
CALL CRLF
NXTCLS: AOS P1
JRST CLAVL
CLAVXT: POP P,P1
TXNN F,ODATFL ;TEST IF USING DATA FILE
RET ;RETURN
CALL DCFIL ;OUTPUT FILLER DATA ENTRIES AND NUMBER OF
; ENTRIES OUTPUT
CALL PRIREC ;OUTPUT THE ENTIRE RECORD
RET
;TYPE LOAD AVERAGES
; A/ MESSAGE
; B/ TABLE TO BE USED
DOLAV: SAVEAC <P1>
ASUBR <MSG,TABLE>
HRRO A,TABLE ;REQUEST SIZE OF TABLE
GETAB
RET ;NONE SUCH, DO NOTHING
HRLZ P1,A ;SETUP AOBJN PTR
MOVE A,OJFN
SETZ C,
HRRO B,MSG
SOUT ;TYPE MESSAGE
DOLAV1: MOVE A,TABLE
HRL A,P1 ;SETUP INDEX,,TABLE
GETAB ;GET ENTRY
CALL LJSHLT ;IMPOSSIBLE
MOVEI B,10 ;FIELD SIZE
CALL TYPFLT ;TYPE IT
AOBJN P1,DOLAV1 ;DO ALL
CALL CRLF ;END OF LINE
RET
TYPFLT: PUSH P,B
MOVE B,A
HRROI A,STRING
MOVE C,[1B1!1B4!1B6!37B17!4B23!2B29] ;4 COLUMNS
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL OFLT ;OUTPUT THE NUMBER TO THE DATA FILE
FLOUT
JRST TYPZER
POP P,A
JRST TYPFLD
SETUP: PUSH P,P1
MOVN P1,NJOBS
HRLZS P1
SETLOP: HRRZ A,P1
MOVE B,[-10,,JIBLK]
MOVEI C,0
GETJI
JRST SETZER ;
SKIPN A,JIBLK+.JIUNO
JRST SETZER
MOVEM A,USER(P1)
MOVE A,JIBLK+.JIJNO
MOVEM A,JOBNUM(P1)
MOVE A,JIBLK+.JITNO
MOVEM A,TTYNUM(P1)
MOVE A,JIBLK+.JIPNM
MOVEM A,PRGNAM(P1)
MOVE A,JIBLK+.JIRT
SUB A,RUNTIM(P1)
SKIPGE A
SETZ A,
MOVEM A,DRUNTM(P1)
MOVE A,JIBLK+.JIRT
MOVEM A,RUNTIM(P1)
SETNXT: AOBJN P1,SETLOP
POP P,P1
CPOPJ1: AOS (P)
CPOPJ: RET
SETZER: SETZM PERCNT(P1)
SETZM USER(P1)
SETZM RUNTIM(P1)
SETZM DRUNTM(P1)
SETOM JOBNUM(P1)
SETOM TTYNUM(P1)
JRST SETNXT
SUMJOB: MOVN B,NJOBS
HRLZS B
SETZ A,
SUMJLP: SKIPE USER(B)
AOS A
AOBJN B,SUMJLP
RET
;CALCULATE PERCENTAGE RUNTIME FOR EACH JOB
CALPER: PUSH P,P1
FLTR A,INTRVL
PUSH P,A
MOVN P1,NJOBS
HRLZS P1
CALLOP: FLTR A,DRUNTM(P1)
FDVR A,0(P)
FMPR A,[100.0]
MOVEM A,PERCNT(P1)
AOBJN P1,CALLOP
POP P,(P)
POP P,P1
RET
;SORT JOBS IN ORDER OF DESCENDING RUN TIME
SORT: PUSH P,P1
SORT1: MOVN P1,NJOBS
HRLZS P1
SETZ D,
SORTLP: MOVE A,PERCNT(P1)
CAML A,PERCNT+1(P1)
JRST SORNXT
EXCH A,PERCNT+1(P1)
MOVEM A,PERCNT(P1)
MOVE A,JOBNUM(P1)
EXCH A,JOBNUM+1(P1)
MOVEM A,JOBNUM(P1)
SETO D,
SORNXT: AOBJN P1,SORTLP
JUMPN D,SORT1
POP P,P1
RET
;
; HERE BEGINS CODE FOR STAT GATHERING
; --- AA. MACK
;
GSTATS: TIME ; GET CURRENT TIME
MOVEM A,TNEW ; SAVE IT
MOVE A,[SIXBIT /SYSTAT/] ; GET SYSTEM TABLE
SYSGT ;
JUMPE B,[HRROI A,[ASCIZ/SYSTAT TABLE NOT FOUND
/]
PSOUT
HALTF]
HRRZM B,SYSTAT ; SAVE TABLE NUMBER
HLRE A,B ; NEGATIVE OF LENGTH
MOVM A,A ;POSITIVE LENGTH
CAIG A,NSTATW ;TOO LARGE FOR STORAGE?
IFSKP.
TMSG <%This version of WATCH cannot handle all monitor statistics.
>
MOVEI A,NSTATW ;USE MAX
ENDIF.
MOVEM A,NSYST
MOVN A,A
HRLM A,NSYST ;NSYST/ -LENGTH,,+LENGTH
MOVE A,[SIXBIT/JOBRT/] ; GET JOBRT TABLE
SYSGT ;
JUMPE B,[HRROI A,[ASCIZ/JOBRT TABLE NOT FOUND
/]
PSOUT
HALTF]
HRRZM B,JOBRT ;
HLRE A,B ;
MOVMM A,NNJOBS ; SAME AS FOR SYSTAT
HLLM B,NNJOBS ;
;The following table, XBIO, does not exist in the monitor and never has.
MOVE A,[SIXBIT /XBIO/] ;TRY TO GET XB IO TABLE
SYSGT ; ...
HRRZM B,XBIO ;SAVE
HLLZ E,NNJOBS ;
GTA1: HRRZ A,JOBRT ; JOB RUNTIME TABLE
HRLI A,0(E) ;
GETAB ;
JRST [ CALL LJSERR
SETZ A, ; USE 0 IF FAILURE
JRST .+1]
MOVEM A,JNEW(E) ;
AOBJN E,GTA1 ; LOOP TO GET ALL
HLLZ E,NSYST ; SYSTAT TABLE
GTA2: HRRZ A,SYSTAT ;
HRLI A,0(E) ;
GETAB ;
JRST [ CALL LJSERR
SETZ A,
JRST .+1]
MOVEM A,VNEW(E) ;
AOBJN E,GTA2 ; LOOP TO GET ALL
SKIPG A,XBIO ;GET XBIO INDEX
JRST GTA3 ;NONEX
HRLI A,0 ;FIRST GET READS
GETAB
JRST GTA3
MOVEM A,XBRNEW ;SAVE
MOVE A,XBIO ;GET WRITES
HRLI A,1 ; ...
GETAB
JRST GTA3
MOVEM A,XBWNEW ;SAVE WRITES
GTA3: RET ;
;PRINT STATISTICS
STATS: MOVEI A,1 ;RECORD ENTRY TYPE FOR SYSTEM STATS RECORD
TXNE F,TUNEMF ;IF NOT IN TUNE MODE THEN DO NOT CHANGE ENTRY
; RECORD TYPE
MOVEI A,6 ;RECORD ENTRY TYPE FOR TUNE MODE RECORD
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL SETHD ;SET THE HEADER OF THE OUTPUT RECORD
MOVE A,TNEW ;COMPUTE SAMPLE INTERVAL
SUBM A,TOLD ;
TXNE F,TUNEMF
JRST GO5
MOVSI G,-NVALS ; SET UP TO DO ALL VALUES
SETZ FF, ;INIT ITEMS PER LINE
GO1: MOVE A,OJFN
SOJLE FF,[CALL CRLF ;DO NEW LINE IF ITEM COUNT DONE
MOVE FF,NCOL
JRST GO2]
CALL SPACE ;ELSE SPACE TO NEXT ITEM
CALL SPACE
CALL SPACE
GO2: HLRZ A,VNAMES(G) ; POINTER TO CALL WORD
MOVE E,0(A) ; CALL WORD, IE. INDEX,,ROUTINE
HLRZ A,E ; A/0,,INDEX
CALL 0(E) ; PERFORM SPECIFIED FUNCTION
AOBJN G,GO1 ; LOOP TO DO WHOLE TABLE
CALL CRLF ; NEW LINE
GO3: MOVE A,[XWD VNEW,VOLD] ; MAKE CURRENT SET BE OLD SET
BLT A,TOLD ; FOR NEXT TIME THRU LOOP
; BACK TO "HEADER" CODE
RET
TUNHED: MOVSI G,-NSVALT
MOVE A,OJFN
MOVEI B,.CHFFD
BOUT
CALL CRLF
TUNHE1: FMSG < >
HRRO B,SVNAMT(G)
SETZ C,
SOUT
AOBJN G,TUNHE1
CALL DOSNPH
CALL CRLF
MOVEI B,^D50
MOVEM B,LINCNT
RET
GO5: MOVSI G,-NSVALT
GO4: MOVE A,OJFN
FMSG < >
HLRZ A,SVNAMT(G)
MOVE E,0(A)
HLRZ A,E
CALL 0(E)
AOBJN G,GO4
JRST GO3
; DOPCT -- ITEM AS PERCENTAGE OF REALTIME INTERVAL
DOPCTH: MOVE B,VNEW(A) ;HERE FOR HP UNITS
SUBB B,VOLD(A)
IDIVI B,^D100 ;CONVERT TO 1 MS UNITS
JRST DOPCTX
DOPCT: MOVE B,VNEW(A) ;
SUBB B,VOLD(A) ;
DOPCTX: MOVE A,B ;
DOPCT1: IMULI A,^D1000
DOPCT3: IDIV A,TOLD ; GET PERCENT*10
ASH B,1 ; ROUNDING -- IF REMAINDER IS
CAML B,TOLD ; GEQ DIVISOR/2, THEN ADD 1
ADDI A,1
;
; SPLIT INTO INTEGER & FRACTION
; GREATER THAN 100% ?
; YES, JUST PRINT INTEGER
DOPCT2: TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL OPCT ;OUTPUT PERCENTAGE TO DATA FILE
IDIVI A,^D10
CAIL A,^D100
JRST [ CALL LABEL
MOVE B,A
MOVE A,OJFN
MOVE C,[1B2+1B4+1B5+4B17+12] ; 4 COLUMNS
NOUT
JFCL
MOVEI B,"."
BOUT
RET ]
PUSH P,B ; SAVE FRACTION
CALL LABEL ; PRINT STAT NAME
MOVE B,A ;
MOVE A,OJFN ;
MOVE C,[1B2+1B4+1B5+3B17+12] ; 3 COLUMNS FOR INTEGER
NOUT ; PRINT THE NUMBER
JFCL ;
MOVEI B,"." ;
BOUT ;
POP P,B ;
HRLI C,(1B4+1B5+1B17) ; ONE COLUMN FOR FRACTION
NOUT ; PRINT THE FRACTION
JFCL ;
RET ; AND GO BACK
; FUNCTIONS TO COMPUTE SYSTAT & JOBRT DATA
;
; DOUSE -- TAKES NO INDEX, ADDS UP ALL JOB RUN TIMES
;
DOUSE: HLLZ D,NNJOBS ; NUMBER OF JOBS ON SYSTEM
SETZB A,JOBCT ; SET TO ACCUMULATE RUN TIMES
DOUSE2: SKIPGE B,JNEW(D) ; IF JOB DOESN'T EXIST, SKIP IT
JRST DOUSE1 ;
SKIPL C,JOLD(D) ; IF JOB DIDN'T EXIST BEFORE,
CAMGE B,C ; OR LOGGED OUT AND IN AGAIN,
SETZ C, ; USE 0 AS PREVIOUS RUNTIME
SUB B,C ; NEW - OLD
MOVEM B,JOLD(D) ; SAVE INTERVAL RUN TIME FOR JOB
ADD A,B ; ACCUMULATE TOTAL RUN TIME
AOS JOBCT ;
DOUSE1: AOBJN D,DOUSE2 ; LOOP BACK TO DO ALL
JRST DOPCT1 ; GO DO PERCENTAGE OF INTERVAL
; LABEL -- PRINTS A STAT NAME
;
LABEL: TXNE F,TUNEMF
RET
PUSH P,A ; STACK A
MOVE A,OJFN ;
HRRO B,VNAMES(G) ; OUTPUT STAT NAME
SETZ C, ;
SOUT ; PRINT THE LABEL
HRROI B,[ASCIZ/: /] ;
SETZ C, ;
SOUT ;
POP P,A ; RESTORE A
RET ; AND GO BACK
;DO NUMBER AS RATE - NUMBER/SECOND
DORAT: MOVE B,VNEW(A)
SUBB B,VOLD(A)
DORAT0: JUMPE B,DOZRO
IMULI B,^D10000 ;10 * MILLISECONDS
MOVE A,B
JRST DOPCT3
;DO NUMBER AS RATE PER MINUTE
DORAT1: MOVE B,VNEW(A)
SUBB B,VOLD(A)
JUMPE B,DOZRO
IMUL B,[^D6000000] ;PER 60000 MS, * 100 FOR OUTPUT
MOVE A,B
IDIV A,TOLD ; GET PERCENT*100
ASH B,1 ; ROUNDING -- IF REMAINDER IS
CAML B,TOLD ; GEQ DIVISOR/2, THEN ADD 1
ADDI A,1 ;
CAIL A,^D10000 ;WITHIN RANGE?
JRST [ IDIVI A,^D10 ;NO, SCALE AND PRINT AS INTEGER
JRST DOPCT2]
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL ORAT ;OUTPUT THE RATE TO THE DATA FILE
IDIVI A,^D100 ;100 IS UNIT
PUSH P,B ;SAVE FRACTION
CALL LABEL
MOVE B,A ;SETUP INTEGER PART
MOVE A,OJFN
MOVX C,NO%LFL+NO%OOV+NO%AST+2B17+^D10
NOUT
NOP
MOVEI B,"."
BOUT
POP P,B
MOVX C,NO%LFL+NO%ZRO+NO%OOV+NO%AST+2B17+^D10
NOUT
NOP
RET
;DO TOTAL DISK IO RATE
;5 consecutive totals
DOIO: MOVE B,VOLD(A) ;DMRD
ADD B,VOLD+1(A) ;DMWR
ADD B,VOLD+2(A) ;DKRD
ADD B,VOLD+3(A) ;DKWR
ADD B,VOLD+51(A) ;DKRV
JRST DORAT0
;TOTAL DISK IO - TUNE MODE
DOIOT: MOVE B,VNEW(A)
SUB B,VOLD(A)
ADD B,VNEW+1(A)
SUB B,VOLD+1(A)
ADD B,VNEW+2(A)
SUB B,VOLD+2(A)
ADD B,VNEW+3(A)
SUB B,VOLD+3(A)
ADD B,VNEW+51(A) ;ADD READ VERIFICATION COUNT
SUB B,VOLD+51(A)
JRST DORAT0
;OUTPUT 0 IN FIVE COLUMNS
DOZRO: MOVEI A,0
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL ORAT ;OUTPUT THE RATE TO THE DATA FILE
CALL LABEL
MOVE A,OJFN
HRROI B,[ASCIZ / 0/]
SETZ C,
SOUT
RET
; DONUM -- INTEGER NUMBER
;
DONUM: CALL LABEL ; PRINT A STAT NAME
MOVE B,VNEW(A) ;
SUBB B,VOLD(A) ;
PNUM: MOVE A,OJFN ; SET UP FOR OUTPUT
MOVE C,[1B2+1B4+1B5+5B17+12] ; 5 COLUMNS
NOUT ;
JFCL ;
RET ; AND GO BACK
; DOAV -- AVERAGE COMPUTED FROM INTEGRAL OVER DT
;
DOAV: MOVE B,VNEW(A) ;
SUBB B,VOLD(A) ;
IMULI B,12 ; FOR ONE PLACE AFTER POINT
MOVE A,B ;
JRST DOPCT3 ; GO DIVIDE BY DT
; DOAVB -- AVERAGE COMPUTED FROM INTEGRAL.DBALSETTIME
;
DOAVB: MOVE B,VNEW(A) ;
SUBB B,VOLD(A) ;
IMULI B,1750 ; 1750 = 1000
IDIV B,VOLD+NBWTX ; DIVIDE BY NBWT
ASH C,1 ; ROUNDING -- SEE DOPCT3
CAML C,VOLD+NBWTX ;
ADDI B,1 ;
MOVE A,B ;
JRST DOPCT2 ;
;DOXB - PRINT XBIO VALUES
DOXB: RET ;*** TABLE DOESN'T EXIST IN MON, AND MAY NEVER
CALL LABEL ;OUTPUT NAME
MOVE B,XBRNEW(A) ;GET VALUE
SUB B,XBROLD(A) ;GET DIFFERENCE
CALL PNUM ;PRINT IT
RET ;DONE
; SPACE -- INSERTS A SPACE WHEN NECESSARY
;
SPACE: MOVEI B," " ; NULL CHARACTER
BOUT ; SPACE OVER
RET ; RETURN
;
; LISTIT -- PRINTS LIST OF SWATCH ABBREVIATIONS TO TTY:
; AT USER'S REQUEST
;
LISTIT: HRROI A,HELP ; GRAB THE LIST
PSOUT ;
RET ; AND GO BACK
SKNOB: MOVEI A,.SKRBC ;READ KNOB
MOVEI B,SKJBP
SKED%
ERJMP .+1
CALL LABEL
MOVE B,SKJBP+.SAKNB
MOVE A,OJFN
MOVE C,[1B2+1B4+1B5+5B17+12]
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL ONUM ;OUTPUT THE NUMBER
NOUT
NOP
RET
;FOLLOWING IS COPIED FROM STG.MAC IN CURRENT MONITOR. SHOULD
;BE RECOPIED WHENEVER TABLE CHANGED IN STG.MAC.
;MONITOR STATISTICS
;N.B. THIS TABLE IS AVAILABLE THROUGH GTTAB AND IS USED BY WATCH, EXEC, ETC.
;THE RELATIVE LOCATION OF WORDS WITHIN THE TABLE SHOULD NOT BE CHANGED.
NSTAT==:0 ;COUNT NUMBER STAT WORDS
;SPECIAL VERSION OF RS FOR STAT WORDS - COUNTS TOTAL
DEFINE STATRS (SYM,NUM)<
IF1,<
IFDEF SYM,<PRINTX % SYM already defined>
IFNDEF SYM,<
SYM==NSTAT>
NSTAT=NSTAT+NUM
>>
STATRS SKDTM0,1 ;TIME SPENT IN SKDNUL WITH BALSET EMPTY
STATRS SKDTM1,1 ;TIME SPENT IN SKDNUL WITH BALSET NON-EMPTY
STATRS SKDTM2,1 ;TIME SPENT RUNNING SCHEDULER
STATRS SPTTIM,1 ;TIME SPENT IN PAGER TRAP CODE
STATRS DRMRD,1 ;NUMBER OF DRUM READS
STATRS DRMWR,1 ;NUMBER OF DRUM WRITES
STATRS DSKRD,1 ;NUMBER OF DISK READS
STATRS DSKWR,1 ;NUMBER OF DISK WRITES
STATRS TTYBKS,1 ;NUMBER OF FORK WAKEUPS
STATRS TTINTS,1 ;NUMBER OF TERMINAL INTERRUPTS
STATRS BSTSUM,1 ;INTEGRAL OF NBPROC DT
STATRS RJTSUM,1 ;INTEGRAL OF NBPROC+NGOJOB DT
NRJAVS==:3 ;NUMBER OF EXPONENTIAL AVERAGES MAINTAINED
STATRS RJAV,NRJAVS ;EXPONENTIAL AVERAGE OF NUMBER RUNNABLE FORKS
STATRS DSKWT,1 ;SUM OF PROCESS DSK WAIT TIMES
STATRS DRMWT,1 ;SUM OF PROCESS DRUM WAIT TIMES
STATRS NTTYIN,1 ;TOTAL NUMBER TERMINAL INPUT CHARS
STATRS NTTYOT,1 ;TOTAL NUMBER TERMINAL OUTPUT CHARS
STATRS NGCCOR,1 ;COUNT OF GCCOR'S
STATRS GCCTIM,1 ;INTEGRAL OF GCCOR TIME
STATRS NREMR,1 ;COUNT OF WS REMOVALS WHILE RUNNABLE
STATRS BSWT,1 ;SUM OF PROCESS WAIT TIMES
STATRS SKDOVH,1 ;ACCUMULATED SCHED OVERHEAD TIME IN HP UNITS
STATRS SKDIDL,1 ;ACCUMULATED IDLE TIME IN HP UNITS
STATRS SKDSWP,1 ;ACCUMULATED SWAP-WAIT TIME IN HP UNITS
STATRS USRTIM,1 ;ACCUMULATED USER TIME IN MILLISECONDS
STATRS HQFSUM,1 ;INTEGRAL OF NHQFK DT
STATRS LQFSUM,1 ;INTEGRAL OF NLQFK DT
STATRS DWRWT,1 ;SUM OF PROCESS DISK WRITE WAIT
STATRS NAJBAL,1 ;NUMBER OF FORCED AJBALS CALLS
STATRS SNRSUM,1 ;INTEGRAL OF SUMNR
STATRS RPQSUM,1 ;INTEGRAL OF NRPLQ
STATRS HSPTTM,1 ;HP PAGER TRAP TIME
STATRS NCSWCH,1 ;NUMBER OF CONTEXT SWITCHES
STATRS BGNDTM,1 ;TIME DOING BACKGROUND STUFF (TTCH7, ETC.)
STATRS STRPCT,1 ;SYSTEM TOTAL PAGE TRAPS
STATRS SRPQSC,1 ;SYSTEM TOTAL "SAVES" FROM RPLQ
STATRS SGCCWR,1 ;NUMBER WRITES FROM GCCOR
STATRS NWSSUM,1 ;INTEGRAL OF NUMBER WS IN MEM
STATRS SKDFIL,1 ;INTEGRAL OF WAIT TIME WO SWAP WAITS
STATRS NWSLOD,1 ;COUNT OF WS LOADS
STATRS NREMJ,1 ;COUNT OF BALSET REMOVALS WHILE RUNNABLE
STATRS SXGCWR,1 ;NUMBER WRITES FROM XGC
STATRS TTWAKN,1 ;COUNT OF TERMINAL INPUT WAKEUPS
;***** END OF STATISTICS TABLE *****
; TABLE OF ITEMS TO BE REPORTED
;ITEMS ARE PRINTED 4 ACROSS PAGE, HENCE SOME USEFUL GROUPINGS OF 4
;SHOULD BE NOTED WHEN ADDING NEW ITEMS
DEFINE VNAME(NM,SUBR,LC)<
XWD [XWD LC,SUBR],[ASCIZ/NM/]>
VNAMES: VNAME(USED,DOPCT,32)
VNAME(IDLE,DOPCT,0)
VNAME(SWPW,DOPCT,1)
VNAME(SKED,DOPCT,2)
VNAME(SUSE,DOUSE,0)
VNAME(TCOR,DOPCTH,24)
VNAME(FILW,DOPCTH,50)
VNAME(BGND,DOPCTH,43)
VNAME(NTRP,DORAT,44)
VNAME(NCOR,DORAT1,23)
VNAME(AJBL,DORAT1,36)
VNAME(NREM,DORAT1,25)
VNAME(TRAP,DOPCT,3)
VNAME(NRUN,DOAV,13)
VNAME(NBAL,DOAV,NBALX)
VNAME(NWSM,DOAV,47)
VNAME(BSWT,DOAV,NBWTX)
VNAME(DSKR,DOAVB,17)
VNAME(DSKW,DOAVB,35)
VNAME(SWPR,DOAVB,20)
VNAME(NLOD,DORAT1,51)
VNAME(CTXS,DORAT,42)
VNAME(UPGS,DOAV,37)
VNAME(FPGS,DOAV,40)
VNAME(DMRD,DORAT,4)
VNAME(DMWR,DORAT,5)
VNAME(DKRD,DORAT,6)
VNAME(DKWR,DORAT,7)
VNAME(DKRV,DORAT,55)
VNAME(TTIN,DORAT,21)
VNAME(TTOU,DORAT,22)
VNAME(TWAK,DORAT,54)
VNAME(WAKE,DORAT,10)
VNAME(RPQS,DORAT,45)
VNAME(GCCW,DORAT,46)
VNAME(XGCW,DORAT,53)
VNAME(TDIO,DOIO,4)
VNAME(KNOB,SKNOB,0)
VNAME(TTCC,DORAT1,11)
VNAME(XBRD,DOXB,0)
VNAME(XBWT,DOXB,1)
NVALS==.-VNAMES
NBALX==12
NBWTX==26
;SHORT TABLE OF ITEMS FOR TUNE MODE
SVNAMT: VNAME (USED,DOPCT,32)
VNAME(SWPW,DOPCT,1)
VNAME(SKED,DOPCT,2)
VNAME(CTXS,DORAT,42)
VNAME(WAKE,DORAT,10)
VNAME(TDIO,DOIOT,4)
VNAME(NRUN,DOAV,13)
VNAME(NWSM,DOAV,47)
VNAME(NLOD,DORAT1,51)
NSVALT==.-SVNAMT
;HERE FOR INITIAL HELP
DOHLP: CALL LISTIT ; PRINT THE LIST
JRST GOJFN
; LIST OF ABBREVIATIONS USED
;
HELP: ASCIZ /
ALL DATA IS FOR LAST INTERVAL ONLY.
USED: USED TIME AS PERCENTAGE
IDLE: IDLE TIME AS PERCENTAGE
SWPW: SWAP-WAIT TIME AS PERCENTAGE
SKED: SCHEDULER OVERHEAD TIME AS PERCENTAGE
SUSE: SUM OF JOB RUNTIMES AS PERCENTAGE
TCOR: GCCOR TIME AS PERCENTAGE
FILW: FILE-WAIT TIME AS PERCENTAGE
BGND: BACKGROUND ACTIVITY TIME (TTCH7, ETC.) AS PERCENTAGE
NTRP: PAGE TRAPS PER SECOND
NCOR: GCCOR'S (GARBAGE-COLLECT CORE) PER MINUTE
AJBL: FORCED CALLS TO AJBALS (ADJUST BALANCE SET) PER MINUTE
NREM: FORCED PROCESS REMOVALS PER MINUTE
TRAP: PAGER TRAP SERVICE TIME PERCENTAGE (COUNTS IN USED ALSO)
NRUN: AVERAGE NUMBER RUNNABLE FORKS DURING INTERVAL
NBAL: AVERAGE NUMBER FORKS IN BALANCE SET DURING INTERVAL
NWSM: AVERAGE NUMBER WORKING SETS IN MEMORY DURING INTERVAL
BSWT: AVERAGE NUMBER BALANCE SET FORKS WAITING DURING INTERVAL
DSKR: PERCENT OF BALANCE SET WAITS ATTRIBUTABLE TO DSK READS
DSKW: PERCENT OF BALANCE SET WAITS ATTRIBUTABLE TO DSK WRITES
SWPR: PERCENT OF BALANCE SET WAITS ATTRIBUTABLE TO SWAP READS
NLOD: WORKING SET LOADS PER MINUTE
CTXS: CONTEXT SWITCHES PER SEC
UPGS: AVERAGE NUMBER OF PAGES IN THE BALANCE SET (SUM OF WORKING SET SIZES)
FPGS: AVERAGE NUMBER OF FREE PAGES (PAGES ON REPLACABLE QUEUE)
DMRD: DRUM READS PER SEC
DMWR: DRUM WRITES PER SEC
DKRD: DISK READS PER SEC
DKWR: DISK WRITES PER SEC
DKRV: DISK READ-VERIFICATIONS PER SECOND
TTIN: TERMINAL INPUT CHARACTERS PER SEC
TTOU: TERMINAL OUTPUT CHARACTERS PER SEC
WAKE: PROCESS WAKEUPS PER SEC
TTCC: TERMINAL INTERRUPTS PER MINUTE
TDIO: TOTAL DISK IO PER SEC
RPQS: "SAVES" FROM REPLACABLE QUEUE PER SECOND
GCCW: WRITES BY GCCOR AND WSSWPO PER SECOND
XGCW: WRITES BY XGC PER SECOND
KNOB: SCHEDULER KNOB
QUEUE DISTRIBUTION PERCENTAGE: FRACTION OF "USED" TIME USED ON
EACH SCHEDULER QUEUE.
LOAD AVERAGES: EXPONENTIAL AVERAGE OF NUMBER OF RUNNABLE FORKS WITH
TIME CONSTANTS OF 1, 5, AND 15 MINUTES.
HIGH QUEUE AVERAGES: COMPONENT OF LOAD AVERAGE DUE TO FORKS ON
INTERACTIVE QUEUES.
LOW QUEUE AVERAGES: COMPONENT OF LOAD AVERAGE DUE TO FORKS ON
COMPUTE QUEUE.
RUN TIME: TOTAL ACCUMULATED RUN TIME OF JOB (ALL FORKS) AS HH:MM:SS.
DELTA RT: JOB RUNTIME IN LAST INTERVAL
%: JOB RUNTIME AS PERCENTAGE OF "USED"
/
;QUEUE TIMES LOGIC
;READ CURRENT QUEUE TIMES INTO TABLE
GETQS: MOVE A,[QTTAB,,OQTTAB]
BLT A,OQTTAB+NQTAB-1 ;COPY CURRENT DATA TO OLD
MOVE A,[SIXBIT /QTIMES/]
SYSGT ;GET TABLE PARAMETERS
HLLZ D,B
HLREM B,NQUEUE ;SAVE NEG TABLE SIZE
GETQS1: HRRZ A,B ;SETUP INDEX,,TABLE NUMBER
HRL A,D
GETAB
JFCL
MOVEM A,QTTAB(D) ;SAVE DATA
AOBJN D,GETQS1
RET
;PRINT QUEUE TIMES AS PERCENTAGE OF INTERVAL
PQSUM: MOVE A,OJFN
HRROI B,[ASCIZ /QUEUE DISTRIBUTION PERCENTAGE: /]
SETZ C,
SOUT
HRLZ D,NQUEUE
MOVEI P3,.PQMAX ;SET COUNTER TO CHECK OVERFLOW OF QUEUE ENTRIES
; DATA RECORD
PQSUM1: MOVE B,QTTAB(D) ;GET CURRENT TIME
SUB B,OQTTAB(D) ;COMPUTE DELTA
FLTR B,B ;FLOAT IT
FMPRI B,(100.0) ;COMPUTE PERCENTAGE
FLTR C,INTRVL
FDVR B,C
MOVX C,<FLD(.FLLSP,FL%JUS)+FL%ONE+FL%PNT+FLD(4,FL%FST)+FLD(2,FL%SND)>
SOJL P3,PQSUM2 ;DO NOT OUTPUT TO DATA RECORD IF IT IS FULL OF
; QUEUE ENTRIES
TXNE F,ODATFL ;TEST IF USING DATA FILE
CALL OFLT ;OUTPUT A FLOATING POINT NUMBER
PQSUM2: FLOUT ;PRINT IT
JFCL
AOBJN D,PQSUM1
CALL CRLF ;DO CRLF
TXNN F,ODATFL ;TEST IF USING DATA FILE
RET ;RETURN
CALL PQFIL ;APPEND ZERO ENTRIES TO FILL RECORD AND OUTPUT
; NUMBER OF GOOD ENTRIES
CALL PRIREC ;OUTPUT THE DATA RECORD
RET
JOBNUM: BLOCK JBMAX
TTYNUM: BLOCK JBMAX
USER: BLOCK JBMAX
PRGNAM: BLOCK JBMAX
RUNTIM: BLOCK JBMAX
DRUNTM: BLOCK JBMAX
PERCNT: BLOCK JBMAX
STR: 0
NJOBS: 0
OJFN: 0
NCOL: 0
LINCNT: 0
PJFLDW: 0 ;PTR TO NEXT FIELD WIDTH
WAITIM: 0
STIME: 0
INTRVL: 0
SOLDTM: 0
NULTIM: 0
LOSTIM: 0
SCHEDT: 0
JIBLK: BLOCK 10
STRNGL==20
STRING: BLOCK STRNGL
PDLEN==50
PDL: BLOCK PDLEN
NNJOBS: BLOCK 1
NSYST: BLOCK 1
SYSTAT: BLOCK 1
JOBRT: BLOCK 1
XBIO: BLOCK 1
JOBCT: BLOCK 1
;
; ITEM TABLES -- ORDER OF NEW MUST BE SAME AS ORDER OF OLD:
; V MUST BE FIRST & T MUST BE LAST
;
NSTATW==100 ;NUMBER OF STATISTICS WORDS MAX
VOLD: BLOCK NSTATW
JOLD: BLOCK JBMAX
XBROLD: BLOCK 1
XBWOLD: BLOCK 1
TOLD: BLOCK 1
VNEW: BLOCK NSTATW
JNEW: BLOCK JBMAX
XBRNEW: BLOCK 1
XBWNEW: BLOCK 1
TNEW: BLOCK 1
NQTAB==7 ;MAX NUMBER QUEUES POSSIBLE
QTTAB: BLOCK NQTAB ;CURRENT QUEUE TIMES
OQTTAB: BLOCK NQTAB ;PREVIOUS QUEUE TIMES
NQUEUE: BLOCK 1 ;ACTUAL NUMBER QUEUES (NEGATIVE)
SKJBP: 10 ;SIZE OF BLOCK
BLOCK 7 ;JOB PARAMETERS BLOCK
SKLDA: 7 ;CLASS LOAD AVERAGES BLOCK
BLOCK 7
END <3,,ENTVEC>