OSCILLOSCOPE FIGURE
The Oscilloscope figure (example) is one of the most useful figures for analyzing and debugging fine-grained
real-time performance. It allows the visualization of very large amounts of interval data, and
makes it easy to visually find problems in performance - the faulty intervals are often
immediately discernible by looking at them in the display.
The Oscilloscope figure shows events over time. Time is read like a book: from left to right in
strips and from top to bottom, one strip after the next. Different streams are shown in
different colors. Each strip is called a period.
On a large high-resolution display, you can display about 400 strips, each of which is close to 2000
pixels wide. If you choose a period of 2 milliseconds per strip, you will be able to view 0.8
seconds of execution at microsecond resolution.
The Oscilloscope figure supports all of the standard buttons, mouse operations, and play controls.
In addition, it has the following controls:
Special Buttons
- Cycle Through Interleave Modes.
See the discussion below.
- Controls Folding.
See the discussion below.
- Strips Slider. The left-hand slider controls the height of the strips. You can
display as few as one strip, or as many as several hundred. Taller strips make it easier to see
details of local behavior, thinner strips make it possible to view more data
- Period Slider. Controls the amount of time represented by each strip.
Special Mouse Actions
- Manual Phase Alignment. The right mouse button is used for manual phase alignment.
If you think you see a pattern in the data on the screen, right-drag a line through it. This will
cause the period of the strips to be adjusted so that the events in the line are directly on
top of each other.
Interleaving
If you are looking at multiple streams of events that can occur at the same time, you may want to
view each one as its own strip. To do so, use the Configure button to set the Period Interleaving
to a value greater than one. If you select an interleaving of 3, for example, each group of 3
strips will represent a single period, and the different event types will be distributed among the 3
strips. Often it is desirable to choose an interleaving equal to the number of event types, but
this is not necessary.
Interleaving is most useful with a relatively small number of strips, since in this case it is
relatively easy to see the groupings (when there are few strips, horizontal lines are drawn to
separate the interleaved groups).
You can also choose the "Interleaved Split Screen" check box, in which case the event streams are
shown in their own sub-divisions of the figure. This makes it easier to visualize more data, but
harder to correlate events between streams.
Folding
When you need to visualize even more data than a standard Oscilloscope view can provide, you can use
the Folding feature - especially when the data has a periodic behavior. Folding takes a number of
adjacent strips and folds them on top of each other, using the existing alignment in the display.
When many events of the same type are aligned, then folding will produce a dark region of the same
color at the same point in the period. However, if they are not aligned, it will produce a lightly
colored smear across the strip. If multiple event types are folded, their colors will be blended.
Folding can be used for instance to visualize the performance of a high-frequency periodic thread.
If the thread is supposed to have a period of 50 microseconds, you can set the period width to
exactly that value (using the Configure dialog) and then fold the data. A perfectly scheduled
thread would show dark regions of color exactly aligned in a column down the screen. If there are
outliers here and there, they will appear as lightly colored areas on either side of the strongly
periodic data.
Folding factors of a hundred and more can be used. Thus for periodic activity you can use folding
to visualize over a minute of data at microsecond resolution.