COMPILATION LISTING OF SEGMENT get_process_usage Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 1002.7 mst Sat Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 get_process_usage: 14 procedure (process_usage_pointer, code); 15 16 /* 17* 18* Last Modified: 19* 20* 09/17/76 by R. Bratt to add seg_fault, bound_fault, vtoc_read, and vtoc_write meters. 21* 01/08/85 by Keith Loepere to delete pd_page_faults. 22**/ 23 24 declare code fixed bin (35), 25 pds$apt_ptr ext pointer, 26 pds$cpu_time fixed bin (71) ext, 27 pds$virtual_delta fixed bin (71) ext, 28 pds$page_waits fixed bin (35) ext, 29 pds$segment_faults fixed bin (35) ext, 30 pds$bounds_faults fixed bin (35) ext, 31 pds$vtoc_reads fixed bin (35) ext, 32 pds$vtoc_writes fixed bin (35) ext, 33 clock_ entry returns (fixed bin (52)); 34 35 /* */ 36 37 process_usage.number_can_return = 9; /* current number we can return */ 38 code = 0; /* currently no error code can be returned */ 39 aptep = pds$apt_ptr; 40 41 if number_wanted < 1 then return; 42 process_usage.cpu_time = clock_ ()-pds$cpu_time; 43 44 if number_wanted < 2 then return; 45 process_usage.paging_measure = apte.paging_measure; 46 47 if number_wanted < 3 then return; 48 process_usage.page_faults = pds$page_waits; 49 50 if number_wanted < 4 then return; 51 process_usage.pd_faults = 0; /* paging device */ 52 53 if number_wanted < 5 then return; 54 process_usage.virtual_cpu_time = clock_ () - pds$cpu_time - pds$virtual_delta; 55 56 if number_wanted < 6 then return; 57 process_usage.segment_faults = pds$segment_faults; 58 59 if number_wanted < 7 then return; 60 process_usage.bounds_faults = pds$bounds_faults; 61 62 if number_wanted < 8 then return; 63 process_usage.vtoc_reads = pds$vtoc_reads; 64 65 if number_wanted < 9 then return; 66 process_usage.vtoc_writes = pds$vtoc_writes; 67 68 69 return; 70 71 /* */ 72 1 1 /* BEGIN INCLUDE FILE ... apte.incl.pl1 */ 1 2 1 3 /* Modified 1984-11-11 by E. Swenson for IPC event channel validation. */ 1 4 1 5 dcl aptep pointer; 1 6 1 7 dcl 1 apte based (aptep) aligned, /* APT entry declaration for an active (known) process */ 1 8 2 thread unaligned, /* List thread */ 1 9 3 fp bit (18), /* Forward pointer */ 1 10 3 bp bit (18), /* Backward pointer */ 1 11 2 flags unaligned, /* Flags and miscellaneous */ 1 12 3 mbz bit (1), /* This bit must be zero (sentinel bit) */ 1 13 3 wakeup_waiting bit (1), /* ON if process has received wakeup */ 1 14 3 stop_pending bit (1), /* ON if process has received stop connect */ 1 15 3 pre_empted bit (1), /* ON if process is being pre-empted by get_processor */ 1 16 3 hproc bit (1), /* ON if process is hardcore process */ 1 17 3 loaded bit (1), /* ON if required per-process pages are in memory and wired */ 1 18 3 eligible bit (1), /* ON if process is eligible */ 1 19 3 idle bit (1), /* ON if this is an idle process */ 1 20 3 interaction bit (1), /* ON if process has interacted recently */ 1 21 3 pre_empt_pending bit (1), /* ON if process has received pre-empt connect */ 1 22 3 default_procs_required bit (1), /* ON if apte.procs_required is system default */ 1 23 3 realtime_burst bit (1), /* ON if next eligibility is realtime */ 1 24 3 always_loaded bit (1), /* ON if process is not to be unloaded */ 1 25 3 dbr_loaded bit (1), /* ON if DBR is loaded on some CPU */ 1 26 3 being_loaded bit (1), /* ON if somebody loading this process */ 1 27 3 shared_stack_0 bit (1), /* ON if a shared stack_0 is assigned */ 1 28 3 page_wait_flag bit (1), /* flag ON if waiting for page */ 1 29 3 firstsw bit (1), /* OFF until process is intialized */ 1 30 3 state bit (18), /* execution state */ 1 31 2 page_faults fixed bin (35), /* total page faults for the process */ 1 32 2 processid bit (36), /* bit 0-17: offset of ATPE */ 1 33 /* bit 18-35: sequential number */ 1 34 2 te fixed bin (35), /* virtual time since eligibility award */ 1 35 2 ts fixed bin (35), /* virtual time since scheduling */ 1 36 2 ti fixed bin (35), /* virtual time since interaction */ 1 37 2 timax fixed bin (35), /* maximum value allowed for apte.ti */ 1 38 1 39 /* * * * * * * * */ 1 40 1 41 2 ipc_pointers unaligned, 1 42 3 event_thread bit (18), /* relative pointer to ITT list */ 1 43 3 pad3 bit (18), 1 44 2 ips_message bit (36), /* IPS signals pending */ 1 45 2 asteps unaligned, /* relative ASTE pointers */ 1 46 3 pds bit (18), /* PDS (per-process) */ 1 47 3 dseg bit (18), /* DSEG (per-process) */ 1 48 3 prds bit (18), /* PRDS (per-processor) */ 1 49 2 savex7 bit (18) unaligned, /* x7 at call to getwork (return point in pxss) */ 1 50 2 term_processid bit (36), /* process to send wakeup at temination */ 1 51 2 lock_id bit (36), /* File System unqieu ID associated with process */ 1 52 2 time_used_clock fixed bin (71), /* Total CPU time when process last lost CPU */ 1 53 1 54 /* * * * * * * * */ 1 55 1 56 2 wait_event bit (36) aligned, /* Event ID process awaiting */ 1 57 2 wct_index bit (18) unaligned, /* rel offset of WCTE */ 1 58 2 flags2 unaligned, 1 59 3 priority_scheduling bit (1), /* ON if guaranteed eligibility */ 1 60 3 special_wakeups bit (6), /* Special wakeup channels */ 1 61 3 pad7 bit (7), 1 62 3 batch bit (1), /* ON if absentee */ 1 63 3 pr_tag bit (3), /* CPU tag running or last run */ 1 64 2 state_change_time fixed bin (71), /* Time apte.state last changed */ 1 65 2 alarm_event fixed bin (71), /* wakeup event for alarm clock manager */ 1 66 2 alarm_time_thread bit (18) unaligned, /* thread of processes with pending alarms */ 1 67 2 alarm_time bit (54) unaligned, /* wakeup time for alarm */ 1 68 1 69 /* * * * * * */ 1 70 1 71 2 term_channel fixed bin (71), /* wakeup event for account overflow */ 1 72 2 ws_size fixed bin, /* working set estimate for the process */ 1 73 2 temax fixed bin (35), /* maximum eligibility slice (vcpu) */ 1 74 2 deadline fixed bin (71), /* time of next run */ 1 75 2 lock bit (18) unaligned, /* 0 => APTE locked, unlocked => return point of last unlock */ 1 76 2 unusable bit (18) unaligned, /* locking routines destroy */ 1 77 2 cpu_monitor fixed bin (35), /* if not 0, send wakeup to term_processid when virtual cpu 1 78* /* reaches this (units = 1/1024 sec) */ 1 79 2 paging_measure fixed bin (71), /* cumulative memory units */ 1 80 2 access_authorization bit (72), /* authorization of this process */ 1 81 2 dbr fixed bin (71), /* DBR value (constant since DSEG entry-held) */ 1 82 1 83 2 virtual_cpu_time fixed bin (71), /* cumulative virtual CPU time for the process */ 1 84 2 ittes_sent fixed bin (18), /* Unprocessed ITTs sent by this process */ 1 85 2 ittes_got fixed bin (18), /* Unprocessed ITTs received by this process */ 1 86 1 87 /* Cells used to drive and instrument finite-state model for response time 1 88* measurement. Maintained by meter_response_time */ 1 89 1 90 2 current_response_state fixed bin (17) unaligned, /* Process state in modle */ 1 91 2 pad18 bit (18) unaligned, 1 92 2 number_processing fixed bin (35), /* Number interactions */ 1 93 2 last_response_state_time fixed bin (71), /* Clock time at last response state change */ 1 94 2 total_processing_time fixed bin (71), /* Total interaction processing time */ 1 95 1 96 /* * * * * * */ 1 97 1 98 2 begin_interaction_vcpu fixed bin (71), /* Virtual cpu at beginning of last interaction */ 1 99 1 100 /* End of cells for finite-state model */ 1 101 1 102 2 saved_temax fixed bin (35), /* temax at eligibility award */ 1 103 2 procs_required bit (8) unaligned, /* bit mask of CPUs this process can run */ 1 104 2 pad4 bit (28) unaligned, 1 105 2 ipc_r_offset fixed bin (18) unsigned, 1 106 2 ipc_r_factor fixed bin (35) unsigned, 1 107 2 apad (10) fixed bin (35); 1 108 1 109 /* END INCLUDE FILE ... apte.incl.pl1 */ 73 74 75 /* */ 76 2 1 /* BEGIN INCLUDE FILE process_usage.incl.pl1 WRITTEN 09/17/76 BY Richard Bratt */ 2 2 2 3 declare 2 4 process_usage_pointer pointer, 2 5 1 process_usage based (process_usage_pointer), 2 6 2 number_wanted fixed bin, /* max number of entries to be returned */ 2 7 2 number_can_return fixed bin, /* the number of entries currently returnable */ 2 8 2 cpu_time fixed bin (71), 2 9 2 paging_measure fixed bin (71), 2 10 2 page_faults fixed bin (34), 2 11 2 pd_faults fixed bin (34), 2 12 2 virtual_cpu_time fixed bin (71), 2 13 2 segment_faults fixed bin (34), 2 14 2 bounds_faults fixed bin (34), 2 15 2 vtoc_reads fixed bin (34), 2 16 2 vtoc_writes fixed bin (34); 2 17 2 18 /* END INCLUDE FILE process_usage.incl.pl1 */ 77 78 79 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0805.2 get_process_usage.pl1 >spec>install>1111>get_process_usage.pl1 73 1 01/06/85 1422.2 apte.incl.pl1 >ldd>include>apte.incl.pl1 77 2 10/26/76 1333.6 process_usage.incl.pl1 >ldd>include>process_usage.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. apte based structure level 1 dcl 1-7 aptep 000100 automatic pointer dcl 1-5 set ref 39* 45 bounds_faults 13 based fixed bin(34,0) level 2 dcl 2-3 set ref 60* clock_ 000030 constant entry external dcl 24 ref 42 54 code parameter fixed bin(35,0) dcl 24 set ref 13 38* cpu_time 2 based fixed bin(71,0) level 2 dcl 2-3 set ref 42* number_can_return 1 based fixed bin(17,0) level 2 dcl 2-3 set ref 37* number_wanted based fixed bin(17,0) level 2 dcl 2-3 ref 41 44 47 50 53 56 59 62 65 page_faults 6 based fixed bin(34,0) level 2 dcl 2-3 set ref 48* paging_measure 4 based fixed bin(71,0) level 2 in structure "process_usage" dcl 2-3 in procedure "get_process_usage" set ref 45* paging_measure 40 based fixed bin(71,0) level 2 in structure "apte" dcl 1-7 in procedure "get_process_usage" ref 45 pd_faults 7 based fixed bin(34,0) level 2 dcl 2-3 set ref 51* pds$apt_ptr 000010 external static pointer dcl 24 ref 39 pds$bounds_faults 000022 external static fixed bin(35,0) dcl 24 ref 60 pds$cpu_time 000012 external static fixed bin(71,0) dcl 24 ref 42 54 pds$page_waits 000016 external static fixed bin(35,0) dcl 24 ref 48 pds$segment_faults 000020 external static fixed bin(35,0) dcl 24 ref 57 pds$virtual_delta 000014 external static fixed bin(71,0) dcl 24 ref 54 pds$vtoc_reads 000024 external static fixed bin(35,0) dcl 24 ref 63 pds$vtoc_writes 000026 external static fixed bin(35,0) dcl 24 ref 66 process_usage based structure level 1 unaligned dcl 2-3 process_usage_pointer parameter pointer dcl 2-3 ref 13 37 41 42 44 45 47 48 50 51 53 54 56 57 59 60 62 63 65 66 segment_faults 12 based fixed bin(34,0) level 2 dcl 2-3 set ref 57* virtual_cpu_time 10 based fixed bin(71,0) level 2 dcl 2-3 set ref 54* vtoc_reads 14 based fixed bin(34,0) level 2 dcl 2-3 set ref 63* vtoc_writes 15 based fixed bin(34,0) level 2 dcl 2-3 set ref 66* NAME DECLARED BY EXPLICIT CONTEXT. get_process_usage 000007 constant entry external dcl 13 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 260 312 142 270 Length 522 142 32 174 116 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME get_process_usage 72 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME get_process_usage 000100 aptep get_process_usage THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. clock_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. pds$apt_ptr pds$bounds_faults pds$cpu_time pds$page_waits pds$segment_faults pds$virtual_delta pds$vtoc_reads pds$vtoc_writes LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 13 000003 37 000014 38 000021 39 000022 41 000025 42 000031 44 000046 45 000052 47 000055 48 000061 50 000063 51 000067 53 000070 54 000073 56 000111 57 000115 59 000117 60 000123 62 000125 63 000131 65 000133 66 000137 69 000141 ----------------------------------------------------------- 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