busTRACE This WEB page comes from the busTRACE 9.0 User's Manual. (Table of Contents)

Previous Topic Next Topic
 

By default, busTRACE shows you one I/O entry for each I/O captured in the I/O Capture List. For example, if a Test Unit Ready CDB is issued, or a Bulk URB is issued, you will see only one entry in the I/O Capture List. This is the more intuitive way of viewing I/O activity. It does not, however, show you how any I/O activity is interleaved.

What is interleaved I/O activity? Let's say you have two devices on the bus (same device type). Let's call these Device 1 and Device 2. You want to issue the same command to each device so you issue the command to Device 1 and, while the device is processing the command, you issue the same command to Device 2. What if Device 2 finishes the I/O before Device 1 (or vice-versa)? How will you know that if busTRACE only shows you one entry per I/O?

Let's review the above example, this time using actual results captured by busTRACE. We have a system with two DVD Recorders on it. Windows will "ping" the drives every few seconds to detect if media has been inserted or removed. By capturing I/O activity on both devices, we can view the Get Event Status Notification (GESN) CDB the operating system is submitting to both devices:

In the above example given, we can see the one GESN command sent to the first DVD Recorder and the second GESN command sent to the second DVD Recorder. Using this view, can you tell if the second command was sent before the first command finished? Can you tell if the first device finished the command before the second device? It is not always clear how I/O activity may be interleaved. You could configure busTRACE to also show you the End Time in the I/O Capture List. That would help somewhat.

The easiest way, and most powerful way, to view interleaved I/O activity is to split each captured I/O into two separate entries (one showing the I/O going down the I/O stack, the other showing the I/O going back up the I/O stack). This way, you can quickly see how I/Os are interleaved. Click the View Interleaved I/O Activity button , on the toolbar, to enable this feature.

By clicking on this option, using our same Get Event Status Notification (GESN) sample, we can clearly see when an I/O started and when it finished:

When we clicked on the interleave button on the toolbar, busTRACE automatically inserted an Interleave column into the I/O Capture List. Within that column, we can clearly see when an I/O started and when an I/O finished.

  • A blue solid line shows you where the I/O starts and where it finishes. In those cases where the Interleave column is not wide enough to show the entire line, a dashed line will appear instead. This is simply a visual cue letting you know you may want to widen the column width to view more interleave information.
  • The ability to show the interleave arrows is only available if you configure busTRACE to sort I/O activity based on the ascending I/O Counter (i.e. the default setting). If you change the sort conditions, each I/O will have a red asterisk (*) in the Interleave column. This signifies that the ability to show interleaved I/O activity will not be available until you sort the I/O activity based on the I/O Counter.

In our sample screenshot, we see that the GESN command was sent to the first DVD Recorder and then another GESN command was sent to the second DVD Recorder. The second DVD Recorder then finished its command followed by the first DVD Recorder.

Another benefit of this feature is its ability to show you what other I/O requests were generated to complete the initial I/O request. Let's take a USB flash drive as an example. Internal to the OS, there are two device objects created for this USB flash drive. One is going to be a storage class device object that processes SCSI Request Blocks (SRBs) and Command Descriptor Blocks (CDBs). Below that device object, is going to be a low-level USB device object that processes USB Request Blocks (URBs). Because busTRACE can capture both storage class I/O activity, and low-level USB bus activity, we'll be able to see both.

When USB flash drives represent themselves as removable media devices to the operating system (RMB bit set to 1 in Inquiry data), the OS pings the drive periodically with Test Unit Ready commands to see if media has been inserted or removed. Here is a sample screenshot with the I/O split into its starting and ending points (i.e. going down and back up the I/O stack):

The storage device object is given the green and white icon while the low-level USB device object is given the blue and white device icon. We can see the Test Unit Ready command the operating system is sending to check the status of the media. In order to process a Test Unit Ready CDB across the USB bus, the USB storage class driver (typically USBSTOR.SYS), builds up URBs to submit to the device. Once the appropriate URBs are finished, the original Test Unit Ready CDB can then be completed. In this example, we see that a Command Block Wrapper (CBW) bulk request is sent out to endpoint 02h. It is this CBW that submits the CDB to the device. After the CDB is sent, the status of the command is read back by reading in a Command Status Wrapper (CSW) bulk request from endpoint 81h.

Automatically moving between interleaved I/Os

If you are viewing interleaved I/O activity, and you have selected an I/O, you can press <F7> to have busTRACE automatically toggle between showing you the I/O request going down the I/O stack and the I/O request going back up the I/O stack.

In addition, the following alternate <F7> key presses are available:

Ctrl-<F7>: Find and move to the next I/O request that has a matching IRP Pointer.

Shift-<F7>: Find and move to the previous I/O request that has a matching IRP Pointer.

Track mouse movements over interleaved I/O activity

busTRACE is configured, by default, to track the mouse movement when you are moving the mouse over interleaved I/O activity: For example:

As the mouse moves over the captured I/O activity, busTRACE will show you a gradient background showing you where the I/O starts and where it finishes. The Interleave column also shows you the start and end point. In this example, we see that while a Test Unit Ready CDB is being processed, a CBW USB Irp and a CSW USB Irp are processed.

See Also: