1 " ***********************************************************
  2 " *                                                         *
  3 " * Copyright, (C) Honeywell Information Systems Inc., 1984 *
  4 " *                                                         *
  5 " ***********************************************************
  6 
  7 " This is (or will be) the trace gate.
  8 " For efficiency, it implements some of the simple operations.
  9 
 10 " Written: May 1984 by Jeffrey D. Ives.
 11 
 12 
 13           name      trace_
 14 
 15 
 16 INITIALIZE_EVERYTHING:
 17           getlp
 18           call6     trace_transactions_$initialize_everything
 19 
 20           firstref  <*text>|INITIALIZE_EVERYTHING
 21 ^L
 22           include   gate_macros
 23 
 24 
 25 
 26 
 27 
 28           gate_info
 29 
 30 
 31 
 32 
 33 
 34 macro     TraceGate
 35           gentry    &1,&3*2,0
 36           tsx2      TRACE_SETUP
 37           call6     &2
 38           &end
 39 ^L
 40 " CATCH EXECUTION
 41 
 42           TraceGate catch_pl1,trace_catch_$catch_pl1_,0
 43 
 44 
 45 " IDENTIFICATION
 46 
 47                     " () returns (char (32))
 48           TraceGate me,trace_version_$me,1
 49 
 50                     " () returns (char (32))
 51           TraceGate version,trace_version_$version,1
 52 
 53 " TRANSACTIONS
 54 
 55                               " entry (fixed bin (71)) returns (bit aligned)
 56           TraceGate transaction_begin,trace_transactions_$transaction_begin,2
 57 
 58                               " entry (fixed bin (71))
 59           TraceGate transaction_begin_force,trace_transactions_$transaction_begin_force,1
 60 
 61                               " entry (fixed bin (71)) returns (bit aligned)
 62           TraceGate transaction_end,trace_transactions_$transaction_end,2
 63 
 64 " UPDATES
 65 
 66                               " entry () returns (bit aligned)
 67           TraceGate update_default_parms,trace_parameters_$update_default_parms,1
 68 
 69                               " entry () returns (bit aligned)
 70           TraceGate update_global_parms,trace_parameters_$update_global_parms,1
 71 
 72                               " entry (fixed bin, fixed bin)
 73           TraceGate add_specified_eps,trace_tables_$add_specified_eps,2
 74 
 75                               " entry (fixed bin, fixed bin)
 76           TraceGate add_specified_locs,trace_tables_$add_specified_locs,2
 77 
 78                               " entry (fixed bin)
 79           TraceGate remove_specified_eps,trace_tables_$remove_specified_eps,1
 80 
 81                               " entry (fixed bin)
 82           TraceGate remove_specified_locs,trace_tables_$remove_specified_locs,1
 83 
 84                               " entry (fixed bin)
 85           TraceGate turn_on_specified_eps,trace_tables_$turn_on_specified_eps,1
 86 
 87                               " entry (fixed bin)
 88           TraceGate turn_off_specified_eps,trace_tables_$turn_off_specified_eps,1
 89 
 90 " CONVERSION
 91 
 92                               " (char (8) aligned) returns (bit (2) aligned)
 93           TraceGate cv_inout_to_bits,trace_conversions_$cv_inout_to_bits,2
 94 
 95                               " (bit (2) aligned) returns (char (8) aligned)
 96           TraceGate cv_bits_to_inout,trace_conversions_$cv_bits_to_inout,2
 97 
 98                               " (char (16) aligned) returns (fixed bin (34))
 99           TraceGate cv_n_to_number,trace_conversions_$cv_n_to_number,2
100 
101                               " (char (8)) returns (bit aligned)
102           TraceGate cv_onoff_to_bit,trace_conversions_$cv_onoff_to_bit,2
103 
104                               " (bit aligned) returns (char (8))
105           TraceGate cv_bit_to_onoff,trace_conversions_$cv_bit_to_onoff,2
106 
107                               " (char (256) var, ptr) returns (1 like stop_proc aligned)
108           TraceGate cv_entry_name_to_spp,trace_print_$cv_entry_name_to_spp,3
109 
110                               " (char (256) var, ptr) returns (1 like output_switch aligned)
111           TraceGate cv_file_path_to_osw,trace_print_$cv_file_path_to_osw,3
112 
113                               " (char (32) var) returns (1 like output_switch aligned)
114           TraceGate cv_stream_name_to_osw,trace_print_$cv_stream_name_to_osw,2
115 
116 
117 " METERS
118 
119                               " (fixed bin) returns (1 aligned like counts)
120           TraceGate entrypoint_counts,trace_tables_$entrypoint_counts,2
121 
122                               " (fixed bin) returns (1 aligned like meters)
123           TraceGate entrypoint_global_meters,trace_tables_$entrypoint_global_meters,2
124 
125                               " (fixed bin) returns (1 aligned like meters)
126           TraceGate entrypoint_local_meters,trace_tables_$entrypoint_local_meters,2
127 
128                               " entry () returns (1 like meters aligned)
129           TraceGate metered,trace_tables_$metered,1
130 
131                               " entry () returns (1 like meters aligned)
132           TraceGate removed,trace_tables_$removed,1
133 
134                               " entry ()
135           TraceGate reset_meters,trace_tables_$reset_meters,0
136 ^L
137 " ENTRYPOINTS
138 
139                               " (ptr unal) returns (fixed bin)
140           TraceGate entrypoint_index,trace_tables_$entrypoint_index,2
141 
142                               " (fixed bin) returns (char (256) var)
143           TraceGate entrypoint_name,trace_tables_$entrypoint_name,2
144 
145                               " (fixed bin) returns (ptr)
146           TraceGate entrypoint_ptr,trace_tables_$entrypoint_ptr,2
147 
148                               " (fixed bin) returns (char (256) var)
149           TraceGate entrypoint_seg_path,trace_tables_$entrypoint_seg_path,2
150 
151                               " (fixed bin) returns (char (32) var)
152           TraceGate entrypoint_status,trace_tables_$entrypoint_status,2
153 
154                               " (fixed bin) returns (bit aligned)
155           TraceGate function,trace_tables_$function,2
156 
157                               " () returns (fixed bin)
158           TraceGate num_entrypoints,trace_tables_$num_entrypoints,1
159 
160                               " () returns (fixed bin)
161           TraceGate num_specified_entrypoints,trace_tables_$num_specified_entrypoints,1
162 
163                               " (fixed bin) returns (fixed bin)
164           TraceGate specified_entrypoint_index,trace_tables_$specified_entrypoint_index,2
165 
166                               " (char (256) var, ptr)
167           TraceGate specify_entrypoints,trace_entrypoints_$specify_entrypoints,2
168 
169                               " (fixed bin) returns (fixed bin)
170           TraceGate translator_id,trace_tables_$translator_id,2
171 ^L
172 " LOCATIONS
173 
174 
175                               " (fixed bin) returns (ptr)
176           TraceGate location_ptr,trace_tables_$location_ptr,2
177 
178                               " (fixed bin) returns (char (256) var)
179           TraceGate location_seg_path,trace_tables_$location_seg_path,2
180 
181                               " (fixed bin) returns (1 aligned like values)
182           TraceGate location_values,trace_tables_$location_values,2
183 
184                               " () returns (fixed bin)
185           TraceGate num_locations,trace_tables_$num_locations,1
186 
187                               " () returns (fixed bin)
188           TraceGate num_specified_locations,trace_tables_$num_specified_locations,1
189 
190                               " (fixed bin) returns (fixed bin)
191           TraceGate specified_location_index,trace_tables_$specified_location_index,2
192 
193                               " (char (256) var)
194           TraceGate specify_locations,trace_tables_$specify_locations,1
195 
196                               " ()
197           TraceGate specify_changed_locations,trace_tables_$specify_changed_locations,0
198 ^L
199 " EVENT BUFFER
200 
201 
202                               " (fixed bin (34), fixed bin (34))
203           TraceGate buffer_counts,trace_print_$buffer_counts,2
204 
205                               " (fixed bin (34), fixed bin, char (2), ptr unal,
206                               "  1 like counts aligned, 1 like meters aligned)
207           TraceGate buffer_event,trace_print_$buffer_event,6
208 
209                               " (fixed bin (34)) returns (char (256) var)
210           TraceGate buffer_event_header,trace_print_$buffer_event_header,2
211 
212                               " (fixed bin (34)) returns (char (256) var)
213           TraceGate buffer_event_string,trace_print_$buffer_event_string,2
214 
215                               " () returns (ptr unal)
216           TraceGate buffer_ptr,trace_parameters_$buffer_ptr,1
217 ^L
218 " TRACE PARAMETERS
219 
220 
221                               " (fixed bin) returns (bit (2) aligned)
222           TraceGate arguments,trace_parameters_$arguments,2
223 
224                               " (bit (2) aligned)
225           TraceGate set_arguments,trace_parameters_$set_arguments,1
226 
227                               " (fixed bin) returns (char (256) var)
228           TraceGate call,trace_parameters_$call,2
229 
230                               " (char (256) var)
231           TraceGate set_call,trace_parameters_$set_call,1
232 
233                               " (fixed bin) returns (fixed bin (34))
234           TraceGate every,trace_parameters_$every,2
235 
236                               " (fixed bin (34))
237           TraceGate set_every,trace_parameters_$set_every,1
238 
239                               " (fixed bin) returns (fixed bin (34))
240           TraceGate first,trace_parameters_$first,2
241 
242                               " (fixed bin (34))
243           TraceGate set_first,trace_parameters_$set_first,1
244 
245                               " (fixed bin) returns (fixed bin (34))
246           TraceGate high,trace_parameters_$high,2
247 
248                               " (fixed bin (34))
249           TraceGate set_high,trace_parameters_$set_high,1
250 
251                               " (fixed bin) returns (fixed bin (34))
252           TraceGate last,trace_parameters_$last,2
253 
254                               " (fixed bin (34))
255           TraceGate set_last,trace_parameters_$set_last,1
256 
257                               " (fixed bin) returns (fixed bin (34))
258           TraceGate low,trace_parameters_$low,2
259 
260                               " (fixed bin (34))
261           TraceGate set_low,trace_parameters_$set_low,1
262 
263                               " (fixed bin) returns (bit aligned)
264           TraceGate new_high,trace_parameters_$new_high,2
265 
266                               " (bit aligned)
267           TraceGate set_new_high,trace_parameters_$set_new_high,1
268 
269                               " (fixed bin, bit aligned) returns (char (256) var)
270           TraceGate parms_string,trace_parameters_$parms_string,3
271 
272                               " () returns (bit aligned)
273           TraceGate parms_specified,trace_parameters_$parms_specified,1
274 
275                               " (fixed bin) returns (bit (2) aligned)
276           TraceGate stop,trace_parameters_$stop,2
277 
278                               " (bit (2) aligned)
279           TraceGate set_stop,trace_parameters_$set_stop,1
280 
281                               " (fixed bin) returns (fixed bin (34))
282           TraceGate stop_every,trace_parameters_$stop_every,2
283 
284                               " (fixed bin (34))
285           TraceGate set_stop_every,trace_parameters_$set_stop_every,1
286 
287                               " (fixed bin) returns (fixed bin (34))
288           TraceGate stop_low,trace_parameters_$stop_low,2
289 
290                               " (fixed bin (34))
291           TraceGate set_stop_low,trace_parameters_$set_stop_low,1
292 
293                               " (fixed bin) returns (bit (2) aligned)
294           TraceGate trace,trace_parameters_$trace,2
295 
296                               " (bit (2) aligned)
297           TraceGate set_trace,trace_parameters_$set_trace,1
298 ^L
299 " GLOBAL PARAMETERS
300 
301 
302                               " () returns (bit aligned)
303           TraceGate alm,trace_parameters_$alm,1
304 
305                               " (bit aligned)
306           TraceGate set_alm,trace_parameters_$set_alm,1
307 
308                               " () returns (bit aligned)
309           TraceGate automatic,trace_parameters_$automatic,1
310 
311                               " (bit aligned)
312           TraceGate set_automatic,trace_parameters_$set_automatic,1
313 
314                               " () returns (bit aligned)
315           TraceGate buffer,trace_parameters_$buffer,1
316 
317                               " (bit aligned)
318           TraceGate set_buffer,trace_parameters_$set_buffer,1
319 
320                               " () returns (bit aligned)
321           TraceGate calibrate,trace_parameters_$calibrate,1
322 
323                               " (bit aligned)
324           TraceGate set_calibrate,trace_parameters_$set_calibrate,1
325 
326                               " (fixed bin) returns (1 aligned like compensation)
327           TraceGate compensation,trace_parameters_$compensation,2
328 
329                               " (fixed bin, 1 aligned like compensation)
330           TraceGate set_compensation,trace_parameters_$set_compensation,2
331 
332                               " () returns (bit aligned)
333           TraceGate enabled,trace_parameters_$enabled,1
334 
335                               " (bit aligned)
336           TraceGate set_enabled,trace_parameters_$set_enabled,1
337 
338                               " () returns (char (256) var);
339           TraceGate global_parms_string,trace_parameters_$global_parms_string,1
340 
341                               " returns (bit aligned)
342           TraceGate long,trace_parameters_$long,1
343 
344                               " (bit aligned)
345           TraceGate set_long,trace_parameters_$set_long,1
346 
347                               " () returns (bit aligned)
348           TraceGate meter,trace_parameters_$meter,1
349 
350                               " (bit aligned)
351           TraceGate set_meter,trace_parameters_$set_meter,1
352 
353                               " () returns (1 like output_switch aligned)
354           TraceGate output_switch,trace_parameters_$output_switch,1
355 
356                               " (1 like output_switch aligned)
357           TraceGate set_output_switch,trace_parameters_$set_output_switch,1
358 
359                               " () returns (bit aligned)
360           TraceGate signals,trace_parameters_$signals,1
361 
362                               " (bit aligned)
363           TraceGate set_signals,trace_parameters_$set_signals,1
364 
365                               " () returns (1 like stop_proc aligned)
366           TraceGate stop_proc,trace_parameters_$stop_proc,1
367 
368                               " (1 like stop_proc aligned)
369           TraceGate set_stop_proc,trace_parameters_$set_stop_proc,1
370 
371                               " () returns (entry)
372           TraceGate stop_routine,trace_parameters_$stop_routine,1
373 
374                               " (entry)
375           TraceGate set_stop_routine,trace_parameters_$set_stop_routine,1
376 
377                               " () returns (entry)
378           TraceGate trace_routine,trace_parameters_$trace_routine,1
379 
380                               " (entry)
381           TraceGate set_trace_routine,trace_parameters_$set_trace_routine,1
382 
383                               " () returns (bit aligned)
384           TraceGate loud,trace_parameters_$loud,1
385 
386                               " (bit aligned)
387           TraceGate set_loud,trace_parameters_$set_loud,1
388 
389 
390 " MISCELLANEOUS
391 
392                               " () returns (bit aligned)
393           TraceGate in_trace,IN_TRACE,1
394 ^L
395 
396 TRACE_SETUP:
397           epaq      *                   get_lp without invoking trace_catch_
398           lprp4     pr7|stack_header.lot_ptr,*au
399 
400           ldx1      -2,2                get number of args expected
401           tze       0,2                 if zero, none or doesn't matter
402           cmpx1     ap|0                compare against number given
403           tze       0,2                 args match, call procedure
404           eaa       TRUE                          Take this out when
405           sta       pr7|stack_header.in_trace     trace becomes a real gate.
406           call6     trace_$SIGNAL_GATE_ERROR
407 
408           entry     SIGNAL_GATE_ERROR             Buff up before signalling.
409 SIGNAL_GATE_ERROR:
410           push
411           call      signal_$signal_(signal_arglist)
412           oct       0                   hopefully, it never returns
413 
414 
415 IN_TRACE:
416           lda       pr7|stack_header.in_trace
417           sta       pr0|2,*
418           short_return                  Life can be easy sometimes.
419 
420 
421 
422 " CONSTANTS
423 
424                     even
425 null_ptr:           oct       077777000043,000001000000
426 ptr_mask:           oct       077777000077,777777077077
427 
428 
429 " STATIC
430 
431                     use       static_section
432                     join      /link/static_section
433 
434                     even
435                     segdef    transaction_id
436 transaction_id:     dec       0,0
437 
438                     even
439                     segdef    stt_ptr
440 stt_ptr:            its       -1,1
441 
442                     even
443                     segdef    swt_ptr
444 swt_ptr:            its       -1,1
445 
446                     segdef    parameters_ptr
447 parameters_ptr:     oct       007777000001
448 
449                     even
450                     segdef    global_parameters
451                     bss       global_parameters,182
452 ^L
453 " SYMBOLS  SYMBOLS  SYMBOLS  SYMBOLS  SYMBOLS  SYMBOLS  SYMBOLS  SYMBOLS
454 
455           bool      TRUE,400000
456 
457 
458 
459           include   stack_header
460 
461           end