COMPILATION LISTING OF SEGMENT progress Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 02/06/84 1043.7 mst Mon Options: optimize map 1 /* ****************************************************** 2* * * 3* * * 4* * Copyright (c) 1972 by Massachusetts Institute of * 5* * Technology and Honeywell Information Systems, Inc. * 6* * * 7* * * 8* ****************************************************** */ 9 10 progress: 11 pg: 12 proc; 13 14 /* The progress command concatenates its arguments, and executes them as a command 15* line. While executing it, progress (pg) prints out the progress of the process - 16* the cpu time used since starting, and percent of real time. It also gives 17* an indication of paging activity (page faults per second of cpu time). 18* 19* Originally written Jan 1973 by Dan Bricklin. 20* Modified by M.A.Meer Oct 1975 to fix brief bug and allow long command lines. 21* Modified 761026 by PG to switch to iox_. 22**/ 23 24 25 dcl 26 addr builtin, 27 arg char (arglen) based (argp) unaligned, 28 arg_list_ptr ptr, 29 arglen fixed bin, 30 argno fixed bin, 31 argp ptr, 32 briefsw bit (1), 33 cleanup condition, 34 clock_ entry returns (fixed bin (71)), 35 code fixed bin (35), 36 com_err_ entry options (variable), 37 cpu_delta1 float bin, 38 cpu_delta2 float bin, 39 cpu_percent1 float bin, 40 cpu_percent2 float bin, 41 cpu_sw bit (1) int static init ("1"b), 42 cpu_time_and_paging_ entry (fixed bin, fixed bin (71), fixed bin), 43 cput1 fixed bin (71), 44 cput2 fixed bin (71), 45 cput3 fixed bin (71), 46 cu_$arg_list_ptr entry (ptr), 47 cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)), 48 cu_$arg_ptr_rel entry (fixed bin, ptr, fixed bin, fixed bin (35), ptr), 49 cu_$cp entry (ptr, fixed bin, fixed bin (35)), 50 cv_dec_check_ entry (char (*), fixed bin (35)) returns (fixed bin (35)), 51 divide builtin, 52 error_table_$badopt fixed bin (35) ext, 53 farg fixed bin, 54 i fixed bin, 55 io_switch ptr int static init (null), 56 ioa_$ioa_switch entry options (variable), 57 iox_$look_iocb entry (char (*), ptr, fixed bin (35)), 58 iox_$user_io ptr external static, 59 len fixed bin, 60 line char (256) init (" "), 61 line_len fixed bin, 62 max builtin, 63 null builtin, 64 on_sw bit (1) int static init ("1"b), 65 pf_per_sec float bin, 66 pf1 fixed bin, 67 pf2 fixed bin, 68 pf3 fixed bin, 69 pp1 fixed bin, 70 pp2 fixed bin, 71 pp3 fixed bin, 72 real_delta1 float bin, 73 real_delta2 float bin, 74 realt1 fixed bin (71), 75 realt2 fixed bin (71), 76 realt3 fixed bin (71), 77 (index, substr) builtin, 78 time_between_calls fixed bin (71) int static init (10000000), 79 timer_manager_$alarm_call entry (fixed bin (71), bit (2), entry), 80 timer_manager_$cpu_call entry (fixed bin (71), bit (2), entry), 81 timer_manager_$reset_alarm_call entry (entry), 82 timer_manager_$reset_cpu_call entry (entry); 83 84 /* program */ 85 86 briefsw = "0"b; /* we don't start in brief, usually */ 87 88 if io_switch = null 89 then io_switch = iox_$user_io; 90 91 call cu_$arg_ptr (1, argp, arglen, code); /* see if we have any options */ 92 if code = 0 then 93 if index (arg, "-") = 1 then do; 94 95 if arg = "-brief" | arg = "-bf" 96 then do; 97 briefsw = "1"b; 98 argno = 1; 99 go to common; 100 end; 101 102 if arg = "-increment" | arg = "-ic" then go to get_delta; 103 104 if arg = "-os" | arg = "-output_switch" | arg = "-output_stream" 105 then do; 106 call cu_$arg_ptr (2, argp, arglen, code); 107 if code ^= 0 108 then do; 109 call com_err_ (code, "progress", "Switchname missing."); 110 return; 111 end; 112 113 call iox_$look_iocb (arg, io_switch, code); 114 if code ^= 0 115 then do; 116 call com_err_ (code, "progress", "^a", arg); 117 return; 118 end; 119 return; 120 end; 121 122 if arg = "-on" 123 then do; 124 on_sw = "1"b; 125 return; 126 end; 127 128 if arg = "-off" 129 then do; 130 on_sw = "0"b; 131 return; 132 end; 133 134 if arg = "-cput" 135 then do; 136 cpu_sw = "1"b; 137 go to get_delta; 138 end; 139 140 if arg = "-realt" 141 then do; 142 cpu_sw = "0"b; 143 go to get_delta; 144 end; 145 146 call com_err_ (error_table_$badopt, "progress", arg); 147 return; 148 end; 149 150 argno = 0; 151 common: 152 on_sw = "1"b; /* print interval messages */ 153 154 on cleanup call cleanup_handler; /* what to do on cleanup */ 155 156 line_len = 0; 157 158 farg = argno + 1; /* keep index of first non option arg */ 159 160 loop: 161 argno = argno + 1; 162 call cu_$arg_ptr (argno, argp, arglen, code); 163 if code = 0 then do; 164 line_len = line_len + arglen + 1; 165 go to loop; 166 end; 167 168 169 call cu_$arg_list_ptr (arg_list_ptr); 170 171 begin; /* allow long line */ 172 173 dcl line char (line_len) aligned init (""); 174 175 len = 1; /* index to insert chars */ 176 do i = farg to argno - 1; 177 call cu_$arg_ptr_rel (i, argp, arglen, code, arg_list_ptr); 178 substr (line, len, arglen) = arg; 179 len = len + arglen + 1; 180 end; 181 182 call cpu_time_and_paging_ (pf1, cput1, pp1); /* get initial time values */ 183 realt1 = clock_ (); 184 185 pf2 = pf1; 186 cput2 = cput1; 187 pp2 = pp1; 188 realt2 = realt1; 189 190 if ^briefsw then 191 if cpu_sw then call timer_manager_$cpu_call (cput1 + time_between_calls, "00"b, interval); 192 else call timer_manager_$alarm_call (realt1 + time_between_calls, "00"b, interval); 193 194 call cu_$cp (addr (line), line_len, code); 195 196 if ^briefsw then 197 if cpu_sw then call timer_manager_$reset_cpu_call (interval); 198 else call timer_manager_$reset_alarm_call (interval); 199 200 call cpu_time_and_paging_ (pf3, cput3, pp3); 201 realt3 = clock_ (); 202 203 cpu_delta1 = float (cput3 - cput1)/1000000.0; 204 real_delta1 = float (realt3 - realt1)/1000000.0; 205 cpu_percent1 = float (100 * cpu_delta1)/real_delta1; 206 pf_per_sec = float (pf3 - pf1)/cpu_delta1; 207 208 call ioa_$ioa_switch (io_switch, "finished: ^.2f/^.2f = ^.2f% (^.2f (^f))", 209 cpu_delta1, real_delta1, cpu_percent1, pf_per_sec, pf3-pf1); 210 211 end; 212 213 return; 214 215 /* this option changes the time between calls */ 216 217 get_delta: 218 call cu_$arg_ptr (2, argp, arglen, code); 219 if code ^= 0 then do; 220 call com_err_ (code, "progress", "This argument is the time interval in seconds."); 221 return; 222 end; 223 224 i = cv_dec_check_ (arg, code); 225 if code ^= 0 then do; 226 call com_err_ (0, "progress", "Bad number: ^a", arg); 227 return; 228 end; 229 230 time_between_calls = 1000000 * i; 231 232 return; 233 234 cleanup_handler: 235 proc; 236 237 if cpu_sw then call timer_manager_$reset_cpu_call (interval); 238 else call timer_manager_$reset_alarm_call (interval); 239 240 return; 241 242 end; 243 244 interval: 245 proc; 246 247 call cpu_time_and_paging_ (pf3, cput3, pp3); 248 realt3 = clock_ (); 249 250 cpu_delta1 = float (cput3 - cput1)/1000000.0; 251 real_delta1 = float (realt3 - realt1)/1000000.0; 252 cpu_percent1 = float (100 * cpu_delta1)/real_delta1; 253 cpu_delta2 = float (cput3 - cput2)/1000000.0; 254 real_delta2 = float (realt3 - realt2)/1000000.0; 255 cpu_percent2 = float (100 * cpu_delta2)/real_delta2; 256 pf_per_sec = float (pf3 - pf2)/cpu_delta2; 257 258 if on_sw then call ioa_$ioa_switch (io_switch, "^.2f/^.2f = ^.2f%, ^.2f/^.2f = ^.2f% (^.2f (^f))", 259 cpu_delta1, real_delta1, cpu_percent1, cpu_delta2, real_delta2, cpu_percent2, 260 pf_per_sec, pf3-pf2); 261 262 cput2 = cput3; 263 pf2 = pf3; 264 realt2 = realt3; 265 pp2 = pp3; 266 267 if cpu_sw then call timer_manager_$cpu_call (cput3 + time_between_calls, "00"b, interval); 268 else call timer_manager_$alarm_call (realt3 + time_between_calls, "00"b, interval); 269 270 return; 271 272 end; 273 274 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 02/06/84 1041.6 progress.pl1 >spec>on>command_env>progress.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. addr builtin function dcl 25 ref 194 194 arg based char unaligned dcl 25 set ref 92 95 95 102 102 104 104 104 113* 116* 122 128 134 140 146* 178 224* 226* arg_list_ptr 000100 automatic pointer dcl 25 set ref 169* 177* arglen 000102 automatic fixed bin(17,0) dcl 25 set ref 91* 92 95 95 102 102 104 104 104 106* 113 113 116 116 122 128 134 140 146 146 162* 164 177* 178 178 179 217* 224 224 226 226 argno 000103 automatic fixed bin(17,0) dcl 25 set ref 98* 150* 158 160* 160 162* 176 argp 000104 automatic pointer dcl 25 set ref 91* 92 95 95 102 102 104 104 104 106* 113 116 122 128 134 140 146 162* 177* 178 217* 224 226 briefsw 000106 automatic bit(1) unaligned dcl 25 set ref 86* 97* 190 196 cleanup 000110 stack reference condition dcl 25 ref 154 clock_ 000020 constant entry external dcl 25 ref 183 201 248 code 000116 automatic fixed bin(35,0) dcl 25 set ref 91* 92 106* 107 109* 113* 114 116* 162* 163 177* 194* 217* 219 220* 224* 225 com_err_ 000022 constant entry external dcl 25 ref 109 116 146 220 226 cpu_delta1 000117 automatic float bin(27) dcl 25 set ref 203* 205 206 208* 250* 252 258* cpu_delta2 000120 automatic float bin(27) dcl 25 set ref 253* 255 256 258* cpu_percent1 000121 automatic float bin(27) dcl 25 set ref 205* 208* 252* 258* cpu_percent2 000122 automatic float bin(27) dcl 25 set ref 255* 258* cpu_sw 000010 internal static bit(1) initial unaligned dcl 25 set ref 136* 142* 190 196 237 267 cpu_time_and_paging_ 000024 constant entry external dcl 25 ref 182 200 247 cput1 000124 automatic fixed bin(71,0) dcl 25 set ref 182* 186 190 203 250 cput2 000126 automatic fixed bin(71,0) dcl 25 set ref 186* 253 262* cput3 000130 automatic fixed bin(71,0) dcl 25 set ref 200* 203 247* 250 253 262 267 cu_$arg_list_ptr 000026 constant entry external dcl 25 ref 169 cu_$arg_ptr 000030 constant entry external dcl 25 ref 91 106 162 217 cu_$arg_ptr_rel 000032 constant entry external dcl 25 ref 177 cu_$cp 000034 constant entry external dcl 25 ref 194 cv_dec_check_ 000036 constant entry external dcl 25 ref 224 error_table_$badopt 000040 external static fixed bin(35,0) dcl 25 set ref 146* farg 000132 automatic fixed bin(17,0) dcl 25 set ref 158* 176 i 000133 automatic fixed bin(17,0) dcl 25 set ref 176* 177* 224* 230 index builtin function dcl 25 ref 92 io_switch 000012 internal static pointer initial dcl 25 set ref 88 88* 113* 208* 258* ioa_$ioa_switch 000042 constant entry external dcl 25 ref 208 258 iox_$look_iocb 000044 constant entry external dcl 25 ref 113 iox_$user_io 000046 external static pointer dcl 25 ref 88 len 000134 automatic fixed bin(17,0) dcl 25 set ref 175* 178 179* 179 line 000135 automatic char(256) initial unaligned dcl 25 in procedure "pg" set ref 25* line 000100 automatic char initial dcl 173 in begin block on line 171 set ref 173* 178* 194 194 line_len 000235 automatic fixed bin(17,0) dcl 25 set ref 156* 164* 164 173 194* null builtin function dcl 25 ref 88 on_sw 000014 internal static bit(1) initial unaligned dcl 25 set ref 124* 130* 151* 258 pf1 000237 automatic fixed bin(17,0) dcl 25 set ref 182* 185 206 208 pf2 000240 automatic fixed bin(17,0) dcl 25 set ref 185* 256 258 263* pf3 000241 automatic fixed bin(17,0) dcl 25 set ref 200* 206 208 247* 256 258 263 pf_per_sec 000236 automatic float bin(27) dcl 25 set ref 206* 208* 256* 258* pp1 000242 automatic fixed bin(17,0) dcl 25 set ref 182* 187 pp2 000243 automatic fixed bin(17,0) dcl 25 set ref 187* 265* pp3 000244 automatic fixed bin(17,0) dcl 25 set ref 200* 247* 265 real_delta1 000245 automatic float bin(27) dcl 25 set ref 204* 205 208* 251* 252 258* real_delta2 000246 automatic float bin(27) dcl 25 set ref 254* 255 258* realt1 000250 automatic fixed bin(71,0) dcl 25 set ref 183* 188 192 204 251 realt2 000252 automatic fixed bin(71,0) dcl 25 set ref 188* 254 264* realt3 000254 automatic fixed bin(71,0) dcl 25 set ref 201* 204 248* 251 254 264 268 substr builtin function dcl 25 set ref 178* time_between_calls 000016 internal static fixed bin(71,0) initial dcl 25 set ref 190 192 230* 267 268 timer_manager_$alarm_call 000050 constant entry external dcl 25 ref 192 268 timer_manager_$cpu_call 000052 constant entry external dcl 25 ref 190 267 timer_manager_$reset_alarm_call 000054 constant entry external dcl 25 ref 198 238 timer_manager_$reset_cpu_call 000056 constant entry external dcl 25 ref 196 237 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. divide builtin function dcl 25 max builtin function dcl 25 NAMES DECLARED BY EXPLICIT CONTEXT. cleanup_handler 001334 constant entry internal dcl 234 ref 154 common 000505 constant label dcl 151 ref 99 get_delta 001166 constant label dcl 217 ref 102 137 143 interval 001371 constant entry internal dcl 244 ref 190 190 192 192 196 196 198 198 237 237 238 238 267 267 268 268 loop 000532 constant label dcl 160 ref 165 pg 000137 constant entry external dcl 10 progress 000147 constant entry external dcl 10 NAME DECLARED BY CONTEXT OR IMPLICATION. float builtin function ref 203 204 205 206 250 251 252 253 254 255 256 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2070 2150 1644 2100 Length 2364 1644 60 200 223 10 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME pg 222 external procedure is an external procedure. on unit on line 154 78 on unit begin block on line 171 122 begin block uses auto adjustable storage. cleanup_handler internal procedure shares stack frame of on unit on line 154. interval 130 internal procedure is assigned to an entry variable. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 cpu_sw pg 000012 io_switch pg 000014 on_sw pg 000016 time_between_calls pg STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME begin block on line 171 000100 line begin block on line 171 pg 000100 arg_list_ptr pg 000102 arglen pg 000103 argno pg 000104 argp pg 000106 briefsw pg 000116 code pg 000117 cpu_delta1 pg 000120 cpu_delta2 pg 000121 cpu_percent1 pg 000122 cpu_percent2 pg 000124 cput1 pg 000126 cput2 pg 000130 cput3 pg 000132 farg pg 000133 i pg 000134 len pg 000135 line pg 000235 line_len pg 000236 pf_per_sec pg 000237 pf1 pg 000240 pf2 pg 000241 pf3 pg 000242 pp1 pg 000243 pp2 pg 000244 pp3 pg 000245 real_delta1 pg 000246 real_delta2 pg 000250 realt1 pg 000252 realt2 pg 000254 realt3 pg THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. fx1_to_fl2 enter_begin leave_begin call_ext_out_desc call_ext_out return move_label_var make_label_var alloc_auto_adj enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. clock_ com_err_ cpu_time_and_paging_ cu_$arg_list_ptr cu_$arg_ptr cu_$arg_ptr_rel cu_$cp cv_dec_check_ ioa_$ioa_switch iox_$look_iocb timer_manager_$alarm_call timer_manager_$cpu_call timer_manager_$reset_alarm_call timer_manager_$reset_cpu_call THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt iox_$user_io LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 25 000131 10 000136 86 000155 88 000156 91 000166 92 000204 95 000222 97 000232 98 000234 99 000236 102 000237 104 000247 106 000263 107 000302 109 000304 110 000332 113 000333 114 000357 116 000361 117 000415 119 000416 122 000417 124 000423 125 000426 128 000427 130 000433 131 000435 134 000436 136 000442 137 000445 140 000446 142 000452 143 000454 146 000455 147 000503 150 000504 151 000505 154 000510 156 000526 158 000527 160 000532 162 000533 163 000550 164 000552 165 000556 169 000557 171 000566 173 000571 175 000605 176 000607 177 000620 178 000637 179 000647 180 000653 182 000655 183 000670 185 000700 186 000703 187 000705 188 000707 190 000711 192 000743 194 000767 196 001005 198 001027 200 001042 201 001056 203 001066 204 001077 205 001107 206 001113 208 001120 211 001164 213 001165 217 001166 219 001205 220 001207 221 001235 224 001236 225 001263 226 001265 227 001326 230 001327 232 001333 234 001334 237 001335 238 001354 240 001367 244 001370 247 001376 248 001411 250 001421 251 001432 252 001442 253 001446 254 001456 255 001466 256 001472 258 001477 262 001556 263 001561 264 001563 265 001565 267 001567 268 001617 270 001643 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved