MAP - map trace in the trace package

Description:

The map trace is certainly one of the most useful types of traces available -- both for debugging and instrumentation purposes. Instrumentation, as used in this context, implies measurement of a program's efficiency. By engaging a map trace on his program and allowing the traced program to run to completion, the user can then display a "map" showing partitioned segments of core and the number of instructions which were executed in each such segment. Thus, heavily used areas of code can be identified at a glance and appropriate action can be taken to optimize these areas.

This is the only type of trace which requires the tracing region specification to consist of a single interval. Note that, as before, a null response to the tracing region request implicitly defines the absolute interval, 0-777777A.

The trace package is currently assembled with a 512 (decimal) word area dedicated for mapping. Depending on the size of the specified tracing region interval, each word of the dedicated area will correspond to some subdivided interval of the tracing region. Thus, whenever the trace mechanism executes an instruction which is in the tracing region, it determines what subdivision the instruction is in and simply increments the corresponding word in the map area by one. Repeat-type instructions will, however, increment according to the number of times the repeated instruction(s) were executed. Note that it is possible for the repeat and the instruction(s) influenced by it to be in different subdivisions.

The size of each subdivision is a function of the tracing region specification and will be determined as follows:

  1. The total number of locations (N) implied by the tracing region interval (A1-A2) is computed; e.g., N=A2-A1+1.
  2. A trial subdivision size is now determined. It is the integral part of the quotient resulting from the division, (N+511)/511.
  3. If the trial subdivision size is an even power of two (e.g., 1,2,4,8,...), then this is the size which will be used; otherwise, the first power of two which is greater than the trial size will be used.

The user will find that it generally takes at least two map trace runs to identify the actual code which is monopolizing the processor. Thus, suspect areas can be isolated by first using a relatively large tracing region specification. After displaying the map for this run, the user can then select the subdivision interval having the most activity and rerun again using this interval as the tracing region. The second run will thus provide a finer resolution. Note that the save and restore commands enable a convenient means of making repeated runs.

Copyright © 1996, Thinkage Ltd.