Overlaying data pattern with “time”

STB Suite | The Industry Standard in Peripheral Testing.

DTB has the capability to overlay the data pattern with 3 different types of overlays – these are

  1. LBA Overlay
  2. Key Overlay
  3. Time Overlay

This article discusses how to overlay “Time” on the data pattern, how to do a data compare on the time overlay, and how this can be useful in determining whether or not you are “looking at” old data.

When you want a Time Overlay, you must create a SPECIAL_OPTIONS data structure and then pass a pointer to this data structure when you can VCSCSIAddDiskWriteTest.  Here is an example:

SPECIAL_OPTIONS sSO;
sSO.bOverlayKey = TRUE;
sSO.nOverlayKey = 0x17171717;
sSO.bOverlayTime = TRUE;
sSO.nTimeOverlayYear = 2017;
sSO.nTimeOverlayMonth = 6;
sSO.nTimeOverlayDay = 7;
sSO.nTimeOverlayHours = 9;
sSO.nTimeOverlayLeewayInMinutes = 120;

In the above example we want to overlay the time “June 7, 2017 9:00am”.  Notice we set bOverlayTime to TRUE.  In this example, we’re also overlaying a key on the data pattern – notice we set bOverlayKey to TRUE and also set nOverlayKey to 0x17171717 (you can set nOverlayKey to any 32-bit value).

So where do these overlays go in the data pattern?

  1. LBA Overlay is on bytes 0 thru 3 (for small drives) and bytes 0 thru 7 (for larger drives)
  2. Key Overlay is on bytes 4 thru 7 (for small drives) and bytes 8 thru 11 (for larger drives)
  3. Time Overlay is on bytes 8 thru 11 (for small drives) and bytes 12 thru 15 (for larger drives)

Here’s an example of passing this SPECIAL_OPTIONS data structure to our “AddDiskTest” API:

VCSCSIAddDiskWriteTest_Time(1,1,0,eIncrementing,NULL,TRUE,&sSO);

Here’s the data pattern that goes to drive:

In the above pic, the data pattern that went to the drive for LBA 0 is contained on the 2nd row (i.e. with Ctr = 16).  The pattern is

00 00 00 00 17 17 17 17 59 38 23 00 0C 0D 0E 0F

The first 4 bytes (00 00 00 00) is the LBA Overlay, the next 4 bytes (17 17 17 17) is our Key Overlay, the next 4 bytes (59 38 23 00) after that is the Time Overlay, and then bytes 12 and beyond is the “Incrementing” data pattern.

NOTE: If you are familiar with the time_t data type the 0x59382300 is the time_t data value for the date-time of “June 7, 2017 9:00am”.

DATA COMPARE ON THE TIME OVERLAY

 

In order to do data compare on the time overlay, you need to create a SPECIAL_OPTIONS data structure, setting the date-time parameters.  Here is an example:

SPECIAL_OPTIONS sSO;
sSO.bOverlayKey = TRUE;
sSO.nOverlayKey = 0x17171717;
sSO.bOverlayTime = TRUE;
sSO.nTimeOverlayYear = 2017;
sSO.nTimeOverlayMonth = 6;
sSO.nTimeOverlayDay = 8;
sSO.nTimeOverlayHours = 11;
sSO.nTimeOverlayLeewayInMinutes = 120;

Note in our example above we are expecting the time to be “June 8, 2017 11:00am” plus or minus 120 minutes (or 2 hours).  BUT note that when we wrote the data to the drive the time that we wrote was “June 7, 2017 9:00am” (so we will get a data miscompare on the Time Overlay!).

Here’s an example of calling our API to do a Read Test:

VCSCSIAddDiskReadTest_Blocks(1000000,1,0,eIncrementing,NULL,TRUE,TRUE,&sSO);

Here’s the BAM trace of retrieving data from the drive:

 

As we mentioned earlier we are expecting a data miscompare on the Time Overlay – here is what the logfile indicates:

Test Date:  06/08/2017  14:16:13
Device:  1:0:0   Vendor: SEAGATE, Product: ST4000NM0043, Serial: Z1Z0812R0000B324EN74, Version: 0003

Results:
06/08/2017  14:16:14  TEST 1 of 1:
Read Test; Sequential; for 1000000 Blocks
Fixed-Length Transfers of 128 (0x0080) Blocks
Start Block: 0 (0x0000000000000000), End Block: 943718399 (0x00000000383FFFFF)
Data Pattern: Incrementing w/ LBA Overlay; Data Compare ON
Queue Depth = 1

Start Time of IO: 14:16:14 and 259 ms
End Time of IO: 14:16:14 and 259 ms
06/08/2017  14:16:14  CDB = 28 00 00 00 00 00 00 00 80 00
Miscompare: LBA 0x0 at 0x00000008
Exp: 00 00 00 00 17 17 17 17 59 39 90 A0 0C 0D 0E 0F
Exp: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
Exp: 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
Exp: 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
Exp: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
Exp: 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
Exp: 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
Exp: 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
Exp: 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
Exp: 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
Exp: A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
Exp: B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
Exp: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
Exp: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Exp: E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
Exp: F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
Exp: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Exp: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
Exp: 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
Exp: 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
Exp: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
Exp: 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
Exp: 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
Exp: 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
Exp: 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
Exp: 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
Exp: A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
Exp: B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
Exp: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
Exp: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Exp: E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
Exp: F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
Act: 00 00 00 00 17 17 17 17 59 38 23 00 0C 0D 0E 0F
Act: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
Act: 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
Act: 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
Act: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
Act: 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
Act: 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
Act: 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
Act: 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
Act: 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
Act: A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
Act: B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
Act: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
Act: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Act: E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
Act: F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
Act: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Act: 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
Act: 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
Act: 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
Act: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
Act: 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
Act: 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
Act: 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
Act: 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
Act: 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
Act: A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
Act: B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
Act: C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
Act: D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
Act: E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
Act: F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
>>> Current Test Aborted <<<

06/08/2017  14:16:14                                              *** FAIL ***
——————————————————————————

Notice the test has failed due to a miscompare at offset 8 into the data (this is exactly were the Time Overlay was put).

The expected data is:
Exp: 00 00 00 00 17 17 17 17 59 39 90 A0 0C 0D 0E 0F

The actual data is:
Act: 00 00 00 00 17 17 17 17 59 38 23 00 0C 0D 0E 0F

Looking at bytes 8 thru 11 we see the expected data is 0x593990A0 (this is “June 8, 2017 11:00am) and the actual data is 0x59382300 (this is “June 7, 2017 9:00am).  Since the difference in the two date-time values exceeds 120 minutes, we get the data miscompare.

 

Using the Time Overlay to detect “OLD DATA”

In our example above, notice that bytes 12 thru 511 are identical for the “expected data” and the “actual data” (they are the “incrementing” data pattern).  BUT yet the test fails because the data we retrieved from the drive was considered “old”.  When we retrieved the data from the drive we were expecting the data to be atmost “2 hours old” – but in actuality the data was 26 hours old.  So eventhough the data from bytes 12 thru 511 might have been considered “A-OK”, it was not because the data is old.