ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   0
Table of contents

    (1)       20        macros
    (1)       44        equates
    (1)       77        ro structures
    (1)       84        structures
    (1)      121        code
    (1)      148        initialize data structures
    (1)      197        scan process
    (1)      338        check candidate processes for priority c
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   1
V00.0A                                                                    3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     0000     1 .TITLE	ZEUS	- CPU UTILIZATION MONITOR.
                                     0000     2 .IDENT	/V00.0A/
                                     0000     3 ;
                                     0000     4 ;the purpose of this program is the monitoring of utilization of cpu.
                                     0000     5 ;it lowers cpu bound interactive processes to a priority lower than 
                                     0000     6 ;the interactive priority.  this allows interactive processes (terminal io
                                     0000     7 ;in particular.) to interrupt cpu bound interactive processes.  this
                                     0000     8 ;structures the priority mechanism separating the interactive i/o processes
                                     0000     9 ;from the interactive cpu bound processes.  this provides better
                                     0000    10 ;treatment of io processed (such as edt, dcl, etc.) and let the cpu bound
                                     0000    11 ;jobs fight among themselves in a lowered priority.
                                     0000    12 ;
                                     0000    13 ;debug = 1			;assign if debug mode.
                                     0000    14 
                                     0000    15 ;
                                     0000    16 ;major parameters.
                                     0000    17 ;
                           00000004  0000    18 sleep_seconds	=	4	;sleep seconds.
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   2
V00.0A                          macros                                    3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     0000    20 .subtitle	macros
                                     0000    21 ;
                                     0000    22 ;define jpi structure.
                                     0000    23 ;
                                     0000    24 	.macro	m_jpi_ent	code, length
                                     0000    25 	.word	length
                                     0000    26 	.word	jpi$_'code
                                     0000    27 .save_psect
                                     0000    28 .psect	p_jpi_rw	rd, wrt
                                     0000    29 l_'code'addr=.
                                     0000    30 	.blkb	length
                                     0000    31 l_'code'lenaddr=.
                                     0000    32 	.long	0
                                     0000    33 .restore_psect
                                     0000    34 	.long	l_'code'addr
                                     0000    35 	.long	l_'code'lenaddr
                                     0000    36 	.endm	m_jpi_ent
                                     0000    37 
                                     0000    38 	.macro	m_user_ent	code, length
                                     0000    39 o_'code=o_length
                                     0000    40 o_length=o_length+length
                                     0000    41 	.blkb	length
                                     0000    42 	.endm	m_user_ent
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   3
V00.0A                          equates                                   3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     0000    44 .subtitle	equates
                                     0000    45 ;
                                     0000    46 ;
                                     0000    47 ;jpi equates.
                                     0000    48 ;
                                     0000    49 	$jpidef			;define jpi symbols.
                                     0000    50 	$statedef
                                     0000    51 
                                     0000    52 ;
                                     0000    53 ;event flags.
                                     0000    54 ;
                                     0000    55 
                           00000001  0000    56 sleep_efn	=	1	;sleep flag.
                           00000002  0000    57 getjpi_efn	=	2	;get jpi flag.
                                     0000    58 
                                     0000    59 
                           00000100  0000    60 max_process	=	256	;maximum # of processes.
                                     0000    61 
                                     0000    62 ;
                                     0000    63 ;task control word flag bits.
                                     0000    64 ;
                                     0000    65 
                           00000001  0000    66 x_lowpriority	=	1	;process is at lowered priority.
                                     0000    67 
                                     0000    68 ;
                                     0000    69 ;priority.
                                     0000    70 ;
                                     0000    71 
                           00000003  0000    72 low_priority	=	3	;
                           00000004  0000    73 normal_priority	=	4	;
                                     0000    74 
                                     0000    75 
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   4
V00.0A                          ro structures                             3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     0000    77 .subtitle	ro structures
                                     0000    78 
                                 00000000    79 .psect	p_data_ro	rd, nowrt, noexe
                                     0000    80 
                                     0000    81 sleep_time:
                  FFFFFFFF FD9DA600  0000    82 	.long	-10*1000*1000*sleep_seconds, -1
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   5
V00.0A                          structures                                3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     0008    84 .subtitle	structures
                                     0008    85 
                                 00000000    86 .psect	p_data_rw	rd, wrt, noexe
                                     0000    87 ;
                                     0000    88 ;jpi request structures.
                                     0000    89 ;
                                     0000    90 ;block 1 is used for to find all process on system with a terminal.
                                     0000    91 ;
                                     0000    92 jpi_block1:
                                     0000    93 	m_jpi_ent	terminal, 7
                                     000C    94 	m_jpi_ent	owner, 4
                                     0018    95 	m_jpi_ent	cputim, 4
                                     0024    96 	m_jpi_ent	pid, 4
                                     0030    97 	m_jpi_ent	state, 4
                           00000000  003C    98 	.long	0		;end of item list.
                                     0040    99 
                                     0040   100 
                           FFFFFFFF  0040   101 pid:	.long	-1		;used for getting jpi, -1 for world search.
                                     0044   102 
                                     0044   103 
                                     0044   104 user_table:
                           00000000  0044   105 o_length = 0
                                     0044   106 	m_user_ent	pid, 4	;pid of process.
                                     0048   107 	m_user_ent	flag, 4	;indicate state of process.
                                     004C   108 	m_user_ent	cputim, 4	;total cpu time used by process.
                                     0050   109 	m_user_ent	delcputim, 4	;delta cpu time since last scan.
                                     0054   110 	m_user_ent	state, 4	;current state.
                                     0058   111 	m_user_ent	filler, 12	;filler.
                                     0064   112 
                                     0064   113 	.rept	max_process-1	;allocate room for rest of table.
                                     0064   114 	.blkb	o_length	;each entry is this long.
                           00000084  0064   115 	.endr
                                     2044   116 
                                     2044   117 valid_table:			;used to indicate which process are candidates.
                           00002444  2044   118 	.blkl	max_process
                                     2444   119 
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   6
V00.0A                          code                                      3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     2444   121 .subtitle	code
                                     2444   122 
                                 00000000   123 .psect	p_code_ro	rd, nowrt, exe
                                     0000   124 ;
                                     0000   125 ;Zeus will scan the processes at specified intervals to
                                     0000   126 ;accuminate cpu usage info. At the end of the scan, zeus will mark those
                                     0000   127 ;processes which has used more than 25% of the cpu for priority lowering
                                     0000   128 ;candidates.  Any candidate will have its priority lowered to the LOW_PRIORITY.
                                     0000   129 ;All non candidates which are at LOW_PRIORITY will have their state checked.
                                     0000   130 ;If the state is not COM or COMO, then the process will have its priority
                                     0000   131 ;raised to the NORMAL_PRIORITY.  This goes on until doomsday, or a system
                                     0000   132 ;crash (GOD forbid!).
                                     0000   133 ;
                               0000  0000   134 	.entry	start	^m<>
              00000097'EF   00   FB  0002   135 	calls	#0, init_structure	;initialize data structures.
                                     0009   136 	m_on0err	30$, <failed to initialize data structures>
                                     0030   137 1$:
              000000B9'EF   00   FB  0030   138 	calls	#0, scan_process	;scan system for all processes.
                                     0037   139 	m_on0err	30$, <fail to scan process>
              0000020D'EF   00   FB  005E   140 	calls	#0, go_to_sleep		;go rest for a while.
                                     0065   141 	m_on0err	30$, <fail to go to sleep>
                            A2   11  008C   142 	brb	1$			;do this forever.
                                     008E   143 30$:
                                     008E   144 errxit:
                                     008E   145 	$exit_s				;exit, that's all.
                                     0097   146 
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   7
V00.0A                          initialize data structures                3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     0097   148 .subtitle	initialize data structures
                                     0097   149 ;
                                     0097   150 ;description:
                                     0097   151 ;
                                     0097   152 ;	This procedure is called to initialize the jpi and user table
                                     0097   153 ;	structures, plus whatever is necessary to restart the program.
                                     0097   154 ;
                                     0097   155 ;calling convention:
                                     0097   156 ;
                                     0097   157 ;	calls	#0, init_structure
                                     0097   158 ;
                                     0097   159 ;input:
                                     0097   160 ;
                                     0097   161 ;	none
                                     0097   162 ;
                                     0097   163 ;implicit input:
                                     0097   164 ;
                                     0097   165 ;	none
                                     0097   166 ;
                                     0097   167 ;output:
                                     0097   168 ;
                                     0097   169 ;	none
                                     0097   170 ;
                                     0097   171 ;implicit output:
                                     0097   172 ;
                                     0097   173 ;	user_table
                                     0097   174 ;
                                     0097   175 ;corrupts:
                                     0097   176 ;
                                     0097   177 ;	none
                                     0097   178 ;
                                     0097   179 ;exit:
                                     0097   180 ;
                                     0097   181 ;	always success
                                     0097   182 ;
                               000C  0097   183 	.entry	init_structure	^m<r2,r3>
              52   00000044'8F   D0  0099   184 	movl	#user_table, r2	;where user table is.
              53   00000100 8F   D0  00A0   185 	movl	#max_process, r3	;number of entries in table.
                                     00A7   186 1$:
                            62   D4  00A7   187 	clrl	o_pid (r2)	;clear pid.
                         04 A2   D4  00A9   188 	clrl	o_flag (r2)	;clear all flags.
                         08 A2   D4  00AC   189 	clrl	o_cputim (r2)	;total cpu.
                         0C A2   D4  00AF   190 	clrl	o_delcputim (r2)	;delta cpu.
                                     00B2   191 
                         F2 53   F5  00B2   192 	sobgtr	r3, 1$		;loop till done.
                       50   01   D0  00B5   193 	movl	#1, r0		;always success.
                                 04  00B8   194 	ret
                                     00B9   195 
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   8
V00.0A                          scan process                              3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     00B9   197 .subtitle	scan process
                                     00B9   198 ;
                                     00B9   199 ;description:
                                     00B9   200 ;
                                     00B9   201 ;	This procedure does a wildcard scan of every process in system.
                                     00B9   202 ;	It will only process those which have a terminal associate with
                                     00B9   203 ;	it or those which are subprocesses.
                                     00B9   204 ;	(thus ignoring detach processes and batch jobs).
                                     00B9   205 ;
                                     00B9   206 ;calling conventions:
                                     00B9   207 ;
                                     00B9   208 ;	calls	#0, scan_process
                                     00B9   209 ;
                                     00B9   210 ;input:
                                     00B9   211 ;
                                     00B9   212 ;	none
                                     00B9   213 ;
                                     00B9   214 ;implicit input:
                                     00B9   215 ;
                                     00B9   216 ;	user_table
                                     00B9   217 ;
                                     00B9   218 ;output:
                                     00B9   219 ;
                                     00B9   220 ;	none
                                     00B9   221 ;
                                     00B9   222 ;implicit output:
                                     00B9   223 ;
                                     00B9   224 ;	none
                                     00B9   225 ;
                                     00B9   226 ;corrupts:
                                     00B9   227 ;
                                     00B9   228 ;	none
                                     00B9   229 ;
                                     00B9   230 ;exit:
                                     00B9   231 ;
                                     00B9   232 ;	sets r0
                                     00B9   233 ;
                               0F84  00B9   234 	.entry	scan_process	^m<r2,r7,r8,r9,r10,r11>
              57   00002044'8F   D0  00BB   235 	movl	#valid_table, r7	;r7 <-- scratch table to store candidates.
                            58   D4  00C2   236 	clrl	r8			;r8 <-- total interactive cpu usage.
                       5E   08   C2  00C4   237 	subl	#8, sp			;allocate iosb.
                       52   5E   D0  00C7   238 	movl	sp, r2			;r2 <-- iosb addr.
     00000040'EF   FFFFFFFF 8F   D0  00CA   239 	movl	#-1, pid		;scan whole system.
                                     00D5   240 1$:
                                     00D5   241 	$getjpi_s	-
                                     00D5   242 		efn = #getjpi_efn,-	;event flag.
                                     00D5   243 		pidadr = pid,-		;pid.
                                     00D5   244 		itmlst = jpi_block1,-	;items to get.
                                     00D5   245 		iosb = (r2)		;iosb.
                         26 50   E8  00F0   246 	blbs	r0, 2$			;branch if okay.
                  0000'8F   50   B1  00F3   247 	cmpw	r0, #ss$_nopriv		;no priviledge??
                            DB   13  00F8   248 	beql	1$			;continue if.
                  0000'8F   50   B1  00FA   249 	cmpw	r0, #ss$_suspended	;suspended??
                            D4   13  00FF   250 	beql	1$			;continue if.
                  0000'8F   50   B1  0101   251 	cmpw	r0, #ss$_nomoreproc	;no more??
                            10   12  0106   252 	bneq	30$			;error return if not.
              87   FFFFFFFF 8F   D0  0108   253 	movl	#-1, (r7)+		;indicate end of candidates.
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page   9
V00.0A                          scan process                              3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                   00000198'EF   16  010F   254 	jsb	check_process		;check all processes.
                       50   01   D0  0115   255 	movl	#1, r0			;no more is success.
                                     0118   256 30$:
                                 04  0118   257 	ret				;error  return.
                                     0119   258 2$:
                                     0119   259 	$waitfr_s	efn = #getjpi_efn	;wait for jpi to finish.
                       50   62   3C  0122   260 	movzwl	(r2), r0		;get iosb.
                         F0 50   E9  0125   261 	blbc	r0, 30$			;bracnh if error.
                                     0128   262 ;
                                     0128   263 ;process info.
                                     0128   264 ;
                                     0128   265 	.if	df	debug
                                     0128   266 	movl	r2, -(sp)
                                     0128   267 	movl	#jpi_block1, r2
                                     0128   268 	m_mess	<PID:!XL TERMINAL:!AF OWNER:!XL CPUTIM:!XL>,-
                                     0128   269 		<@36+4(R2), @8(R2), 4(R2), @12+4(R2), @24+4(R2)>
                                     0128   270 	movl	(sp)+, r2
                                     0128   271 	.endc
                                     0128   272 ;
                                     0128   273 ;see if there is a terminal attached.
                                     0128   274 ;
                   00000007'EF   95  0128   275 	tstb	l_terminallenaddr	;terminal string??
                            19   12  012E   276 	bneq	10$			;branch if terminal exist.
                                     0130   277 ;
                                     0130   278 ;see if owner process exist.
                                     0130   279 ;
              5B   0000000B'EF   3C  0130   280 	movzwl	l_owneraddr,r11	;owner??
                            03   12  0137   281 	bneq	11$			;branch if there is a owner
                                     0139   282 ;
                                     0139   283 ;no terminal and no owner, leave it alone.
                                     0139   284 ;
                                     0139   285 	.if	df	debug
                                     0139   286 	m_mess	<no terminal and no owner>
                                     0139   287 	.endc
                          FF99   31  0139   288 	brw	1$			;loop till no more or error.
                                     013C   289 11$:
                  5B   5B   05   78  013C   290 	ashl	#5, r11, r11		;make it offset into user table.
                       0044'CB   D5  0140   291 	tstl	user_table+o_pid (r11)	;interactive process??
                            03   12  0144   292 	bneq	10$			;branch if interactive process.
                                     0146   293 ;
                                     0146   294 ;subprocess which is not spawn by interactive processes.
                                     0146   295 ;
                                     0146   296 	.if	df	debug
                                     0146   297 	m_mess	<subprocess not spawn by terminal>
                                     0146   298 	.endc
                          FF8C   31  0146   299 	brw	1$			;continue.
                                     0149   300 ;
                                     0149   301 ;interactive process or subprocess spawn by interactive process.
                                     0149   302 ;
                                     0149   303 10$:
                                     0149   304 	.if	df	debug
                                     0149   305 	m_mess	<candidate - - - terminal or subprocess>
                                     0149   306 	.endc
              5A   0000001B'EF   D0  0149   307 	movl	l_pidaddr, r10		;get pid.
                       5B   5A   3C  0150   308 	movzwl	r10, r11		;mask out high word.
                  5B   5B   05   78  0153   309 	ashl	#5, r11, r11		;make it offset into user table.
                       87   5B   D0  0157   310 	movl	r11, (r7)+		;indicate this is a candidate.
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page  10
V00.0A                          scan process                              3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     015A   311 					;the offset is stored.
                  0044'CB   5A   D1  015A   312 	cmpl	r10, user_table+o_pid (r11)	;same pid??
                            11   13  015F   313 	beql	12$			;branch if same.
                                     0161   314 ;
                                     0161   315 ;pid has changed, indicating the old process went away, so init user entry.
                                     0161   316 ;
                                     0161   317 	.if	df	debug
                                     0161   318 	m_mess	<pid changed - clearing user table entry>
                                     0161   319 	.endc
                  0044'CB   5A   D0  0161   320 	movl	r10, user_table+o_pid (r11)	;new pid.
                       0048'CB   D4  0166   321 	clrl	user_table+o_flag (r11)		;flags.
                       004C'CB   D4  016A   322 	clrl	user_table+o_cputim (r11)	;total cpu usage.
                       0050'CB   D4  016E   323 	clrl	user_table+o_delcputim (r11)	;delta cpu usage.
                                     0172   324 ;
                                     0172   325 ;calculate delta cpu usage and total all interactivce cpu usage.
                                     0172   326 ;
                                     0172   327 12$:
         00000013'EF   004C'CB   C3  0172   328 	subl3	user_table+o_cputim (r11), l_cputimaddr,-
                       0050'CB       017B   329 		user_table+o_delcputim (r11)	;find delta.
                  58   0050'CB   C0  017E   330 	addl	user_table+o_delcputim (r11), r8	;accum interactive cpu
                                     0183   331 							;usage.
         004C'CB   00000013'EF   D0  0183   332 	movl	l_cputimaddr, user_table+o_cputim (r11)	;update cpu ticks used
                                     018C   333 							;so far.
         0054'CB   00000023'EF   D0  018C   334 	movl	l_stateaddr, user_table+o_state (r11)	;save state.
                          FF3D   31  0195   335 	brw	1$				;loop.
                                     0198   336 
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page  11
V00.0A                          check candidate processes for priority c  3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     0198   338 .subtitle	check candidate processes for priority changing
                                     0198   339 ;
                                     0198   340 ;description
                                     0198   341 ;
                                     0198   342 ;	this procedure checks the valid table for candidates for priority
                                     0198   343 ;	changing.  The valid table is terminated by a -1 longword.
                                     0198   344 ;	First, the total interactive cpu usage is divided by 4.  Then
                                     0198   345 ;	each candidate's delta cpu usage is compared to it.  If it is
                                     0198   346 ;	less, then if the process is at lowered priority, then if the
                                     0198   347 ;	state of the process is not COM or COMO then the
                                     0198   348 ;	process's priority's priority is raised.  If it is more, then if
                                     0198   349 ;	the process is at normal priority, then the process's priority is
                                     0198   350 ;	lowered. If it is more and the process is at lowered priority.
                                     0198   351 ;
                                     0198   352 ;calling conventions:
                                     0198   353 ;
                                     0198   354 ;	jsb	check_process
                                     0198   355 ;
                                     0198   356 ;input:
                                     0198   357 ;
                                     0198   358 ;	r8	<--	total interactive cpu usage.
                                     0198   359 ;
                                     0198   360 ;corrupts:
                                     0198   361 ;
                                     0198   362 ;	r7,r8,r9,r10,r11
                                     0198   363 ;
                                     0198   364 check_process:
               58   58   FE 8F   78  0198   365 	ashl	#-2, r8, r8		;divide by 4.
                            01   14  019D   366 	bgtr	2$			;do it only if some interactive cpu used.
                                 05  019F   367 	rsb				;return if not.
                                     01A0   368 2$:
              57   00002044'8F   D0  01A0   369 	movl	#valid_table, r7	;get candidate table addr.
              5A   00000044'8F   D0  01A7   370 	movl	#user_table, r10	;base of user table.
                                     01AE   371 1$:
                       5B   87   D0  01AE   372 	movl	(r7)+, r11		;get offset.
                            01   18  01B1   373 	bgeq	10$			;branch if another candidate.
                                 05  01B3   374 	rsb
                                     01B4   375 10$:
                                     01B4   376 	.if	df	debug
                                     01B4   377 	m_mess	<candidate !XL>, <r11>
                                     01B4   378 	.endc
                       5B   5A   C0  01B4   379 	addl	r10, r11		;point to entry.
                    58   0C AB   D1  01B7   380 	cmpl	o_delcputim (r11), r8	;used more than 1/4.
                                     01BB   381 	m_if_gtr	100$		;branch if used more than 1/4.
                                     01C3   382 	.if	df	debug
                                     01C3   383 	m_mess	<less than 1/4>
                                     01C3   384 	.endc
                    04 AB   01   D3  01C3   385 	bitl	#x_lowpriority, o_flag (r11)	;low priority??
                            03   12  01C7   386 	bneq	11$			;branch if so.
                                     01C9   387 	.if	df	debug
                                     01C9   388 	m_mess	<already at normal priority>
                                     01C9   389 	.endc
                          FFE2   31  01C9   390 	brw	1$			;do next one if not.
                                     01CC   391 11$:
                                     01CC   392 	.if	df	debug
                                     01CC   393 	m_mess	<low priority - check state>
                                     01CC   394 	.endc
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page  12
V00.0A                          check candidate processes for priority c  3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                    10 AB   0C   D1  01CC   395 	cmpl	#sch$c_com, o_state (r11)	;compute??
                            19   13  01D0   396 	beql	12$			;branch if compute, don't raise prio.
                    10 AB   0D   D1  01D2   397 	cmpl	#sch$c_como, o_state (r11)	;compute outswap??
                            13   13  01D6   398 	beql	12$			;branch if compute outswap.
                                     01D8   399 	.if	df	debug
                                     01D8   400 	m_mess	<not compute bound - raised priority>
                                     01D8   401 	.endc
                                     01D8   402 	$setpri_s	-		;raised priority.
                                     01D8   403 		pidadr = @o_pid (r11),-	;pid.
                                     01D8   404 		pri = #normal_priority	;new priority.
                                     01E7   405 	.if	df	debug
                                     01E7   406 	m_mess	<raised priority status = !XL>, <r0>
                                     01E7   407 	.endc
                    04 AB   01   CA  01E7   408 	bicl	#x_lowpriority, o_flag (r11)	;clear low priority flag.
                                     01EB   409 12$:
                          FFC0   31  01EB   410 	brw	1$			;do next one.
                                     01EE   411 ;
                                     01EE   412 ;used more than 1/4. so lowered the priority if necessary.
                                     01EE   413 ;
                                     01EE   414 100$:
                                     01EE   415 	.if	df	debug
                                     01EE   416 	m_mess	<used more than 1/4>
                                     01EE   417 	.endc
                    04 AB   01   D3  01EE   418 	bitl	#x_lowpriority, o_flag (r11)	;low priority already??
                            03   13  01F2   419 	beql	101$			;branch if not.
                                     01F4   420 	.if	df	debug
                                     01F4   421 	m_mess	<already at low priority>
                                     01F4   422 	.endc
                                     01F4   423 					;much cpu again.
                          FFB7   31  01F4   424 	brw	1$			;do next one.
                                     01F7   425 101$:
                                     01F7   426 	.if	df	debug
                                     01F7   427 	m_mess	<lowering priority>
                                     01F7   428 	.endc
                                     01F7   429 	$setpri_s	-		;lowered priority.
                                     01F7   430 		pidadr = @o_pid (r11),-	;pid.
                                     01F7   431 		pri = #low_priority	;new priority.
                                     0206   432 	.if	df	debug
                                     0206   433 	m_mess	<lowered priority status = !XL>, <r0>
                                     0206   434 	.endc
                    04 AB   01   C8  0206   435 	bisl	#x_lowpriority, o_flag (r11)	;set low priority flag.
                          FFA1   31  020A   436 	brw	1$			;that's all.
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page  13
V00.0A                                                                    3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

                                     020D   438 .subtitle
                                     020D   439 ;
                                     020D   440 ;description:
                                     020D   441 ;
                                     020D   442 ;	This procedure sets a timer on an event flag, and waits for it.
                                     020D   443 ;
                                     020D   444 ;calling conventions:
                                     020D   445 ;
                                     020D   446 ;	calls	#0, go_to_sleep
                                     020D   447 ;
                                     020D   448 ;input:
                                     020D   449 ;
                                     020D   450 ;	none
                                     020D   451 ;
                                     020D   452 ;implicit input:
                                     020D   453 ;
                                     020D   454 ;	sleep_time
                                     020D   455 ;
                                     020D   456 ;exit:
                                     020D   457 ;
                                     020D   458 ;	sets r0
                                     020D   459 ;
                               0000  020D   460 	.entry	go_to_sleep	^m<>
                                     020F   461 	$setimr_s	-	;set a timer on event flag.
                                     020F   462 		daytim = sleep_time,-	;delta time.
                                     020F   463 		efn = #sleep_efn	;event flag.
                         09 50   E9  0222   464 	blbc	r0, 30$
                                     0225   465 	$waitfr_s	-	;wait for it to happen.
                                     0225   466 		efn = #sleep_efn
                                     022E   467 30$:
                                 04  022E   468 	ret
                                     022F   469 	.end	start
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page  14
Symbol table                                                              3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

