home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / probe.zip / PROBE.DOC < prev    next >
Text File  |  1986-04-23  |  5KB  |  164 lines

  1.                 PROBE
  2.                 =====
  3.  
  4.                   By
  5.               Colin J. Stearman
  6.                  [71036,256]
  7.  
  8. PURPOSE
  9.  
  10.     To analyze the performance of a program to determine where
  11. optimization will be of the most benefit.
  12.  
  13. FEATURES
  14.  
  15.     * Samples user program 55 times a second
  16.     * Monitors routine currently being executed
  17.     * Displays results to screen or file
  18.     * Displays results by address and by decending use frequency
  19.     * Works with all memory model types
  20.     * Independent of source language type
  21.  
  22. OPERATION
  23.  
  24.     PROBE is invoked with the following command:
  25.  
  26.     PROBE PROG_NAME.[EXE|COM] PROG_ARG1 ... PROG_ARGn
  27.  
  28. It is essential that the program to be probed be given with its full
  29. extension. Any arguments it requires can then follow. The simplest
  30. form of command line is:
  31.  
  32.     PROBE PRTEST.EXE
  33.  
  34. This will analyze PRTEST.EXE which does not require any arguments. This
  35. happens to be a test program included with this package.
  36.  
  37. PROBE must have available to it the follwing files in the default
  38. directory:
  39.  
  40.     COMLOAD.COM
  41.     EXELOAD.EXE
  42.     progname.MAP
  43.  
  44. The first 2 are used to determine where DOS will load the program to
  45. be probed. The last is a map file created by the Microsoft linker
  46. LINK. The "/m" switch must be used when linking the program to
  47. provide a full map of the program. For example, the PRTEST program
  48. was linked with:
  49.  
  50.     LINK PRTEST/m;
  51.  
  52. As PROBE runs it first determines where the user program will be
  53. loaded and reports this to the user. Then it asks for the destination
  54. of the resulting data. This can be a file or the CRT screen.
  55.  
  56. PROBE then runs the user program and passes it any supplies arguments.
  57. As the program runs, PROBE is activated by the system clock and a
  58. note is made every 18mS of the routine or module currently being executed.
  59.  
  60. When the user program terminates, the PROBE results are written to
  61. the chosen output. First a table of results is generated in address
  62. order and then another table in decreasing count frequency order.
  63.  
  64.     One temporary file is created by PROBE. It is name "REGISTER"
  65. and is deleted when PROBE terminates normally. Also various
  66. self-expanatory error message may be issued during abnormal PROBE
  67. operation.
  68.  
  69.  
  70. ANALYZING RESULTS
  71.  
  72.     The routines or modules at the top of the second table are
  73. there because PROBE found them active more frequently then those
  74. below them.  This suggests that improving their efficiency will have
  75. the most effect on overall program performance.
  76.  
  77.     Beware of input/output routines when analyzing results. If
  78. the program waits for user input, PROBE will obviously find the
  79. program frequently in the associated routines. Thus these results can
  80. be misleading.  Routines which deliberately waste time should also be
  81. indentified when analyzing results.
  82.  
  83. EXAMPLE PROGRAM
  84.  
  85.     The program PRTEST supplied in this package was used to test
  86. PROBE. It is written in C and calls 5 routines each which "waste"
  87. twice as much time as the previous. A sixth routine is included (but
  88. never called) to check for bugs in identifying probed routines.
  89.  
  90. The typical results from the command:
  91.  
  92.     PROBE PRTEST.EXE
  93.  
  94. are:
  95.  
  96. PROBE: Program's base code segment is 69e7
  97. PROBE: Enter results filename (CR for screen)? (<CR> or filename)
  98. test1                (these lines output by PRTEST)
  99. test2                (  "     "      "   "     "  )
  100. test3                (  "     "      "   "     "  )
  101. test4                (  "     "      "   "     "  )
  102. test5                (  "     "      "   "     "  )
  103.  
  104.  
  105. PRTEST.EXE           Page 1         04-23-1986   05:51:32pm
  106.  
  107.         PROBE results by SYMBOL ADDRESS
  108.  
  109.   ADDRESS  |             SYMBOL                | COUNT
  110. ===========|===================================|========
  111. 0000:005D  |  _test1                           |       8
  112. 0000:008E  |  _test2                           |      14
  113. 0000:00BF  |  _test3                           |      23
  114. 0000:00F0  |  _test4                           |      29
  115. 0000:0121  |  _test5                           |      37
  116. ========================================================
  117.  
  118.  
  119. PRTEST.EXE           Page 2         04-23-1986   05:51:32pm
  120.  
  121.         PROBE results by COUNT
  122.  
  123.   COUNT    |             SYMBOL                |PERCENT
  124. ===========|===================================|========
  125.       37   |  _test5                           |  33.33%
  126.       29   |  _test4                           |  26.13%
  127.       23   |  _test3                           |  20.72%
  128.       14   |  _test2                           |  12.61%
  129.        8   |  _test1                           |   7.21%
  130. ========================================================
  131.  
  132.  
  133. End of PROBE analysis report
  134.  
  135. As expected, the second report indicates that most time was spent in
  136. "_test5" with decreasing amounts through to "_test1".  As "_test6"
  137. was not called it does not appear.
  138.  
  139. CONCLUSION
  140.  
  141.     You should have the following files in the ARC file:
  142.  
  143.         PROBE.EXE
  144.         COMLOAD.COM
  145.         EXELOAD.EXE
  146.         PRTEST.C
  147.         PRTEST.EXE
  148.         PRTEST.MAP
  149.         PROBE.DOC
  150.  
  151. If you find this program useful I would be pleased to hear from you. Leave
  152. me some EMAIL. Any comments on improvements or changes would be
  153. welcome.
  154.  
  155. ACKNOWLEDGEMENTS
  156.  
  157.     PROBE is based on a program I found on CompuServe called
  158. PROFILE. I do not know the name of the author but wish to acknowledge
  159. his efforts.
  160.  
  161. COLIN STEARMAN [71036,256]
  162.  
  163.                 ====*****====
  164.