COMPILATION LISTING OF SEGMENT log_match_ Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 02/14/85 1117.8 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1984 * 4* * * 5* *********************************************************** */ 6 log_match_: 7 procedure (); 8 9 /* * LOG_MATCH_ 10* * 11* * This procedure is in charge of selecting messages from a log. 12* * Given a message, it returns true or false, depending on whether 13* * the message matches the criteria established by earlier calls 14* * that created the lmd ("log match data") structure. This procedure 15* * implements selection by matching/exclusion on the message text, 16* * matching/exclusion on the formatted data, and the severity and 17* * severity class of the message. 18* * 19* * It is completely responsible for maintaining the lmd data structure; 20* * this is allocated when first needed, and reallicated as required. For 21* * string matching, it relies on the procedure match_strings_ to do 22* * the necessary management; two sets of strings are maintained, one 23* * for message text, and one for expanded message data. 24* * 25* * 84-06-08, W. Olin Sibert 26* * Modified 1984-10-24 BIM for $print. 27* * Modified 1984-11-30 BIM to indent value in $print. 28* * Modified 1985-01-16, BIM: added data_class support. 29* */ 30 31 declare P_IOCB_ptr pointer parameter; 32 declare P_log_message_ptr pointer parameter; 33 declare P_expanded_string char (*) varying parameter; 34 declare P_lmd_ptr pointer parameter; 35 declare P_min_severity fixed bin parameter; 36 declare P_max_severity fixed bin parameter; 37 declare P_string char (*) parameter; 38 declare P_indent fixed bin; 39 40 declare lmd_ptr pointer; 41 declare lmd_area area based (lmd_ptr); 42 declare 1 lmd aligned based (lmd_ptr), 43 2 area_ptr pointer, 44 2 text_string_ptr pointer, 45 2 data_string_ptr pointer, 46 2 data_class_string_ptr pointer, 47 2 select_severity bit (1) aligned, 48 2 severity (-256 : 255) bit (1) unaligned; 49 50 declare severity_idx fixed bin; 51 declare min_severity fixed bin; 52 declare max_severity fixed bin; 53 54 declare get_system_free_area_ entry () returns (pointer); 55 declare ioa_$ioa_switch entry() options(variable); 56 declare ioa_$rsnnl entry() options(variable); 57 declare match_strings_$add entry (pointer, bit (1) aligned, char (*)); 58 declare match_strings_$free entry (pointer); 59 declare match_strings_$test entry (pointer, char (*)) returns (bit (1) aligned); 60 declare match_strings_$print entry (pointer /* IOCB */, fixed bin /* indent */, char (*) /* Title */, pointer /* match data */); 61 62 declare (addr, hbound, lbound, length, max, min, null, string, unspec) builtin; 63 64 /* */ 65 66 log_match_$test: 67 entry (P_lmd_ptr, P_log_message_ptr, P_expanded_string) returns (bit (1) aligned); 68 69 lmd_ptr = P_lmd_ptr; 70 log_message_ptr = P_log_message_ptr; 71 72 if (lmd_ptr = null ()) then return ("1"b); 73 74 /* This may not be the optimal ordering for these tests, but it's a reasonable first cut. 75* 84-07-02, WOS */ 76 77 if lmd.select_severity then 78 if ^lmd.severity (log_message.severity) then 79 return ("0"b); 80 81 if lmd.text_string_ptr ^= null () then 82 if ^match_strings_$test (lmd.text_string_ptr, log_message.text) then 83 return ("0"b); 84 85 if lmd.data_class_string_ptr ^= null () then 86 if ^match_strings_$test (lmd.data_class_string_ptr, (log_message.data_class)) then 87 return ("0"b); 88 89 if lmd.data_string_ptr ^= null () then 90 if (log_message.data_lth > 0) then 91 if (length (P_expanded_string) > 0) then begin; 92 declare nv_expanded_string char (length (P_expanded_string)) based (exsp_ptr); 93 declare exsp_ptr pointer; 94 exsp_ptr = addwordno (addr (P_expanded_string), 1); 95 if ^match_strings_$test (lmd.data_string_ptr, nv_expanded_string) then 96 return ("0"b); 97 end; 98 return ("1"b); 99 100 /* */ 101 102 log_match_$free: 103 entry (P_lmd_ptr); 104 105 lmd_ptr = P_lmd_ptr; 106 P_lmd_ptr = null (); 107 108 if (lmd_ptr = null ()) then return; /* Nothing to do */ 109 110 call match_strings_$free (lmd.text_string_ptr); 111 112 call match_strings_$free (lmd.data_string_ptr); 113 114 call match_strings_$free (lmd.data_class_string_ptr); 115 116 free lmd in (lmd_area); 117 118 return; 119 120 /* */ 121 122 log_match_$add_match: 123 entry (P_lmd_ptr, P_string); 124 125 call get_caller_lmd (); 126 call match_strings_$add (lmd.text_string_ptr, "1"b, P_string); 127 return; 128 129 130 131 log_match_$add_exclude: 132 entry (P_lmd_ptr, P_string); 133 134 call get_caller_lmd (); 135 call match_strings_$add (lmd.text_string_ptr, "0"b, P_string); 136 return; 137 138 139 log_match_$add_match_data_class: 140 entry (P_lmd_ptr, P_string); 141 142 call get_caller_lmd (); 143 call match_strings_$add (lmd.data_class_string_ptr, "1"b, P_string); 144 return; 145 146 147 148 log_match_$add_exclude_data_class: 149 entry (P_lmd_ptr, P_string); 150 151 call get_caller_lmd (); 152 call match_strings_$add (lmd.data_class_string_ptr, "0"b, P_string); 153 return; 154 155 156 157 log_match_$add_match_data: 158 entry (P_lmd_ptr, P_string); 159 160 call get_caller_lmd (); 161 call match_strings_$add (lmd.data_string_ptr, "1"b, P_string); 162 return; 163 164 165 166 log_match_$add_exclude_data: 167 entry (P_lmd_ptr, P_string); 168 169 call get_caller_lmd (); 170 call match_strings_$add (lmd.data_string_ptr, "0"b, P_string); 171 return; 172 173 174 175 log_match_$add_severity: 176 entry (P_lmd_ptr, P_min_severity, P_max_severity); 177 178 call get_caller_lmd (); 179 if (P_min_severity > P_max_severity) then 180 min_severity = max (lbound (lmd.severity, 1), P_max_severity); 181 else min_severity = max (lbound (lmd.severity, 1), P_min_severity); 182 if (P_min_severity > P_max_severity) then 183 max_severity = min (hbound (lmd.severity, 1), P_min_severity); 184 else max_severity = min (hbound (lmd.severity, 1), P_max_severity); 185 186 lmd.select_severity = "1"b; 187 do severity_idx = min_severity to max_severity; 188 lmd.severity (severity_idx) = "1"b; 189 end; 190 return; 191 192 /* */ 193 194 log_match_$clear_severity: 195 entry (P_lmd_ptr); 196 197 if (P_lmd_ptr = null ()) then return; 198 call get_caller_lmd (); 199 lmd.select_severity = "0"b; 200 string (lmd.severity) = ""b; 201 return; 202 203 204 205 log_match_$clear_text_strings: 206 entry (P_lmd_ptr); 207 208 if P_lmd_ptr = null () 209 then return; 210 call get_caller_lmd (); 211 call match_strings_$free (lmd.text_string_ptr); 212 return; 213 214 log_match_$clear_data_class_strings: 215 entry (P_lmd_ptr); 216 217 if P_lmd_ptr = null () 218 then return; 219 call get_caller_lmd (); 220 call match_strings_$free (lmd.data_class_string_ptr); 221 return; 222 223 224 225 log_match_$clear_data_strings: 226 entry (P_lmd_ptr); 227 228 if P_lmd_ptr = null () 229 then return; 230 call get_caller_lmd (); 231 call match_strings_$free (lmd.data_string_ptr); 232 return; 233 234 235 log_match_$print: 236 entry (P_lmd_ptr, P_IOCB_ptr, P_indent); 237 238 if P_lmd_ptr = null () 239 then return; 240 call get_caller_lmd (); 241 if lmd.select_severity 242 then call print_severity; 243 call match_strings_$print (P_IOCB_ptr, P_indent, "Text", lmd.text_string_ptr); 244 call match_strings_$print (P_IOCB_ptr, P_indent, "Data class", lmd.data_class_string_ptr); 245 call match_strings_$print (P_IOCB_ptr, P_indent, "Data", lmd.data_string_ptr); 246 return; 247 248 249 /* */ 250 251 get_caller_lmd: 252 procedure (); 253 254 declare system_area area based (system_area_ptr); 255 declare system_area_ptr pointer; 256 257 258 lmd_ptr = P_lmd_ptr; 259 260 if (lmd_ptr ^= null ()) then return; 261 262 system_area_ptr = get_system_free_area_ (); 263 allocate lmd in (system_area) set (lmd_ptr); 264 265 unspec (lmd) = ""b; 266 lmd.text_string_ptr = null (); 267 lmd.data_string_ptr = null (); 268 lmd.data_class_string_ptr = null (); 269 lmd.area_ptr = system_area_ptr; 270 P_lmd_ptr = lmd_ptr; /* Give it back to our caller */ 271 272 return; 273 end get_caller_lmd; 274 275 print_severity: 276 procedure options (non_quick); 277 278 /**** This program has the unenviable task of turning that bitstring 279* into a set of ranges. */ 280 281 declare ranges_used fixed bin; 282 declare ranges (512) char (32) unaligned; 283 declare used_ranges (ranges_used) char (32) unaligned based; 284 285 declare last_on_index fixed bin; 286 declare current_index fixed bin; 287 288 ranges_used = 0; 289 unspec (ranges) = ""b; 290 last_on_index = -10000; 291 do current_index = lbound (lmd.severity, 1) to hbound (lmd.severity, 1); 292 if last_on_index < lbound (lmd.severity, 1) 293 then if lmd.severity (current_index) 294 then last_on_index = current_index; 295 else ; /* no pending range, none starts here */ 296 else if lmd.severity (current_index) 297 then ; /* range continues through here */ 298 else do; /* terminate a range */ 299 ranges_used = ranges_used + 1; 300 call ioa_$rsnnl ("^d^[ to ^d^]", ranges (ranges_used), (0), last_on_index, last_on_index ^= (current_index - 1), current_index - 1); 301 last_on_index = -10000; 302 end; 303 end; /* done the loop */ 304 if ranges_used = 0 then return; /* nothing to say */ 305 call ioa_$ioa_switch (P_IOCB_ptr, "^vx Severities: ^(^a ^)", P_indent, 306 addr (ranges) -> used_ranges (*)); 307 return; 308 309 end print_severity; 310 311 /* BEGIN INCLUDE FILE ... log_message.incl.pl1 ... 84-04-25 ... W. Olin Sibert */ 1 2 1 3 declare 1 log_message_header aligned based, /* Items marked "(SET)" are set by $create_message */ 1 4 2 sentinel bit (36) aligned, /* Proper value declared in log_segment.incl.pl1 */ 1 5 2 sequence fixed bin (35), /* Sequence number for this message (SET) */ 1 6 2 severity fixed bin (8) unaligned, /* Severity of message */ 1 7 2 data_class_lth fixed bin (9) unaligned unsigned, /* Length of data class-- 0 to 16 (SET) */ 1 8 2 time fixed bin (53) unaligned, /* Time message originated */ 1 9 2 text_lth fixed bin (17) unaligned, /* Length of message text. Must be nonzero (SET) */ 1 10 2 data_lth fixed bin (17) unaligned, /* Length of binary data. May be zero (SET) */ 1 11 2 process_id bit (36) aligned; /* Process id of process writing message */ 1 12 1 13 declare 1 log_message aligned based (log_message_ptr), 1 14 2 header aligned like log_message_header, 1 15 2 text char (log_message_text_lth refer (log_message.text_lth)) unaligned, 1 16 2 data_class char (log_message_data_class_lth refer (log_message.data_class_lth)) unaligned, 1 17 2 data dim (log_message_data_lth refer (log_message.data_lth)) bit (36) aligned; 1 18 1 19 declare log_message_ptr pointer; 1 20 declare log_message_text_lth fixed bin; 1 21 declare log_message_data_class_lth fixed bin; 1 22 declare log_message_data_lth fixed bin; 1 23 1 24 /* END INCLUDE FILE ... log_message.incl.pl1 */ 311 312 313 end log_match_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 02/14/85 0747.0 log_match_.pl1 >special_ldd>online>41-8>log_match_.pl1 311 1 01/21/85 0912.2 log_message.incl.pl1 >ldd>include>log_message.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. P_IOCB_ptr parameter pointer dcl 31 set ref 235 243* 244* 245* 305* P_expanded_string parameter varying char dcl 33 set ref 66 89 94 95 95 P_indent parameter fixed bin(17,0) dcl 38 set ref 235 243* 244* 245* 305* P_lmd_ptr parameter pointer dcl 34 set ref 66 69 102 105 106* 122 131 139 148 157 166 175 194 197 205 208 214 217 225 228 235 238 258 270* P_log_message_ptr parameter pointer dcl 32 ref 66 70 P_max_severity parameter fixed bin(17,0) dcl 36 ref 175 179 179 182 184 P_min_severity parameter fixed bin(17,0) dcl 35 ref 175 179 181 182 182 P_string parameter char unaligned dcl 37 set ref 122 126* 131 135* 139 143* 148 152* 157 161* 166 170* addr builtin function dcl 62 ref 94 305 area_ptr based pointer level 2 dcl 42 set ref 269* current_index 010102 automatic fixed bin(17,0) dcl 286 set ref 291* 292 292 296 300 300* data_class based char level 2 packed unaligned dcl 1-13 ref 85 data_class_lth 2(09) based fixed bin(9,0) level 3 packed unsigned unaligned dcl 1-13 ref 85 data_class_string_ptr 6 based pointer level 2 dcl 42 set ref 85 85* 114* 143* 152* 220* 244* 268* data_lth 4(18) based fixed bin(17,0) level 3 packed unaligned dcl 1-13 ref 89 data_string_ptr 4 based pointer level 2 dcl 42 set ref 89 95* 112* 161* 170* 231* 245* 267* exsp_ptr 000112 automatic pointer dcl 93 set ref 94* 95 get_system_free_area_ 000010 constant entry external dcl 54 ref 262 hbound builtin function dcl 62 ref 182 184 291 header based structure level 2 dcl 1-13 ioa_$ioa_switch 000012 constant entry external dcl 55 ref 305 ioa_$rsnnl 000014 constant entry external dcl 56 ref 300 last_on_index 010101 automatic fixed bin(17,0) dcl 285 set ref 290* 292 292* 300* 300 301* lbound builtin function dcl 62 ref 179 181 291 292 length builtin function dcl 62 ref 89 95 95 lmd based structure level 1 dcl 42 set ref 116 263 265* lmd_area based area(1024) dcl 41 ref 116 lmd_ptr 000100 automatic pointer dcl 40 set ref 69* 72 77 77 81 81 85 85 89 95 105* 108 110 112 114 116 116 126 135 143 152 161 170 179 181 182 184 186 188 199 200 211 220 231 241 243 244 245 258* 260 263* 265 266 267 268 269 270 291 291 292 292 296 log_message based structure level 1 dcl 1-13 log_message_header based structure level 1 dcl 1-3 log_message_ptr 000106 automatic pointer dcl 1-19 set ref 70* 77 81 85 89 match_strings_$add 000016 constant entry external dcl 57 ref 126 135 143 152 161 170 match_strings_$free 000020 constant entry external dcl 58 ref 110 112 114 211 220 231 match_strings_$print 000024 constant entry external dcl 60 ref 243 244 245 match_strings_$test 000022 constant entry external dcl 59 ref 81 85 95 max builtin function dcl 62 ref 179 181 max_severity 000104 automatic fixed bin(17,0) dcl 52 set ref 182* 184* 187 min builtin function dcl 62 ref 182 184 min_severity 000103 automatic fixed bin(17,0) dcl 51 set ref 179* 181* 187 null builtin function dcl 62 ref 72 81 85 89 106 108 197 208 217 228 238 260 266 267 268 nv_expanded_string based char unaligned dcl 92 set ref 95* ranges 000101 automatic char(32) array unaligned dcl 282 set ref 289* 300* 305 ranges_used 000100 automatic fixed bin(17,0) dcl 281 set ref 288* 299* 299 300 304 305 select_severity 10 based bit(1) level 2 dcl 42 set ref 77 186* 199* 241 severity 2 based fixed bin(8,0) level 3 in structure "log_message" packed unaligned dcl 1-13 in procedure "log_match_" ref 77 severity 11 based bit(1) array level 2 in structure "lmd" packed unaligned dcl 42 in procedure "log_match_" set ref 77 179 181 182 184 188* 200* 291 291 292 292 296 severity_idx 000102 automatic fixed bin(17,0) dcl 50 set ref 187* 188* string builtin function dcl 62 set ref 200* system_area based area(1024) dcl 254 ref 263 system_area_ptr 000122 automatic pointer dcl 255 set ref 262* 263 269 text 6 based char level 2 packed unaligned dcl 1-13 set ref 81* text_lth 4 based fixed bin(17,0) level 3 packed unaligned dcl 1-13 ref 81 81 85 text_string_ptr 2 based pointer level 2 dcl 42 set ref 81 81* 110* 126* 135* 211* 243* 266* unspec builtin function dcl 62 set ref 265* 289* used_ranges based char(32) array unaligned dcl 283 set ref 305* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. log_message_data_class_lth automatic fixed bin(17,0) dcl 1-21 log_message_data_lth automatic fixed bin(17,0) dcl 1-22 log_message_text_lth automatic fixed bin(17,0) dcl 1-20 NAMES DECLARED BY EXPLICIT CONTEXT. get_caller_lmd 001605 constant entry internal dcl 251 ref 125 134 142 151 160 169 178 198 210 219 230 240 log_match_ 000045 constant entry external dcl 6 log_match_$add_exclude 000546 constant entry external dcl 131 log_match_$add_exclude_data 001032 constant entry external dcl 166 log_match_$add_exclude_data_class 000700 constant entry external dcl 148 log_match_$add_match 000471 constant entry external dcl 122 log_match_$add_match_data 000755 constant entry external dcl 157 log_match_$add_match_data_class 000623 constant entry external dcl 139 log_match_$add_severity 001111 constant entry external dcl 175 log_match_$clear_data_class_strings 001314 constant entry external dcl 214 log_match_$clear_data_strings 001361 constant entry external dcl 225 log_match_$clear_severity 001205 constant entry external dcl 194 log_match_$clear_text_strings 001247 constant entry external dcl 205 log_match_$free 000376 constant entry external dcl 102 log_match_$print 001430 constant entry external dcl 235 log_match_$test 000062 constant entry external dcl 66 print_severity 001650 constant entry internal dcl 275 ref 241 NAME DECLARED BY CONTEXT OR IMPLICATION. addwordno builtin function ref 94 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2532 2560 2053 2542 Length 3030 2053 26 234 456 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME log_match_ 146 external procedure is an external procedure. begin block on line 89 begin block shares stack frame of external procedure log_match_. get_caller_lmd internal procedure shares stack frame of external procedure log_match_. print_severity 4220 internal procedure is declared options(non_quick). STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME log_match_ 000100 lmd_ptr log_match_ 000102 severity_idx log_match_ 000103 min_severity log_match_ 000104 max_severity log_match_ 000106 log_message_ptr log_match_ 000112 exsp_ptr begin block on line 89 000122 system_area_ptr get_caller_lmd print_severity 000100 ranges_used print_severity 000101 ranges print_severity 010101 last_on_index print_severity 010102 current_index print_severity THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as alloc_cs call_ext_out_desc call_ext_out call_int_this begin_return return signal ext_entry ext_entry_desc int_entry alloc_based free_based THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. get_system_free_area_ ioa_$ioa_switch ioa_$rsnnl match_strings_$add match_strings_$free match_strings_$print match_strings_$test NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 6 000044 66 000054 69 000076 70 000102 72 000105 77 000122 81 000143 85 000210 89 000271 94 000307 95 000315 98 000361 102 000373 105 000405 106 000411 108 000413 110 000425 112 000434 114 000444 116 000454 118 000456 122 000465 125 000506 126 000507 127 000535 131 000544 134 000563 135 000564 136 000612 139 000621 142 000640 143 000641 144 000667 148 000676 151 000715 152 000716 153 000744 157 000753 160 000772 161 000773 162 001021 166 001030 169 001047 170 001050 171 001076 175 001105 178 001120 179 001121 181 001133 182 001137 184 001147 186 001154 187 001157 188 001165 189 001172 190 001174 194 001203 197 001214 198 001230 199 001231 200 001233 201 001236 205 001245 208 001256 210 001272 211 001273 212 001303 214 001312 217 001323 219 001337 220 001340 221 001350 225 001357 228 001370 230 001404 231 001405 232 001415 235 001424 238 001437 240 001453 241 001454 243 001463 244 001513 245 001546 246 001576 251 001605 258 001606 260 001612 262 001617 263 001626 265 001633 266 001636 267 001640 268 001641 269 001642 270 001644 272 001646 275 001647 288 001655 289 001656 290 001662 291 001664 292 001671 295 001706 296 001707 299 001720 300 001721 301 001776 303 002000 304 002002 305 002004 307 002051 ----------------------------------------------------------- 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