$$T1                           = 00000001                 JPI$_OWNER                     = 00000303                 
BIT...                         = 00000103                 JPI$_PAGEFLTS                  = 0000040A                 
CHECK_PROCESS                    00000198 R     06        JPI$_PAGFILCNT                 = 00000414                 
ERRXIT                           0000008E R     06        JPI$_PAGFILLOC                 = 00000419                 
GETJPI_EFN                     = 00000002                 JPI$_PGFLQUOTA                 = 0000040E                 
GO_TO_SLEEP                      0000020D RG    06        JPI$_PID                       = 00000319                 
INIT_STRUCTURE                   00000097 RG    06        JPI$_PPGCNT                    = 0000030D                 
JPI$C_ADRTYPE                  = 00000001                 JPI$_PRCCNT                    = 0000031B                 
JPI$C_CTLTYPE                  = 00000002                 JPI$_PRCLM                     = 00000408                 
JPI$C_LISTEND                  = 00000000                 JPI$_PRCNAM                    = 0000031C                 
JPI$C_PCBTYPE                  = 00000003                 JPI$_PRI                       = 00000302                 
JPI$C_PHDTYPE                  = 00000004                 JPI$_PRIB                      = 00000309                 
JPI$_ACCOUNT                   = 00000203                 JPI$_PROCPRIV                  = 00000204                 
JPI$_APTCNT                    = 0000030A                 JPI$_SITESPEC                  = 00000208                 
JPI$_ASTACT                    = 00000300                 JPI$_STATE                     = 00000306                 
JPI$_ASTCNT                    = 0000030E                 JPI$_STS                       = 00000305                 
JPI$_ASTEN                     = 00000301                 JPI$_SWPFILLOC                 = 00000321                 
JPI$_ASTLM                     = 00000409                 JPI$_TERMINAL                  = 0000031D                 
JPI$_AUTHPRI                   = 00000418                 JPI$_TMBU                      = 0000030B                 
JPI$_AUTHPRIV                  = 00000412                 JPI$_TQCNT                     = 00000315                 
JPI$_BIOCNT                    = 0000030F                 JPI$_TQLM                      = 00000410                 
JPI$_BIOLM                     = 00000310                 JPI$_UIC                       = 00000304                 
JPI$_BUFIO                     = 0000040C                 JPI$_USERNAME                  = 00000202                 
JPI$_BYTCNT                    = 00000311                 JPI$_VIRTPEAK                  = 00000200                 
JPI$_BYTLM                     = 0000031A                 JPI$_VOLUMES                   = 00000205                 
JPI$_CPULIM                    = 0000040D                 JPI$_WSAUTH                    = 00000401                 
JPI$_CPUTIM                    = 00000407                 JPI$_WSAUTHEXT                 = 00000417                 
JPI$_CURPRIV                   = 00000400                 JPI$_WSEXTENT                  = 00000416                 
JPI$_DFPFC                     = 00000406                 JPI$_WSPEAK                    = 00000201                 
JPI$_DFWSCNT                   = 00000403                 JPI$_WSQUOTA                   = 00000402                 
JPI$_DIOCNT                    = 00000312                 JPI$_WSSIZE                    = 00000411                 
JPI$_DIOLM                     = 00000313                 JPI_BLOCK1                       00000000 R     04        
JPI$_DIRIO                     = 0000040B                 J_MESSY                          ********   X   06        
JPI$_EFCS                      = 00000317                 J_MESX                           ********   X   06        
JPI$_EFCU                      = 00000318                 LOW_PRIORITY                   = 00000003                 
JPI$_EFWM                      = 00000316                 L_CPUTIMADDR                   = 00000013 R     05        
JPI$_ENQCNT                    = 0000031F                 L_CPUTIMLENADDR                = 00000017 R     05        
JPI$_ENQLM                     = 00000320                 L_OWNERADDR                    = 0000000B R     05        
JPI$_EXCVEC                    = 00000100                 L_OWNERLENADDR                 = 0000000F R     05        
JPI$_FILCNT                    = 00000314                 L_PIDADDR                      = 0000001B R     05        
JPI$_FILLM                     = 0000040F                 L_PIDLENADDR                   = 0000001F R     05        
JPI$_FINALEXC                  = 00000101                 L_STATEADDR                    = 00000023 R     05        
JPI$_FREP0VA                   = 00000404                 L_STATELENADDR                 = 00000027 R     05        
JPI$_FREP1VA                   = 00000405                 L_TERMINALADDR                 = 00000000 R     05        
JPI$_FREPTECNT                 = 00000415                 L_TERMINALLENADDR              = 00000007 R     05        
JPI$_GPGCNT                    = 0000030C                 MAX_PROCESS                    = 00000100                 
JPI$_GRP                       = 00000308                 NORMAL_PRIORITY                = 00000004                 
JPI$_IMAGECOUNT                = 0000041A                 O_CPUTIM                       = 00000008                 
JPI$_IMAGNAME                  = 00000207                 O_DELCPUTIM                    = 0000000C                 
JPI$_IMAGPRIV                  = 00000413                 O_FILLER                       = 00000014                 
JPI$_JOBPRCCNT                 = 0000031E                 O_FLAG                         = 00000004                 
JPI$_LASTADR                   = 00000102                 O_LENGTH                       = 00000020                 
JPI$_LASTCTL                   = 00000209                 O_PID                          = 00000000                 
JPI$_LASTPCB                   = 00000322                 O_STATE                        = 00000010                 
JPI$_LASTPHD                   = 0000041B                 PID                              00000040 R     04        
JPI$_LOGINTIM                  = 00000206                 SCAN_PROCESS                     000000B9 RG    06        
JPI$_MEM                       = 00000307                 SCH$C_CEF                      = 00000003                 
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page  15
Symbol table                                                              3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

SCH$C_COLPG                    = 00000001                 
SCH$C_COM                      = 0000000C                 
SCH$C_COMO                     = 0000000D                 
SCH$C_CUR                      = 0000000E                 
SCH$C_FPG                      = 0000000B                 
SCH$C_HIB                      = 00000007                 
SCH$C_HIBO                     = 00000008                 
SCH$C_LEF                      = 00000005                 
SCH$C_LEFO                     = 00000006                 
SCH$C_MWAIT                    = 00000002                 
SCH$C_PFW                      = 00000004                 
SCH$C_SUSP                     = 00000009                 
SCH$C_SUSPO                    = 0000000A                 
SLEEP_EFN                      = 00000001                 
SLEEP_SECONDS                  = 00000004                 
SLEEP_TIME                       00000000 R     03        
SS$_NOMOREPROC                   ********   X   06        
SS$_NOPRIV                       ********   X   06        
SS$_SUSPENDED                    ********   X   06        
START                            00000000 RG    06        
SYS$EXIT                         ********  GX   06        
SYS$GETJPI                       ********  GX   06        
SYS$SETIMR                       ********  GX   06        
SYS$SETPRI                       ********  GX   06        
SYS$WAITFR                       ********  GX   06        
TMPCNT                         = 00000000                 
TMPDSD                         = 00000048 R     07        
USER_TABLE                       00000044 R     04        
VALID_TABLE                      00002044 R     04        
X_LOWPRIORITY                  = 00000001                 

                                                +----------------+
                                                ! Psect synopsis !
                                                +----------------+

PSECT name                      Allocation          PSECT No.  Attributes     
----------                      ----------          ---------  ----------     
.  ABS  .                       00000000  (    0.)  00 (  0.)  NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT NOVEC BYTE  
. BLANK .                       00000000  (    0.)  01 (  1.)  NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT NOVEC BYTE  
$ABS$                           00000000  (    0.)  02 (  2.)  NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT NOVEC BYTE  
P_DATA_RO                       00000008  (    8.)  03 (  3.)  NOPIC   USR   CON   REL   LCL NOSHR NOEXE   RD  NOWRT NOVEC BYTE  
P_DATA_RW                       00002444  ( 9284.)  04 (  4.)  NOPIC   USR   CON   REL   LCL NOSHR NOEXE   RD    WRT NOVEC BYTE  
P_JPI_RW                        0000002B  (   43.)  05 (  5.)  NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT NOVEC BYTE  
P_CODE_RO                       0000022F  (  559.)  06 (  6.)  NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD  NOWRT NOVEC BYTE  
P_MESSAGE                       00000063  (   99.)  07 (  7.)  NOPIC   USR   CON   REL   LCL NOSHR NOEXE   RD  NOWRT NOVEC BYTE  

                                             +------------------------+
                                             ! Performance indicators !
                                             +------------------------+

