To access the data pattern trigger it is necessary to use a fixed (not auto) link width in the recording options, so you must know if you are working with a x1,x2,x4 link. If you are not sure use Auto link width to capture a power on trace, then either use the dashboard tool to determine the current link width or observe the lights on the front panel of the analyser.
Assumption: The trace you are viewing an NVMe trace and decoded to NVM command level. However the technique is applicable in general to other technologies too.
Triggering on a file directory structure
To trigger on a directory structure in the trace, we can use a trick of triggering on the string “FILE0” in the payload as a way to find file system directory entries. First make sure you in advanced recording mode, using event trigger and a fixed lane width. Then on the recording rules tab filter create a TLP Data pattern trigger (click new event or right click in sequence)
Double click the TLP Payload box to open the configuration and enter asci codes for FILE0 observing the little endian ordering in each dWord (bytes appear in reverse order). Be careful when entering the 0x30 in the second dWord so the Match field is 0xFF only in the last byte otherwise you will force additional bytes to match. Click on the action tab and set it to trigger the analyser.
Tip: when you see the byte sequence you want in the data payload of the trace view you can determine the correct order for the trigger by using the data view and clicking little endian display option – the data view can be reached by right click the brown Data header region.
If you start recording the buffer to the left of the trigger position will operate in a circular mode (discarding the oldest data) until the trigger condition happens after which it will be a linear buffer until the remaining memory is used or the recording is stopped.
Triggering on a Starting LBA
To trigger on an LBA you first need to know the LBA pattern you will search for, a common LBA might be 0x00000000:0000003F which often maps to the first partition table on a disk or you may locate an LBA of interest from an existing trace looking at the SLBA field of an NVMe command for example in the picture below.
To setup the recording options, first make sure you in advanced recording mode, using event trigger and a fixed lane width. Then on the recording rules tab filter create a TLP Data pattern trigger (click new event or right click in sequence)
Double click the TLP Payload box to open the configuration and enter LBA in little endian byte ordering the first dWord being the low order LBA and the second dWord being the hi order LBA. For the example above you would enter 0x8F006000 in the first match field and 0x00000000 in the second dWord match field. If you wish to match a range of LBA’s then adjust the Mask field accordingly maybe changing it to 0x01FFFFFF to match from LBA 0x00000000:006000800 to 0x00000000:00600FFF. Click on the action tab and set it to trigger the analyser.
When you start recording, the buffer to the left of the trigger position will operate in a circular mode (discarding the oldest data) until the trigger condition happens after which it will be a linear buffer until the remaining memory is used or the recording is stopped.
Triggering on a file data pattern
If we know the string ‘Z3-16’ is in the text of a file we will access we can arrange to trigger on that text pattern.
First make sure you in advanced recording mode, using event trigger and a fixed lane width. Then on the recording rules tab filter create a TLP Data pattern trigger (click new event or right click in sequence)
Double click the TLP Payload box to open the configuration and enter asci codes for ‘Z3-16 ’ observing the little endian ordering in each dWord (bytes appear in reverse order). Be careful when entering the 0x36 in the second dWord so the Match field is 0xFF only in the last byte otherwise you will force additional bytes to match. Click on the action tab and set it to trigger the analyser.
Tip: when you see the byte sequence you want in the data payload of the trace view you can determine the correct order for the trigger by using the data view and clicking little endian display option – the data view can be reached by right click the brown Data header region.
The match is a sliding window therefore it is not necessary to match the data split observed in the trace view when locating the pattern to trigger on.
Additional Notes: |
1) The examples shown in this technical brief were based on using version 7.2 of the PCIe Protocol Suite. Some changes to the layout may be made in future versions and new features and tools added, but the general functionality described here should still be available too. |
|
2) Per the readme, the actual trigger position tagged in the final trace may by shown one or two chronological packets after the exact timestamp of the trigger. While the display attempts to compensate for this the hardware cannot determine a pattern match until the LCRC has been validated which may happen after the subsequent packet has started to be recorded necessitating it be attached to the following packet. Therefore it may be necessary to scroll up or down a packet at the packet level. If a logical view is invoked this delta may be exaggerated by the scatter gather of logical packets depending on their sequence order relative to the data trigger. |