#352 closed enhancement (fixed)

Improvements to analyze_multics

Reported by: Gary Dixon Owned by: Eric Swenson
Priority: major Milestone: MR12.9
Component: Tools Version:
Keywords: Cc:

Description

analyze_multics should be improved to enable use of exec_com scripts within the azm interactive environment. This would permit scripts to be written to display complex tables without requiring creation of a new request program.

For example, the header of an Event Channel Table (ECT) could be displayed by a script which uses the azm display -as STRUCTURE.ELEMENT to select individual data items and format them. exec_com code to display such tables is often much simpler to write and easier to maintain than an equivalent PL1 program.

An example of such output is shown below.

azm

azm:  sld >old_dumps>030121.0630.0.7
  ERF 030121.0630.0.7 in directory >old_dumps dumped at 03/01/21  0630.3 pst Mon.
  System-ID MR12.7 Version-ID MR12.7
Proc   6 DBR  16625434 running        on cpu a   Backup.SysDaemon.z

azm:  slp 0
Process   0, Initializer.SysDaemon.z, DBR  17007650

azm:  ec ect header

  Initializer.SysDaemon     2021-03-01 06:28:54
 Ring 4   Event Channel Table      at 361|16022

   --------- CHANNELS -----   Counts
    Total Channels                96
     Wait Channels                41
       Fast Chn in-use         0
       Fast Chn unassigned    36
       Regular Wait Chn        5
     Call Channels                55

   ---- PENDING MESSAGES --   Counts
               Wait Channel        0
               Call Channel        0
                ITT Channel        0

   ---------- METERS ------   Counts
              Total Wakeups   108912
               Wait Wakeups      399
               Call Wakeups   108513
                 ITT Tosses        0
     Control Points Waiting        0

   ---------- FLAGS -------   -------------
        Event Call Channels    Low Priority
      Control Point Wakeups      disabled

  ----------- LISTS -------   First Item
              Wait Channels   at 361|16200
              Call Channels   at 361|17206
  Pending Wait Channel Msgs     (none)
  Pending Call Channel Msgs     (none)
  Pending Interprocess Msgs     (none)

  ---------- STORAGE ------   -------------
                   ECT Area   at  361|15752      size:   1044 words
  Event Channel Index Table   at  533|174        size:    128 packed pointers

Code in the ect.azmec script might get data elements to be displayed in the CHANNELS section of the table.

                                                           &- Map array index numbers to names of items in that list.
 &set    Chn_Total {0}       Chn_Wait {1}       Chn_Call {2}   Ctl_Point_Wait &""
 &set Msg_Chn_Call {3}    Msg_Chn_ITT {4}   Msg_Chn_Wait {5}

                                                            &- Get pointers to thread heads from ECT Header
 &set ChnWaitP      &||[token -cmd "&(disp) &(ectP) -as ect_header.firstp&(Chn_Wait)"       &(match1)]
 &set ChnCallP      &||[token -cmd "&(disp) &(ectP) -as ect_header.firstp&(Chn_Call)"       &(match1)]
 &set MsgWaitP      &||[token -cmd "&(disp) &(ectP) -as ect_header.firstp&(Msg_Chn_Wait)"   &(match1)]
 &set MsgCallP      &||[token -cmd "&(disp) &(ectP) -as ect_header.firstp&(Msg_Chn_Call)"   &(match1)]
 &set Msg_ITTP      &||[token -cmd "&(disp) &(ectP) -as ect_header.firstp&(Msg_Chn_ITT)"    &(match1)]
 &set ChnWaitP      &||[if [equal null &(ChnWaitP)]  -then "  (none)"  -else "at &(ChnWaitP)"]
 &set ChnCallP      &||[if [equal null &(ChnCallP)]  -then "  (none)"  -else "at &(ChnCallP)"]
 &set MsgWaitP      &||[if [equal null &(MsgWaitP)]  -then "  (none)"  -else "at &(MsgWaitP)"]
 &set MsgCallP      &||[if [equal null &(MsgCallP)]  -then "  (none)"  -else "at &(MsgCallP)"]
 &set Msg_ITTP      &||[if [equal null &(Msg_ITTP)]  -then "  (none)"  -else "at &(Msg_ITTP)"]
                                                            &- These pointers may be needed to display those thread items

&if  &[nless &(Aheader) 1]  &then  &goto CHANNEL_DISPLAY    &- If MODE_STRING does not include header or brief_header
                                                            &-  then jump over code below to the CHANNEL_DISPLAY label.
 &- LOOP:  Count fast channels used in this ring.
  &set  Fast_Total         36
  &set  Fast_in_use         0
  &set  I 1
 &label CountFast
     &if &[ngreater &(I) &(Fast_Total)]   &then &goto CountFast_END
        &set     ChnBit       &[substr &(assigned_channels) &(I) 1]
        &set     Fast_in_use  &[plus &(Fast_in_use) &(ChnBit)     ]
        &set     I            &[plus &(I) 1                       ]
     &goto CountFast
 &label CountFast_END


                                                            &- Obtain ect_header data items to be displayed
                                                            &-   Items for brief_header or header
 &set CPWaits       &||[token -cmd "&(disp) &(ectP) -as ect_header.count&(Ctl_Point_Wait)" &(match1)]
 &set ChnTotal      &||[token -cmd "&(disp) &(ectP) -as ect_header.count&(Chn_Total)"      &(match1)]
 &set ChnWait       &||[token -cmd "&(disp) &(ectP) -as ect_header.count&(Chn_Wait)"       &(match1)]


 &set  Fast_unassigned  &[minus &(Fast_Total) &(Fast_in_use)]
 &set  Reg_Wait     &[plus &(ChnWait) -&(Fast_in_use) -&(Fast_unassigned) ]
 &set ChnCall       &||[token -cmd "&(disp) &(ectP) -as ect_header.count&(Chn_Call)"       &(match1)]
 &set MsgWait       &||[token -cmd "&(disp) &(ectP) -as ect_header.count&(Msg_Chn_Wait)"   &(match1)]
 &set MsgCall       &||[token -cmd "&(disp) &(ectP) -as ect_header.count&(Msg_Chn_Call)"   &(match1)]
 &set Msg_ITT       &||[token -cmd "&(disp) &(ectP) -as ect_header.count&(Msg_Chn_ITT)"    &(match1)]

Once all elements to be display had been gathered, the code could focus on displaying that data in a meaningful format. For example:

                                                            &- Display all (or selected) data items
&print                                                      &-   All levels of detail.
 &print &[flnnl "  ^24a  ^a ^a"  &(name_project)  &(dump_date_time) ]
 &print &[flnnl
&+              " Ring ^d   Event Channel Table      at ^a" &(initial_ring) &(ectP)]
 &print
 &print &"   --------- CHANNELS -----   Counts"
 &print &"    Total Channels              " &[flnnl "^3d" &(ChnTotal) ]
 &print &"     Wait Channels              " &[flnnl "^3d" &(ChnWait)  ]
 &print &"       Fast Chn in-use       " &[flnnl "^2d" &(Fast_in_use)     ]
 &print &"       Fast Chn unassigned   " &[flnnl "^2d" &(Fast_unassigned) ]
 &print &"       Regular Wait Chn      " &[flnnl "^2d" &(Reg_Wait)        ]
 &print &"     Call Channels              " &[flnnl "^3d" &(ChnCall)  ]
 &print

Change History (4)

comment:1 by Gary Dixon, 16 months ago

Here is a short exec_com that works both as a Multics exec_com and an azm exec_com. Its help file shows a simple syntax for invoking the exec_com.

2025-03-13  ec timestamp

Syntax as a command:  ec timestamp VIRTUAL_PTR

Function: Formats a pair of words at a given address as a Multics
timestamp string (in iso_long_date_time format).

Arguments:
VIRTUAL_PTR
   May be a segment number, name or symbolic address (e.g.  72|332,
   prds|332, or prds$last_recorded_time) followed by an offset or
   program entry point name.  For more detailed information on
   acceptable pointers type:  help virtual_pointers

Examples:
azm:  ec timestamp prds$last_recorded_time

  000000153615134141021041o  is:   2021-02-28 19:23:39.236897 pst

The actual timestamp.(ec azmec) code is shown below.

&version 2
&-
&- HISTORY COMMENTS:
&-  1) change(2025-03-09,GDixon):
&-     Initial version of this exec_com.
&-                                                      END HISTORY COMMENTS
&-
&trace &all off

&label timestamp_SETUP
&set timestamp_version 1.0
&set env      &[reverse_after &ec_path .]                   &- Determine environment in which this exec_com is running.
&if &[equal &(env) ec]                                      &-  A) exec_com command at Multics command level
&then &do
      &set disp dump_segment
      &end

&else &if &[equal &(env) azmec]                             &-  B) exec_com request within azm dump
&then &do
      &set disp display
      &end


&goto &ec_name_ENTRYPOINT


&label timestamp_ENTRYPOINT
&if &[equal &(env) ec]                                      &-  A) exec_com command at Multics command level
&then &do
      &set rzd_access &[equal [get_effective_access >sl1>phcs_] e]
                                                            &- Can user invoke ring_zero_dump command?
      &if &(rzd_access)                                     &- Use rzd to display hardcore data
      &then &set disp ring_zero_dump
                                                            &- dump_segment and ring_zero_dump both expect input
                                                            &- in the form:  SEG_NO|OFFSET FURTHER_OFFSET RANGE
                                                            &- For example: prds$last_recorded_time is at 72|332.
                                                            &-   rzd 72|332 0 2
      &set data &[ sbag "&&1&&2" &[ &(disp) &(1) 0 2 ] ]
      &end

&else &do                                                   &-  B) exec_com request within azm dump
                                                            &- azm dumps by:    SEG_NO|OFFSET
                                                            &-        or by:  SEG_NAME$REF_NAME
                                                            &-  which identifies a segment name and entry_point.
                                                            &-
                                                            &- Any further offset from one of th given POINTER forms above
                                                            &- is specified by adding +FURTHER_OFFSET to end of POINTER.
                                                            &- For example: prds$last_recorded_time is at 72|332.
                                                            &-     d prds$last_recorded_time 2
                                                            &-     d prds|332 2
                                                            &-     d   72|332 2
      &set data &[exs "string &&1&&2&&3&&4&&5&&6&&7&&8" [ &(disp) &(1) 2 ] ]
      &end

&print
&print &[flnnl "  ^ao  is:  ^( ^a^)"
&+         &(data)
&+         &[call date_time_$format iso_long_date_time &(data)b3        " "      " "      -out] ]
&-
&-           dcl  date_time_$format entry(   char(*),  fixed bin(71), char(*), char(*)) returns(char(250) var);
&-                date_time_$format      (time_format,    clock,      zone,    lang)     -->>   result_string
&print
&quit
Last edited 16 months ago by Gary Dixon (previous) (diff)

comment:3 by Eric Swenson, 14 months ago

Installed on GHM with install IDs MR12.9-1017, MR12.9-1018, and MR12.9-1019.

comment:4 by Eric Swenson, 14 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.