Monitoring Programs

rsg -l 1000 <rsg.dat

then it would be monitored by an MP allocview as

allocview rsg -l 1000 <rsg.dat
link evinit                # support procedures

$include "evdefs.icn"      # event definitions

procedure main(args)

   EvInit(args) | ...      # load and launch the SP

   while EvGet() do {      # request event in SP
         ...               # process event
      }

                           # final processing (if any)

end
EvGet(StructMask)

limits the kinds of events reported to those associated with structure access

link evinit

$include "evdefs.icn"

procedure main(args)

   EvInit(args) | stop("*** cannot load icode file ***")

   proact := table(0)

   # Tabulate procedure events.

   while EvGet(ProcMask) do
      proact[&eventcode] +:= 1

  # List the results.

   write("procedure calls:       ",right(proact[E_Pcall], 6)) 
   write("procedure returns:     ", right(proact[E_Pret], 6))
   write("procedure suspensions: ", right(proact[E_Psusp], 6))
   write("procedure failures:    ", right(proact[E_Pfail], 6))
   write("procedure resumptions: ", right(proact[E_Presum], 6))
   write("procedure removals:    ", right(proact[E_Prem], 6))

end
  E_Pcall    procedure call                
  E_Pfail    procedure failure              
  E_Prem     suspended procedure removal    
  E_Presum   procedure resumption           
  E_Pret     procedure return 
  E_Psusp    procedure suspension
procedure calls:        6333
procedure returns:       947
procedure suspensions: 15628
procedure failures:     5344
procedure resumptions: 15586
procedure removals:       42