Phase                    Page faults    CPU Time       Elapsed Time   
-----                    -----------    --------       ------------   
Initialization                   24     00:00:00.05    00:00:00.49
Command processing               31     00:00:00.23    00:00:02.04
Pass 1                          216     00:00:05.48    00:00:16.86
Symbol table sort                 0     00:00:00.16    00:00:00.50
Pass 2                          121     00:00:01.51    00:00:03.76
ZEUS                            - CPU UTILIZATION MONITOR.               29-DEC-1982 16:13:46  VAX-11 Macro V03-00         Page  16
VAX-11 Macro Run Statistics                                               3-DEC-1982 10:04:30  ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.ZE(1)

Symbol table output              21     00:00:00.11    00:00:00.57
Psect synopsis output             5     00:00:00.04    00:00:00.20
Cross-reference output            0     00:00:00.00    00:00:00.00
Assembler run totals            421     00:00:07.61    00:00:24.43

The working set limit was 600 pages.
31152 bytes (61 pages) of virtual memory were used to buffer the intermediate code.
There were 10 pages of symbol table space allocated to hold 144 non-local and 21 local symbols.
469 source lines were read in Pass 1, producing 38 object records in Pass 2.
24 pages of virtual memory were used to define 23 macros.

                                            +--------------------------+
                                            ! Macro library statistics !
                                            +--------------------------+

Macro library name                           Macros defined      
------------------                           --------------      
ADM3:[VAX82B.VAX82B.DFWLUG.MEAD.LIB]CMNMLB.ML           4        
SYS$SYSROOT:[SYSLIB]LIB.MLB;1                           1        
SYS$SYSROOT:[SYSLIB]STARLET.MLB;1                      12        
TOTALS (all libraries)                                 17        

321 GETS were required to define 17 macros.

There were no errors, warnings or information messages.

/LIS=ZEUS/OBJ=ZEUS SYS$LIBRARY:LIB/LIB+LIB:CMNMLB/LIB+[VAX82B.VAX82B.DFWLUG.MEAD.ZEUS]ZEUS
