COMPILATION LISTING OF SEGMENT display_subsystem_usage Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 02/26/86 1007.5 mst Wed Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 7 /* format: on,style4,delnl,insnl,ifthenstmt,ifthen */ 8 9 /* Display the usage statistics recorded by ssu_ for a given subsystem */ 10 11 12 /****^ HISTORY COMMENTS: 13* 1) change(81-09-01,Palter), approve(), audit(), 14* install(86-02-26,MR12.0-1026): 15* Initial coding: primitive version without selection cabalities on user names 16* 2) change(81-11-02,Sibert), approve(), audit(), 17* install(86-02-26,MR12.0-1026): 18* to change suffix to ".ssusage". 19* 3) change(82-01-21,Palter), approve(), audit(), 20* install(86-02-26,MR12.0-1026): 21* to use a reference name to find the usage segment in most cases, accept 22* -first N and -user star_name, and remove the short command name (sigh). 23* 4) change(82-12-15,Pattin), approve(), audit(), 24* install(86-02-26,MR12.0-1026): 25* to add -version, version sort type, and improve totals processing. 26* 5) change(82-12-16,Palter), approve(), audit(), 27* install(86-02-26,MR12.0-1026): 28* to allow -totals to be used with -user and -version and to allow 29* -first N to be used with -user. 30* 6) change(83-10-18,Palter), approve(), audit(), 31* install(86-02-26,MR12.0-1026): 32* to allow matching by starname for the version. 33* 7) change(86-02-12,Newcomb), approve(86-02-12,MCR7335), 34* audit(86-02-13,Margolin), install(86-02-26,MR12.0-1026): 35* Upgraded to use (initiate terminate)_file_ and date_time_$format. 36* END HISTORY COMMENTS */ 37 38 39 display_subsystem_usage: 40 procedure () options (variable); 41 42 43 dcl argument character (argument_lth) based (argument_ptr); 44 dcl argument_lth fixed binary (21); 45 dcl argument_ptr pointer; 46 47 dcl system_area area based (system_area_ptr); 48 dcl system_area_ptr pointer; 49 50 dcl 1 field_ptrs aligned based (field_ptrs_ptr), 51 2 n_ptrs fixed binary, 52 2 ptr (usage_seg.count refer (field_ptrs.n_ptrs)) pointer unaligned; 53 dcl field_ptrs_ptr pointer; 54 55 dcl 1 idxs aligned based (idxs_ptr), 56 2 n_idxs fixed binary, 57 2 idx (usage_seg.count refer (idxs.n_idxs)) fixed binary; 58 dcl idxs_ptr pointer; 59 60 dcl n_arguments fixed binary; 61 62 dcl (have_usage_seg, found_by_refname, header, totals_only, sort_by_name, sort_by_count, sort_by_dtu, sort_by_version, 63 reverse_sw) bit (1) aligned; 64 65 dcl usage_seg_dirname character (168); 66 dcl (subsystem_name, usage_seg_ename) character (32); 67 68 dcl user_name character (32); 69 dcl version_wanted character (32); 70 dcl first_n fixed binary; 71 dcl (selected_users, selected_count, selected_version_count) fixed binary; 72 73 dcl code fixed binary (35); 74 dcl idx fixed binary; 75 76 dcl DISPLAY_SUBSYSTEM_USAGE character (32) static options (constant) initial ("display_subsystem_usage"); 77 78 dcl USAGE_SUFFIX character (7) static options (constant) initial ("ssusage"); 79 80 dcl HEADER_FORMAT character (76) static options (constant) 81 initial ("^/^33tTotal^52tLast Version Used^/^11tUser^33tUsage^47tUsage^59tDate^70tID^/"); 82 dcl USER_FORMAT character (34) static options (constant) initial ("^24a^29t^9d^43t^9d^53t(^14a)^70t^a"); 83 dcl TOTALS_FORMAT character (68) static options (constant) 84 initial ("^6tTotal (^d users):^29t^9d^[^43t^9d^;^s^]^[^vt^a^;^2s^]^[^70t^a^]^/"); 85 86 /* format: off */ 87 dcl (error_table_$badopt, error_table_$inconsistent, error_table_$noarg) 88 fixed binary (35) external; 89 /* format: on */ 90 91 dcl check_star_name_$entry entry (character (*), fixed binary (35)); 92 dcl com_err_ entry () options (variable); 93 dcl com_err_$suppress_name entry () options (variable); 94 dcl cu_$arg_count entry (fixed binary, fixed binary (35)); 95 dcl cu_$arg_ptr entry (fixed binary, pointer, fixed binary (21), fixed binary (35)); 96 dcl cv_dec_check_ entry (character (*), fixed binary (35)) returns (fixed binary (35)); 97 dcl decode_clock_value_$format entry (char(*), fixed bin(71), char(*), char(*)) returns(char(250) var); 98 dcl expand_pathname_$add_suffix entry (character (*), character (*), character (*), character (*), fixed binary (35)); 99 dcl get_system_free_area_ entry () returns (pointer); 100 dcl hcs_$fs_get_path_name entry (pointer, character (*), fixed binary, character (*), fixed binary (35)); 101 dcl hcs_$make_ptr entry (pointer, character (*), character (*), pointer, fixed binary (35)); 102 dcl initiate_file_ entry (char(*), char(*), bit(*), ptr, fixed bin(24), fixed bin(35)); 103 dcl ioa_ entry () options (variable); 104 dcl match_star_name_ entry (character (*), character (*), fixed binary (35)); 105 dcl pathname_ entry (character (*), character (*)) returns (character (168)); 106 dcl sort_items_indirect_$bit entry (pointer, pointer, fixed binary (24)); 107 dcl sort_items_indirect_$char entry (pointer, pointer, fixed binary (24)); 108 dcl sort_items_indirect_$fixed_bin entry (pointer, pointer); 109 dcl terminate_file_ entry (ptr, fixed bin(24), bit(*), fixed bin(35)); 110 111 dcl (addr, fixed, index, length, max, null, rtrim, search, substr, unspec) builtin; 112 113 dcl cleanup condition; 114 115 /* display_subsystem_usage: entry () options (variable); */ 116 117 call cu_$arg_count (n_arguments, code); 118 if code ^= 0 then do; /* not called as a command */ 119 call com_err_ (code, DISPLAY_SUBSYSTEM_USAGE); 120 return; 121 end; 122 123 if n_arguments = 0 then do; 124 PRINT_USAGE_MESSAGE: 125 call com_err_$suppress_name (0, DISPLAY_SUBSYSTEM_USAGE, 126 "Usage: display_subsystem_usage subsystem_name {-control_args}"); 127 return; 128 end; 129 130 system_area_ptr = get_system_free_area_ (); 131 132 usage_seg_ptr, /* for cleanup handler */ 133 field_ptrs_ptr, idxs_ptr = null (); 134 135 on condition (cleanup) call clean_up (); 136 137 138 /* Scan the arguments */ 139 140 have_usage_seg = "0"b; /* no pathname yet */ 141 142 header = "1"b; /* print header by default */ 143 totals_only = "0"b; /* ... and dump all the users */ 144 sort_by_name, sort_by_count, /* ... no sorting by default */ 145 sort_by_dtu, sort_by_version = "0"b; 146 reverse_sw = "0"b; /* ... in the default order */ 147 version_wanted, user_name = ""; /* ... don't select any particular entries */ 148 first_n = -1; /* ... and print all the entries */ 149 150 151 do idx = 1 to n_arguments; 152 153 call cu_$arg_ptr (idx, argument_ptr, argument_lth, (0)); 154 155 if index (argument, "-") = 1 then 156 if (argument = "-totals") | (argument = "-tt") then totals_only = "1"b; 157 158 else if (argument = "-header") | (argument = "-he") then header = "1"b; 159 160 else if (argument = "-no_header") | (argument = "-nhe") then header = "0"b; 161 162 else if (argument = "-reverse") | (argument = "-rv") then reverse_sw = "1"b; 163 164 else if (argument = "-no_reverse") | (argument = "-nrv") then reverse_sw = "0"b; 165 166 else if argument = "-sort" then do; /* sorting control: by name, count, version, date_time_used */ 167 idx = idx + 1; /* needs the sorting type */ 168 if idx > n_arguments then do; 169 call com_err_ (error_table_$noarg, DISPLAY_SUBSYSTEM_USAGE, 170 """-sort"" must be followed by ""name"", ""count"", ""date_time_used"", or ""version""") 171 ; 172 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 173 end; 174 call cu_$arg_ptr (idx, argument_ptr, argument_lth, (0)); 175 if argument = "name" then sort_by_name = "1"b; 176 else if argument = "count" then sort_by_count = "1"b; 177 else if (argument = "date_time_used") | (argument = "dtu") then sort_by_dtu = "1"b; 178 else if argument = "version" then sort_by_version = "1"b; 179 else do; /* unknown sort */ 180 call com_err_ (0, DISPLAY_SUBSYSTEM_USAGE, 181 """-sort"" must be followed by ""name"", ""count"", ""date_time_used"", or ""version""; not ""^a""", 182 argument); 183 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 184 end; 185 end; 186 187 else if argument = "-user" then do; /* select entries by user name */ 188 idx = idx + 1; 189 if idx > n_arguments then do; 190 call com_err_ (error_table_$noarg, DISPLAY_SUBSYSTEM_USAGE, 191 """-user"" must be followed by a star name."); 192 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 193 end; 194 call cu_$arg_ptr (idx, argument_ptr, argument_lth, (0)); 195 call check_star_name_$entry (argument, code); 196 if (code ^= 0) & (code ^= 1) & (code ^= 2) then do; 197 call com_err_ (code, DISPLAY_SUBSYSTEM_USAGE, "-user ^a", argument); 198 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 199 end; 200 user_name = argument; 201 end; 202 203 else if argument = "-version" then do; /* print only those whose current version is selected */ 204 idx = idx + 1; 205 if idx > n_arguments then do; 206 call com_err_ (error_table_$noarg, DISPLAY_SUBSYSTEM_USAGE, 207 """-version"" must be followed by a version string."); 208 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 209 end; 210 call cu_$arg_ptr (idx, argument_ptr, argument_lth, (0)); 211 call check_star_name_$entry (argument, code); 212 if (code ^= 0) & (code ^= 1) & (code ^= 2) then do; 213 call com_err_ (code, DISPLAY_SUBSYSTEM_USAGE, "-version ^a", argument); 214 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 215 end; 216 version_wanted = argument; 217 end; 218 219 else if (argument = "-first") | (argument = "-ft") then do; 220 /* print only a subset of the entries */ 221 idx = idx + 1; 222 if idx > n_arguments then do; 223 call com_err_ (error_table_$noarg, DISPLAY_SUBSYSTEM_USAGE, 224 """-first"" must be followed by a number."); 225 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 226 end; 227 call cu_$arg_ptr (idx, argument_ptr, argument_lth, (0)); 228 first_n = cv_dec_check_ (argument, code); 229 if code ^= 0 then do; 230 BAD_FIRST_N_VALUE: 231 call com_err_ (0, DISPLAY_SUBSYSTEM_USAGE, 232 """-first"" must be followed by a positive number; not ""^a"".", argument); 233 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 234 end; 235 if first_n < 0 then go to BAD_FIRST_N_VALUE; 236 end; 237 238 else do; /* invalid control argument */ 239 call com_err_ (error_table_$badopt, DISPLAY_SUBSYSTEM_USAGE, """^a""", argument); 240 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 241 end; 242 243 else /* not a control argument: must identify the subsystem */ 244 if have_usage_seg then /* ... but already have the segment */ 245 go to PRINT_USAGE_MESSAGE; 246 247 else do; /* first subsystem name */ 248 have_usage_seg = "1"b; 249 call expand_pathname_$add_suffix (argument, USAGE_SUFFIX, usage_seg_dirname, usage_seg_ename, code); 250 if code ^= 0 then do; 251 call com_err_ (code, DISPLAY_SUBSYSTEM_USAGE, "^a", argument); 252 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 253 end; 254 subsystem_name = 255 substr (usage_seg_ename, 1, (length (rtrim (usage_seg_ename)) - length (USAGE_SUFFIX) - 1)); 256 if search (argument, "<>") ^= 0 then do; 257 found_by_refname = "0"b; /* by pathname */ 258 call initiate_file_ (usage_seg_dirname, usage_seg_ename, RW_ACCESS, usage_seg_ptr, (0) /* ignore bit count */, code); 259 if usage_seg_ptr = null () then do; 260 call com_err_ (code, DISPLAY_SUBSYSTEM_USAGE, "^a", 261 pathname_ (usage_seg_dirname, usage_seg_ename)); 262 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 263 end; 264 end; 265 else do; /* a reference name */ 266 found_by_refname = "1"b; 267 call hcs_$make_ptr (null (), usage_seg_ename, "", usage_seg_ptr, code); 268 if code ^= 0 then do; 269 call com_err_ (code, DISPLAY_SUBSYSTEM_USAGE, "^a", usage_seg_ename); 270 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 271 end; 272 call hcs_$fs_get_path_name (usage_seg_ptr, usage_seg_dirname, (0), ((32)" "), (0)); 273 end; 274 end; 275 end; 276 277 if ^have_usage_seg then go to PRINT_USAGE_MESSAGE; 278 279 if (fixed (sort_by_name, 1) + fixed (sort_by_dtu, 1) + fixed (sort_by_count, 1) + fixed (sort_by_version, 1)) 280 > 1 then do; /* just one type of sort, please */ 281 call com_err_ (error_table_$inconsistent, DISPLAY_SUBSYSTEM_USAGE, 282 "^[""-sort name"" and ^]^[""-sort count""^]^[ and ^]^[""-sort date_time_used""^]^[ and ^]^[""-sort version""^]", 283 sort_by_name, sort_by_count, (sort_by_count & (sort_by_dtu | sort_by_version)), sort_by_dtu, 284 (sort_by_dtu & sort_by_version), sort_by_version); 285 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 286 end; 287 288 if totals_only & (sort_by_name | sort_by_count | sort_by_dtu | sort_by_version) then do; 289 /* can't sort the totals */ 290 call com_err_ (error_table_$inconsistent, DISPLAY_SUBSYSTEM_USAGE, 291 """-totals"" and ""-sort ^[name^]^[count^]^[date_time_used^]^[version^]""", sort_by_name, 292 sort_by_count, sort_by_dtu, sort_by_version); 293 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 294 end; 295 296 if totals_only & (first_n > 0) then do; /* can't split the totals */ 297 call com_err_ (error_table_$inconsistent, DISPLAY_SUBSYSTEM_USAGE, """-totals"" and ""-first ^d""", 298 first_n); 299 go to RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE; 300 end; 301 302 if sort_by_count | sort_by_dtu then /* invert the reverse flag to get largest counts ... */ 303 reverse_sw = ^reverse_sw; /* ... or most recent usage first by default */ 304 305 306 /* Setup the array of indices into the segment used to control the order of individual entries printed and sort the array 307* if requested */ 308 309 if ^totals_only then do; /* don't bother if just giving total usage */ 310 311 allocate field_ptrs in (system_area) set (field_ptrs_ptr); 312 allocate idxs in (system_area) set (idxs_ptr); 313 314 do idx = 1 to usage_seg.count; 315 idxs.idx (idx) = idx; 316 if sort_by_name then /* sorting by name */ 317 field_ptrs.ptr (idx) = addr (usage_seg.user (idx).name); 318 else if sort_by_count then /* sorting by count */ 319 field_ptrs.ptr (idx) = addr (usage_seg.user (idx).total_count); 320 else if sort_by_dtu then /* sorting by last date-time used */ 321 field_ptrs.ptr (idx) = addr (usage_seg.user (idx).last_time); 322 else if sort_by_version then field_ptrs.ptr (idx) = addr (usage_seg.user (idx).version); 323 end; 324 325 if sort_by_name then 326 call sort_items_indirect_$char (field_ptrs_ptr, idxs_ptr, length (usage_seg.user (1).name)); 327 else if sort_by_count then call sort_items_indirect_$fixed_bin (field_ptrs_ptr, idxs_ptr); 328 else if sort_by_dtu then /* (sigh): assumes no date/time used is negative ... */ 329 call sort_items_indirect_$bit (field_ptrs_ptr, idxs_ptr, 330 length (unspec (usage_seg.user (1).last_time))); 331 else if sort_by_version then 332 call sort_items_indirect_$char (field_ptrs_ptr, idxs_ptr, length (usage_seg.user (1).version)); 333 end; 334 335 336 /* Print the header if desired */ 337 338 if header then do; 339 call ioa_ ("^/^-^a Usage (in directory ^a)^/", subsystem_name, usage_seg_dirname); 340 call ioa_ (HEADER_FORMAT); 341 end; 342 343 selected_users, selected_count, selected_version_count = 0; 344 345 346 /* Print the individual entries */ 347 348 if first_n = -1 then first_n = usage_seg.count; /* user wants all the entries */ 349 350 if totals_only & ((user_name ^= "") | (version_wanted ^= "")) then do; 351 do idx = 1 to usage_seg.count; /* count only the selected entries */ 352 call print_entry ("0"b, idx); 353 end; 354 end; 355 356 else if ^totals_only then /* print the requested entries ... */ 357 if reverse_sw then do; /* ... in reverse order */ 358 do idx = usage_seg.count to 1 by -1; 359 call print_entry ((selected_users < first_n), idxs.idx (idx)); 360 end; 361 end; 362 363 else do; /* ... in "normal" order */ 364 do idx = 1 to usage_seg.count; 365 call print_entry ((selected_users < first_n), idxs.idx (idx)); 366 end; 367 end; 368 369 370 /* Print the total usage */ 371 372 if ^totals_only then /* a bit more whitespace please */ 373 call ioa_ (""); 374 375 376 if (user_name = "") & (version_wanted = "") then do; 377 selected_users = usage_seg.count; /* no selection criteria: give totals for all users */ 378 selected_count = usage_seg.all.total_count; 379 end; 380 381 call ioa_ (TOTALS_FORMAT, selected_users, selected_count, (version_wanted ^= ""), selected_version_count, 382 ^header, max (53, (70 - length (rtrim (subsystem_name)) - 1)), subsystem_name, (version_wanted ^= ""), 383 version_wanted); 384 385 386 RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE: 387 call clean_up (); 388 389 return; 390 391 /* Print the usage data for a single user */ 392 393 print_entry: 394 procedure (print_switch, p_idx); 395 396 dcl p_idx fixed binary parameter; 397 dcl print_switch bit (1) aligned parameter; 398 399 dcl 1 use aligned based (usep) like usage_seg_entry; 400 dcl usep pointer; 401 dcl code fixed binary (35); 402 403 usep = addr (usage_seg.user (p_idx)); 404 405 if version_wanted = "" then 406 code = 0; /* match any version */ 407 else call match_star_name_ ((use.version), version_wanted, code); 408 if code ^= 0 then return; 409 410 if user_name = "" then 411 code = 0; /* match any entry */ 412 else call match_star_name_ ((use.name), user_name, code); 413 if code ^= 0 then return; 414 415 selected_users = selected_users + 1; 416 selected_count = selected_count + use.total_count; 417 selected_version_count = selected_version_count + use.this_version_count; 418 419 if print_switch then 420 call ioa_ (USER_FORMAT, use.name, use.total_count, use.this_version_count, decode_clock_value_$format ("^my/^dm/^yc ^Hd:^MH", use.last_time, "" /* per-process zone */, "" /* per-process language */), 421 use.version); 422 423 return; 424 425 end print_entry; 426 427 /* Clean up after ourselves */ 428 429 clean_up: 430 procedure (); 431 432 if usage_seg_ptr ^= null () then /* only if we explicitly initiated it... */ 433 if ^found_by_refname then call terminate_file_ (usage_seg_ptr, 0 /* not set */, TERM_FILE_TERM, (0)); 434 435 if field_ptrs_ptr ^= null () then free field_ptrs in (system_area); 436 437 if idxs_ptr ^= null () then free idxs in (system_area); 438 439 return; 440 441 end clean_up; 442 1 1 /* BEGIN INCLUDE FILE ... _ssu_usage_seg.incl.pl1 */ 1 2 /* Created: by W. Olin Sibert */ 1 3 1 4 /* format: style4,delnl,insnl,ifthenstmt,ifthen */ 1 5 1 6 1 7 /* Description of the segment recording usage of a subsystem */ 1 8 1 9 dcl 1 usage_seg aligned based (usage_seg_ptr), 1 10 2 version fixed binary, /* version */ 1 11 2 count fixed binary, /* how many users are recorded herein */ 1 12 2 write_word fixed binary (35), /* a word to try writing into, to cause a fault */ 1 13 2 pad1 (13) bit (36), 1 14 2 hash_table (0:126) fixed binary (18), /* unused */ 1 15 2 use_hash_table bit (1) aligned, /* ON => above hash table is usable */ 1 16 2 all aligned like usage_seg_entry, /* entry to record usage for all users */ 1 17 2 user (0 refer (usage_seg.count)) aligned like usage_seg_entry; 1 18 1 19 dcl usage_seg_ptr pointer; 1 20 1 21 dcl USAGE_SEG_MAX_ENTRIES fixed binary static options (constant) initial (5427); 1 22 /* maximum number of entries, minus 10 for safety */ 1 23 1 24 dcl USAGE_SEG_VERSION_1 fixed binary static options (constant) initial (1); 1 25 dcl USAGE_SEG_VERSION fixed binary static options (constant) initial (1); 1 26 1 27 1 28 /* Data recorded for each individual user of the subsystem */ 1 29 1 30 dcl 1 usage_seg_entry aligned based, 1 31 2 name character (24), /* name of user */ 1 32 2 first_time fixed binary (71), /* first time she's used the subsystem */ 1 33 2 last_time fixed binary (71), /* most recent time */ 1 34 2 version character (32), /* most recent version she's used */ 1 35 2 total_count fixed binary (35), /* total number of usages */ 1 36 2 this_version_count fixed binary (35), /* number of times for current version */ 1 37 2 this_version_blast fixed binary (35), /* number of times she's been blasted */ 1 38 2 hash_thread fixed binary (18), /* hash table thread; not presently used */ 1 39 2 pad1 (2) bit (36); /* pad to 48 words */ 1 40 1 41 /* END INCLUDE FILE ... _ssu_usage_seg.incl.pl1 */ 443 444 2 1 /* BEGIN INCLUDE FILE ... access_mode_values.incl.pl1 2 2* 2 3* Values for the "access mode" argument so often used in hardcore 2 4* James R. Davis 26 Jan 81 MCR 4844 2 5* Added constants for SM access 4/28/82 Jay Pattin 2 6* Added text strings 03/19/85 Chris Jones 2 7**/ 2 8 2 9 2 10 /* format: style4,delnl,insnl,indattr,ifthen,dclind10 */ 2 11 dcl ( 2 12 N_ACCESS init ("000"b), 2 13 R_ACCESS init ("100"b), 2 14 E_ACCESS init ("010"b), 2 15 W_ACCESS init ("001"b), 2 16 RE_ACCESS init ("110"b), 2 17 REW_ACCESS init ("111"b), 2 18 RW_ACCESS init ("101"b), 2 19 S_ACCESS init ("100"b), 2 20 M_ACCESS init ("010"b), 2 21 A_ACCESS init ("001"b), 2 22 SA_ACCESS init ("101"b), 2 23 SM_ACCESS init ("110"b), 2 24 SMA_ACCESS init ("111"b) 2 25 ) bit (3) internal static options (constant); 2 26 2 27 /* The following arrays are meant to be accessed by doing either 1) bin (bit_value) or 2 28* 2) divide (bin_value, 2) to come up with an index into the array. */ 2 29 2 30 dcl SEG_ACCESS_MODE_NAMES (0:7) init ("null", "W", "E", "EW", "R", "RW", "RE", "REW") char (4) internal 2 31 static options (constant); 2 32 2 33 dcl DIR_ACCESS_MODE_NAMES (0:7) init ("null", "A", "M", "MA", "S", "SA", "SM", "SMA") char (4) internal 2 34 static options (constant); 2 35 2 36 dcl ( 2 37 N_ACCESS_BIN init (00000b), 2 38 R_ACCESS_BIN init (01000b), 2 39 E_ACCESS_BIN init (00100b), 2 40 W_ACCESS_BIN init (00010b), 2 41 RW_ACCESS_BIN init (01010b), 2 42 RE_ACCESS_BIN init (01100b), 2 43 REW_ACCESS_BIN init (01110b), 2 44 S_ACCESS_BIN init (01000b), 2 45 M_ACCESS_BIN init (00010b), 2 46 A_ACCESS_BIN init (00001b), 2 47 SA_ACCESS_BIN init (01001b), 2 48 SM_ACCESS_BIN init (01010b), 2 49 SMA_ACCESS_BIN init (01011b) 2 50 ) fixed bin (5) internal static options (constant); 2 51 2 52 /* END INCLUDE FILE ... access_mode_values.incl.pl1 */ 445 446 3 1 /* BEGIN INCLUDE FILE ... terminate_file.incl.pl1 */ 3 2 /* format: style2,^inddcls,idind32 */ 3 3 3 4 declare 1 terminate_file_switches based, 3 5 2 truncate bit (1) unaligned, 3 6 2 set_bc bit (1) unaligned, 3 7 2 terminate bit (1) unaligned, 3 8 2 force_write bit (1) unaligned, 3 9 2 delete bit (1) unaligned; 3 10 3 11 declare TERM_FILE_TRUNC bit (1) internal static options (constant) initial ("1"b); 3 12 declare TERM_FILE_BC bit (2) internal static options (constant) initial ("01"b); 3 13 declare TERM_FILE_TRUNC_BC bit (2) internal static options (constant) initial ("11"b); 3 14 declare TERM_FILE_TERM bit (3) internal static options (constant) initial ("001"b); 3 15 declare TERM_FILE_TRUNC_BC_TERM bit (3) internal static options (constant) initial ("111"b); 3 16 declare TERM_FILE_FORCE_WRITE bit (4) internal static options (constant) initial ("0001"b); 3 17 declare TERM_FILE_DELETE bit (5) internal static options (constant) initial ("00001"b); 3 18 3 19 /* END INCLUDE FILE ... terminate_file.incl.pl1 */ 447 448 449 end display_subsystem_usage; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 02/26/86 1007.6 display_subsystem_usage.pl1 >spec>install>1026>display_subsystem_usage.pl1 443 1 04/13/82 1620.2 _ssu_usage_seg.incl.pl1 >ldd>include>_ssu_usage_seg.incl.pl1 445 2 04/11/85 1452.6 access_mode_values.incl.pl1 >ldd>include>access_mode_values.incl.pl1 447 3 04/06/83 1239.4 terminate_file.incl.pl1 >ldd>include>terminate_file.incl.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. DISPLAY_SUBSYSTEM_USAGE 000062 constant char(32) initial unaligned dcl 76 set ref 119* 124* 169* 180* 190* 197* 206* 213* 223* 230* 239* 251* 260* 269* 281* 290* 297* HEADER_FORMAT 000034 constant char(76) initial unaligned dcl 80 set ref 340* RW_ACCESS 000001 constant bit(3) initial unaligned dcl 2-11 set ref 258* TERM_FILE_TERM 000000 constant bit(3) initial unaligned dcl 3-14 set ref 432* TOTALS_FORMAT 000002 constant char(68) initial unaligned dcl 83 set ref 381* USAGE_SUFFIX 000060 constant char(7) initial unaligned dcl 78 set ref 249* 254 USER_FORMAT 000023 constant char(34) initial unaligned dcl 82 set ref 419* addr builtin function dcl 111 ref 316 318 320 322 403 all 220 based structure level 2 dcl 1-9 argument based char unaligned dcl 43 set ref 155 155 155 158 158 160 160 162 162 164 164 166 175 176 177 177 178 180* 187 195* 197* 200 203 211* 213* 216 219 219 228* 230* 239* 249* 251* 256 argument_lth 000100 automatic fixed bin(21,0) dcl 44 set ref 153* 155 155 155 158 158 160 160 162 162 164 164 166 174* 175 176 177 177 178 180 180 187 194* 195 195 197 197 200 203 210* 211 211 213 213 216 219 219 227* 228 228 230 230 239 239 249 249 251 251 256 argument_ptr 000102 automatic pointer dcl 45 set ref 153* 155 155 155 158 158 160 160 162 162 164 164 166 174* 175 176 177 177 178 180 187 194* 195 197 200 203 210* 211 213 216 219 219 227* 228 230 239 249 251 256 check_star_name_$entry 000016 constant entry external dcl 91 ref 195 211 cleanup 000244 stack reference condition dcl 113 ref 135 code 000242 automatic fixed bin(35,0) dcl 73 in procedure "display_subsystem_usage" set ref 117* 118 119* 195* 196 196 196 197* 211* 212 212 212 213* 228* 229 249* 250 251* 258* 260* 267* 268 269* code 000270 automatic fixed bin(35,0) dcl 401 in procedure "print_entry" set ref 405* 407* 408 410* 412* 413 com_err_ 000020 constant entry external dcl 92 ref 119 169 180 190 197 206 213 223 230 239 251 260 269 281 290 297 com_err_$suppress_name 000022 constant entry external dcl 93 ref 124 count 1 based fixed bin(17,0) level 2 dcl 1-9 ref 311 311 312 312 314 348 351 358 364 377 cu_$arg_count 000024 constant entry external dcl 94 ref 117 cu_$arg_ptr 000026 constant entry external dcl 95 ref 153 174 194 210 227 cv_dec_check_ 000030 constant entry external dcl 96 ref 228 decode_clock_value_$format 000032 constant entry external dcl 97 ref 419 error_table_$badopt 000010 external static fixed bin(35,0) dcl 87 set ref 239* error_table_$inconsistent 000012 external static fixed bin(35,0) dcl 87 set ref 281* 290* 297* error_table_$noarg 000014 external static fixed bin(35,0) dcl 87 set ref 169* 190* 206* 223* expand_pathname_$add_suffix 000034 constant entry external dcl 98 ref 249 field_ptrs based structure level 1 dcl 50 set ref 311 435 field_ptrs_ptr 000106 automatic pointer dcl 53 set ref 132* 311* 316 318 320 322 325* 327* 328* 331* 435 435 first_n 000236 automatic fixed bin(17,0) dcl 70 set ref 148* 228* 235 296 297* 348 348* 359 365 fixed builtin function dcl 111 ref 279 279 279 279 found_by_refname 000114 automatic bit(1) dcl 62 set ref 257* 266* 432 get_system_free_area_ 000036 constant entry external dcl 99 ref 130 have_usage_seg 000113 automatic bit(1) dcl 62 set ref 140* 243 248* 277 hcs_$fs_get_path_name 000040 constant entry external dcl 100 ref 272 hcs_$make_ptr 000042 constant entry external dcl 101 ref 267 header 000115 automatic bit(1) dcl 62 set ref 142* 158* 160* 338 381 idx 1 based fixed bin(17,0) array level 2 in structure "idxs" dcl 55 in procedure "display_subsystem_usage" set ref 315* 359* 365* idx 000243 automatic fixed bin(17,0) dcl 74 in procedure "display_subsystem_usage" set ref 151* 153* 167* 167 168 174* 188* 188 189 194* 204* 204 205 210* 221* 221 222 227* 314* 315 315 316 316 318 318 320 320 322 322* 351* 352* 358* 359* 364* 365* idxs based structure level 1 dcl 55 set ref 312 437 idxs_ptr 000110 automatic pointer dcl 58 set ref 132* 312* 315 325* 327* 328* 331* 359 365 437 437 index builtin function dcl 111 ref 155 initiate_file_ 000044 constant entry external dcl 102 ref 258 ioa_ 000046 constant entry external dcl 103 ref 339 340 372 381 419 last_time 260 based fixed bin(71,0) array level 3 in structure "usage_seg" dcl 1-9 in procedure "display_subsystem_usage" set ref 320 328 328 last_time 10 based fixed bin(71,0) level 2 in structure "use" dcl 399 in procedure "print_entry" set ref 419* length builtin function dcl 111 ref 254 254 325 325 328 328 331 331 381 381 match_star_name_ 000050 constant entry external dcl 104 ref 407 412 max builtin function dcl 111 ref 381 381 n_arguments 000112 automatic fixed bin(17,0) dcl 60 set ref 117* 123 151 168 189 205 222 n_idxs based fixed bin(17,0) level 2 dcl 55 set ref 312* 437 n_ptrs based fixed bin(17,0) level 2 dcl 50 set ref 311* 435 name 250 based char(24) array level 3 in structure "usage_seg" dcl 1-9 in procedure "display_subsystem_usage" set ref 316 325 325 name based char(24) level 2 in structure "use" dcl 399 in procedure "print_entry" set ref 412 419* null builtin function dcl 111 ref 132 259 267 267 432 435 437 p_idx parameter fixed bin(17,0) dcl 396 ref 393 403 pathname_ 000052 constant entry external dcl 105 ref 260 260 print_switch parameter bit(1) dcl 397 ref 393 419 ptr 1 based pointer array level 2 packed unaligned dcl 50 set ref 316* 318* 320* 322* reverse_sw 000123 automatic bit(1) dcl 62 set ref 146* 162* 164* 302* 302 356 rtrim builtin function dcl 111 ref 254 381 381 search builtin function dcl 111 ref 256 selected_count 000240 automatic fixed bin(17,0) dcl 71 set ref 343* 378* 381* 416* 416 selected_users 000237 automatic fixed bin(17,0) dcl 71 set ref 343* 359 365 377* 381* 415* 415 selected_version_count 000241 automatic fixed bin(17,0) dcl 71 set ref 343* 381* 417* 417 sort_by_count 000120 automatic bit(1) dcl 62 set ref 144* 176* 279 281* 281 288 290* 302 318 327 sort_by_dtu 000121 automatic bit(1) dcl 62 set ref 144* 177* 279 281 281* 281 288 290* 302 320 328 sort_by_name 000117 automatic bit(1) dcl 62 set ref 144* 175* 279 281* 288 290* 316 325 sort_by_version 000122 automatic bit(1) dcl 62 set ref 144* 178* 279 281 281 281* 288 290* 322 331 sort_items_indirect_$bit 000054 constant entry external dcl 106 ref 328 sort_items_indirect_$char 000056 constant entry external dcl 107 ref 325 331 sort_items_indirect_$fixed_bin 000060 constant entry external dcl 108 ref 327 substr builtin function dcl 111 ref 254 subsystem_name 000176 automatic char(32) unaligned dcl 66 set ref 254* 339* 381 381 381* system_area based area(1024) dcl 47 ref 311 312 435 437 system_area_ptr 000104 automatic pointer dcl 48 set ref 130* 311 312 435 437 terminate_file_ 000062 constant entry external dcl 109 ref 432 this_version_count 23 based fixed bin(35,0) level 2 dcl 399 set ref 417 419* total_count 22 based fixed bin(35,0) level 2 in structure "use" dcl 399 in procedure "print_entry" set ref 416 419* total_count 272 based fixed bin(35,0) array level 3 in structure "usage_seg" dcl 1-9 in procedure "display_subsystem_usage" set ref 318 total_count 242 based fixed bin(35,0) level 3 in structure "usage_seg" dcl 1-9 in procedure "display_subsystem_usage" ref 378 totals_only 000116 automatic bit(1) dcl 62 set ref 143* 155* 288 296 309 350 356 372 unspec builtin function dcl 111 ref 328 328 usage_seg based structure level 1 dcl 1-9 usage_seg_dirname 000124 automatic char(168) unaligned dcl 65 set ref 249* 258* 260* 260* 272* 339* usage_seg_ename 000206 automatic char(32) unaligned dcl 66 set ref 249* 254 254 258* 260* 260* 267* 269* usage_seg_entry based structure level 1 dcl 1-30 usage_seg_ptr 000252 automatic pointer dcl 1-19 set ref 132* 258* 259 267* 272* 311 311 312 312 314 316 318 320 322 325 325 328 328 331 331 348 351 358 364 377 378 403 432 432* use based structure level 1 dcl 399 usep 000266 automatic pointer dcl 400 set ref 403* 407 412 416 417 419 419 419 419 419 user 250 based structure array level 2 dcl 1-9 set ref 403 user_name 000216 automatic char(32) unaligned dcl 68 set ref 147* 200* 350 376 410 412* version 12 based char(32) level 2 in structure "use" dcl 399 in procedure "print_entry" set ref 407 419* version 262 based char(32) array level 3 in structure "usage_seg" dcl 1-9 in procedure "display_subsystem_usage" set ref 322 331 331 version_wanted 000226 automatic char(32) unaligned dcl 69 set ref 147* 216* 350 376 381 381 381* 405 407* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. A_ACCESS internal static bit(3) initial unaligned dcl 2-11 A_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 DIR_ACCESS_MODE_NAMES internal static char(4) initial array unaligned dcl 2-33 E_ACCESS internal static bit(3) initial unaligned dcl 2-11 E_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 M_ACCESS internal static bit(3) initial unaligned dcl 2-11 M_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 N_ACCESS internal static bit(3) initial unaligned dcl 2-11 N_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 REW_ACCESS internal static bit(3) initial unaligned dcl 2-11 REW_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 RE_ACCESS internal static bit(3) initial unaligned dcl 2-11 RE_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 RW_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 R_ACCESS internal static bit(3) initial unaligned dcl 2-11 R_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 SA_ACCESS internal static bit(3) initial unaligned dcl 2-11 SA_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 SEG_ACCESS_MODE_NAMES internal static char(4) initial array unaligned dcl 2-30 SMA_ACCESS internal static bit(3) initial unaligned dcl 2-11 SMA_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 SM_ACCESS internal static bit(3) initial unaligned dcl 2-11 SM_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 S_ACCESS internal static bit(3) initial unaligned dcl 2-11 S_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 TERM_FILE_BC internal static bit(2) initial unaligned dcl 3-12 TERM_FILE_DELETE internal static bit(5) initial unaligned dcl 3-17 TERM_FILE_FORCE_WRITE internal static bit(4) initial unaligned dcl 3-16 TERM_FILE_TRUNC internal static bit(1) initial unaligned dcl 3-11 TERM_FILE_TRUNC_BC internal static bit(2) initial unaligned dcl 3-13 TERM_FILE_TRUNC_BC_TERM internal static bit(3) initial unaligned dcl 3-15 USAGE_SEG_MAX_ENTRIES internal static fixed bin(17,0) initial dcl 1-21 USAGE_SEG_VERSION internal static fixed bin(17,0) initial dcl 1-25 USAGE_SEG_VERSION_1 internal static fixed bin(17,0) initial dcl 1-24 W_ACCESS internal static bit(3) initial unaligned dcl 2-11 W_ACCESS_BIN internal static fixed bin(5,0) initial dcl 2-36 terminate_file_switches based structure level 1 packed unaligned dcl 3-4 NAMES DECLARED BY EXPLICIT CONTEXT. BAD_FIRST_N_VALUE 001545 constant label dcl 230 ref 235 PRINT_USAGE_MESSAGE 000524 constant label dcl 124 ref 243 277 RETURN_FROM_DISPLAY_SUBSYSTEM_USAGE 003220 constant label dcl 386 ref 172 183 192 198 208 214 225 233 240 252 262 270 285 293 299 clean_up 003437 constant entry internal dcl 429 ref 135 386 display_subsystem_usage 000465 constant entry external dcl 39 print_entry 003225 constant entry internal dcl 393 ref 352 359 365 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 4242 4326 3733 4252 Length 4632 3733 64 270 306 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME display_subsystem_usage 482 external procedure is an external procedure. on unit on line 135 64 on unit print_entry internal procedure shares stack frame of external procedure display_subsystem_usage. clean_up 84 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME display_subsystem_usage 000100 argument_lth display_subsystem_usage 000102 argument_ptr display_subsystem_usage 000104 system_area_ptr display_subsystem_usage 000106 field_ptrs_ptr display_subsystem_usage 000110 idxs_ptr display_subsystem_usage 000112 n_arguments display_subsystem_usage 000113 have_usage_seg display_subsystem_usage 000114 found_by_refname display_subsystem_usage 000115 header display_subsystem_usage 000116 totals_only display_subsystem_usage 000117 sort_by_name display_subsystem_usage 000120 sort_by_count display_subsystem_usage 000121 sort_by_dtu display_subsystem_usage 000122 sort_by_version display_subsystem_usage 000123 reverse_sw display_subsystem_usage 000124 usage_seg_dirname display_subsystem_usage 000176 subsystem_name display_subsystem_usage 000206 usage_seg_ename display_subsystem_usage 000216 user_name display_subsystem_usage 000226 version_wanted display_subsystem_usage 000236 first_n display_subsystem_usage 000237 selected_users display_subsystem_usage 000240 selected_count display_subsystem_usage 000241 selected_version_count display_subsystem_usage 000242 code display_subsystem_usage 000243 idx display_subsystem_usage 000252 usage_seg_ptr display_subsystem_usage 000266 usep print_entry 000270 code print_entry THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_l_a r_ne_as call_ext_out_desc call_ext_out call_int_this call_int_other return enable ext_entry int_entry alloc_based free_based THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. check_star_name_$entry com_err_ com_err_$suppress_name cu_$arg_count cu_$arg_ptr cv_dec_check_ decode_clock_value_$format expand_pathname_$add_suffix get_system_free_area_ hcs_$fs_get_path_name hcs_$make_ptr initiate_file_ ioa_ match_star_name_ pathname_ sort_items_indirect_$bit sort_items_indirect_$char sort_items_indirect_$fixed_bin terminate_file_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt error_table_$inconsistent error_table_$noarg LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 39 000464 117 000472 118 000502 119 000504 120 000521 123 000522 124 000524 127 000551 130 000552 132 000561 135 000565 140 000607 142 000610 143 000612 144 000613 146 000617 147 000620 148 000626 151 000630 153 000637 155 000655 158 000704 160 000717 162 000731 164 000744 166 000756 167 000762 168 000763 169 000766 172 001012 174 001013 175 001031 176 001042 177 001051 178 001064 180 001073 183 001127 185 001130 187 001131 188 001135 189 001136 190 001141 192 001165 194 001166 195 001204 196 001224 197 001232 198 001264 200 001265 201 001272 203 001273 204 001277 205 001300 206 001303 208 001327 210 001330 211 001346 212 001366 213 001374 214 001430 216 001431 217 001436 219 001437 221 001447 222 001450 223 001453 225 001477 227 001500 228 001516 229 001543 230 001545 233 001601 235 001602 236 001604 239 001605 240 001637 241 001640 243 001641 248 001643 249 001645 250 001701 251 001703 252 001735 254 001736 256 001753 257 001767 258 001770 259 002026 260 002032 262 002101 264 002102 266 002103 267 002105 268 002137 269 002141 270 002167 272 002170 275 002226 277 002230 279 002232 281 002252 285 002343 288 002344 290 002362 293 002423 296 002424 297 002430 299 002460 302 002461 309 002472 311 002474 312 002506 314 002520 315 002527 316 002530 318 002541 320 002552 322 002563 323 002574 325 002576 327 002617 328 002634 331 002655 338 002675 339 002677 340 002723 343 002734 348 002737 350 002745 351 002757 352 002767 353 002773 354 002775 356 002776 358 003002 359 003011 360 003026 361 003031 364 003032 365 003043 366 003060 372 003062 376 003075 377 003105 378 003110 381 003112 386 003220 389 003224 393 003225 403 003227 405 003234 407 003242 408 003266 410 003271 412 003277 413 003324 415 003327 416 003330 417 003335 419 003341 423 003435 429 003436 432 003444 435 003501 437 003512 439 003523 ----------------------------------------------------------- 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