home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / programming / servstat / !SERVstat / !Help next >
Encoding:
Text File  |  1998-06-22  |  11.8 KB  |  243 lines

  1.  
  2.  
  3.                         Module Service Call Statistics
  4.                         ==============================
  5.  
  6.                         
  7. Documentation for !SERVstat application version 0.10 20-Jun-1998
  8. for RISC OS 3.1 and later.
  9.  
  10. Issue: 0.10/T  22-Jun-1998, replaces:
  11.  
  12. Author: David J Ruck
  13.  
  14. Copyright © DEEJ Technology PLC 1998 
  15.  
  16.  
  17. Overview
  18. ========
  19.  
  20. The !SERVstat application provides information on the activity of all module 
  21. service calls occurring in your machine. It is intended for programmers who
  22. wish to debug a module's service call interface with the OS. It does this by
  23. showing exactly which calls are being made, when and in what quantity.
  24.  
  25.  
  26. Using !SERVstat
  27. ===============
  28.  
  29. When started !SERVstat installs its own icon on the icon bar, clicking on it 
  30. will display the main window. This window contains information on groups of 
  31. service calls.
  32.  
  33. Most service calls have a numeric value below 256 are located in the system 
  34. group. Other service calls have values based on their module SWI chunk 
  35. number, these are sorted into groups with a name based on the prefix of the 
  36. SWI’s. If the prefix is not available the hexadecimal chunk number will be 
  37. used instead.
  38.  
  39. Each group has its own entry, giving its name and a value and a graphic 
  40. display of this value, similar to the bars used in the Task manager's window.
  41. The value is either the total number of service calls handled by modules
  42. since  the application was first installed in the machine, or the number of
  43. calls  handled in a set time period. Switching between these displays is
  44. described in the !SERVstat menu section below.
  45.  
  46. The Main Window The first entry in the window is the total value of all the
  47.                 entries below. The system group contains the first 256 service
  48.                 calls and the other groups have 64  calls from the SWI chunk
  49.                 base onwards.
  50.  
  51. Sub Windows     Clicking on any of the module names (not the All Service Calls
  52.                 entry) will display a subwindow for that group. The contents
  53.                 of the window are similar to that of the main window, except
  54.                 that the number of calls (totals or per interval) for each
  55.                 service call are displayed. The first entry is the total for
  56.                 that module, as is displayed in the main window.
  57.                 
  58.                 Most documented service calls are displayed using their
  59.                 offical names. Those  not known by the program displayed as
  60.                 service <n>.
  61.  
  62. Counter Windows Clicking on the All Service Calls entry in the main window or
  63.                 any entry in a  subwindow will call up a counter window,
  64.                 similar to the one for Closing files  shown opposite, (it
  65.                 also resembles the X windows program xload).
  66.  
  67.                 The counter window shows the number of service calls (for an
  68.                 individual call or all calls in a group) occurring in the
  69.                 set interval, as a vertical line. The display scrolls to the
  70.                 left each interval to show a new value, thus the variation 
  71.                 in activity of a call or group can be monitored over a period
  72.                 of time.
  73.  
  74.                 It is easier to see sudden peaks of activity in a counter
  75.                 window than in the  main and subwindows, which do not need to
  76.                 be open once a counter window  has been called up. Any number
  77.                 of counter windows (memory permitting) can be active at once.
  78.  
  79.                 The counter window display automatically scales up and down
  80.                 to fit the  maximum value in the window. At the default scale
  81.                 4 OS units (1 rectangular  pixel) is equivalent to one call,
  82.                 each subsequent scale is half the last shown by  the
  83.                 horizontal grey lines. These do not represent values but show
  84.                 how many  times the height of the bars have been halved;
  85.                 e.g. 1 line = ½ scale, 2 lines = ¼  scale, 10 lines 1/1024th
  86.                 scale.
  87.  
  88.  
  89. Window menu 
  90. -----------
  91. The main window and all subwindows provide a menu, the entries are described
  92. below.
  93.  
  94. Totals          This affects the main window and all subwindows. When ticked
  95.                 the display of each window gives the total number of calls
  96.                 since the program was first started. The dark grey backed
  97.                 heading of each window will change to show; Total Service
  98.                 calls.
  99.  
  100. Per interval    This also affects the main window and all subwindows; it
  101.                 changes the displays to show the number of calls in a given
  102.                 time interval, set by Update rate below. The headings change
  103.                 to Service calls per rate (actual rate) ms. Where rate is
  104.                 the set rate and actual rate is the rate achieved, see below.
  105.  
  106. Update rate     The value entered into the writable sub menu determines the
  107.                 interval used when displaying in Per interval mode, and the
  108.                 update rate of counter windows, which always show the number
  109.                 of SWI's in this interval in both Totals and Per interval
  110.                 modes.
  111.  
  112.                 The value entered is in milliseconds (1/1000th sec), due to
  113.                 RISC OS limitations it is only possible to set the rate to
  114.                 the nearest 10ms, a minimum of 100ms is imposed. When using
  115.                 large values it should be noted that the new value only comes
  116.                 into effect on the next scheduled update.
  117.  
  118.                 If a lot of tasks are running or a number of subwindows or
  119.                 counter windows are open it may not be possible for the
  120.                 program to update its displays at very  high rates, this is
  121.                 automatically taken into account, and the values and sizes of 
  122.                 bars are corrected accordingly.
  123.  
  124. Scale           Bars in the main and subwindows are automatically scaled to fit                 the largest in the window by default, this can however, lead
  125.                 to the bars for small values disappearing. Clicking on the
  126.                 Scale option on the main menu toggles automatic and manual
  127.                 scaling, which is shown by a tick next to scale.
  128.  
  129.                 When using manual scaling values can be entered in the
  130.                 writable submenu, the top entry multiplies the size of the
  131.                 bar, and the bottom entry divides it. The example shows
  132.                 1/256th scaling. Some multipliers are not allowed when values
  133.                 becomes very large, to prevent integer overflow.
  134.  
  135. Tasks           !SERVstat monitors the service call activity of all active RISC                 OS tasks as  default. By using the task menu, the activity of
  136.                 a particular task can be  monitored in isolation, by choosing
  137.                 it’s name from the task list. This makes it easier to
  138.                 scrutinise the calls made by a task which is currently under
  139.                 test.
  140.                 
  141.                 The option Except SERVstat can be used to filter out any
  142.                 service calls issued while !SERVstat is active. The All
  143.                 Tasks entry will restore the default behaviour.
  144.  
  145. Zero Counts     This option will zero the counts for all service calls, which
  146.                 can be seen when displaying totals. All counter windows are
  147.                 also cleared. This option can be used after changing the task
  148.                 being monitored using the Tasks menu described above. This
  149.                 will clear the totals so that only calls from the particular
  150.                 task are displayed subsequently.
  151.  
  152.  
  153. Iconbar menu
  154. ------------
  155. Info            Displays program information and version number.
  156.  
  157. Display         Displays the main window, equivalent to clicking on the
  158.                 !SERVstat icon.
  159.  
  160. Reinit          This resets the totals since initialisation to zero, closes
  161.                 all subwindows and counter windows, and re-displays the main
  162.                 window.
  163.  
  164. Kill            Quits the application and kills the SERVmod module which
  165.                 performs the  counting of service calls. This ensures the
  166.                 small processing overhead imposed  by the module is removed.
  167.  
  168. Quit            Quits the application, the SERVmod module is not killed so if
  169.                 the program is run again, the service call totals will still
  170.                 have been incremented while the program was not running, see
  171.                 Technical details below.
  172.  
  173.  
  174.  
  175. Technical details
  176. =================
  177. !SERVstat works by installing a special module SERVmod. The details below are
  178. provided for users who may wish to use this  module in their own programs.
  179.  
  180. On initialisation the SERVmod module claims some workspace to store counts 
  181. of the first 256 (system) service calls, and then wait for service calls to
  182. be  issued in the normal manor. On receiving a service call >256 a new piece
  183. of  workspace is claimed to count 64 calls in the approprite SWI chunk range.
  184. The module conforms with the new service call table format, but requests all 
  185. service calls be given to it.
  186.  
  187. The SERVmod module is controlled using the following SWI’s. Note: The  SWI
  188. chunk number for APPmod is currently provisional and will change on 
  189. receiving official Acorn registration.
  190.  
  191. SERV_stat                !SERVstat uses this call every update interval to 
  192. (&C46C0 provisional)     read the current call counts, and calculate the
  193.                          correct values for the program displays.
  194.  
  195.                          A call to SWI_stat (no parameters required) returns
  196.                          a pointer in R0 to a  memory structure (type:
  197.                          main_str) which is described in C as:
  198.  
  199.         typedef struct
  200.         {
  201.             struct mod__str *chain_ptr;  /* pointer to chain of mod_str    */
  202.             int       serv_total;        /* total of all service call      */
  203.             int       sys_total;         /* total of 1st 256 services      */
  204.             int       counts[256];       /* usage counts for 1st 256 calls */
  205.         } main_str;
  206.         
  207.         typedef struct mod__str
  208.         {
  209.             struct mod__str *next_ptr;   /* pointer to next in chain       */
  210.             int       chunk_no;          /* chunk number of module         */
  211.             int       mod_total;         /* total of all services by module*/
  212.             int       counts[64];        /* usage counts for 64 mod calls  */
  213.         } mod_str;
  214.  
  215.                          The list structure can grow dynamically when a new
  216.                          service call range is encountered.
  217.  
  218. SERV_Zero                Calling this routine causes all the service call
  219. (&C46C1 provisional)     counts to be zeroed. Counting  continues immediately.
  220.  
  221. SERV_Control             This call is used to activate (R0 = 1) or suspend
  222. (&C46C2 provisional)     (R0 = 0) the modules counting  activity. While
  223.                          suspended the module still handles alls service
  224.                          calls, but computational overhead of the counting
  225.                          operation is removed.
  226.  
  227. (&C46C3 provisional)
  228. SERV_Filter              This call controls which tasks are monitored by
  229.                          SERVmod. The value of R0 and R1 control the operation.
  230.  
  231.                      R0 = 0  All tasks are monitored (default).
  232.                          R0 = 1  R1 = task handle to exclusively monitor.
  233.                      R0 = 2    R1 = task handle to exclude,
  234.                             i.e. monitor all except R1.
  235.                             
  236.                          The monitoring of tasks is performed using a WIMP post-                         filter mechanism, to  enable or disable the counting
  237.                          of service calls depending on the task the WIMP has 
  238.                          just switched in. Calls made by the operating system
  239.                          during a WIMP_Poll are assigned to the task which
  240.                          called it.
  241.  
  242. End of SERVstat User Guide.
  243.