smartmontools SVN Rev 5640
Utility to control and monitor storage systems with "S.M.A.R.T."
farmprint.cpp
Go to the documentation of this file.
1/*
2 * farmprint.cpp
3 *
4 * Home page of code is: https://www.smartmontools.org
5 *
6 * Copyright (C) 2021 - 2023 Seagate Technology LLC and/or its Affiliates
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11#include "config.h"
12
13#define __STDC_FORMAT_MACROS 1
14#include <string>
15#include <inttypes.h>
16#include "farmprint.h"
17#include "smartctl.h"
18
19/*
20 * Get the recording type descriptor from FARM.
21 * Stored as bitmask in log pag 1 byte offset 336-343. (Seagate FARM Spec Rev 4.23.1)
22 *
23 * @param driveRecordingType: Constant 64-bit integer recording type descriptor (const uint64_t)
24 * @return: Constant reference to string literal (const char *)
25 */
26static const char* farm_get_recording_type(const uint64_t driveRecordingType) {
27 switch (driveRecordingType & 0x3) {
28 case 0x1:
29 return "SMR";
30 case 0x2:
31 return "CMR";
32 default :
33 return "UNKNOWN";
34 }
35}
36
37/*
38 * Get the form factor descriptor from FARM.
39 * Stored as integer in log pag 1 byte offset 336-343. (Seagate FARM Spec Rev 4.23.1)
40 * Consistent with definitions in ACS-3 Table A.32, SBC-4 Table 263.
41 *
42 * @param formFactor: Constant 64-bit integer form factor descriptor (const uint64_t)
43 * @return: Constant reference to string literal (const char *)
44 */
45static const char* farm_get_form_factor(const uint64_t formFactor) {
46 switch (formFactor & 0xF) {
47 case 0x1:
48 return "5.25 inches";
49 case 0x2:
50 return "3.5 inches";
51 case 0x3:
52 return "2.5 inches";
53 case 0x4:
54 return "1.8 inches";
55 case 0x5:
56 return "< 1.8 inches";
57 default :
58 return 0;
59 }
60}
61
62/*
63 * Output the 64-bit integer value of a FARM parameter by head in plain text format
64 *
65 * @param desc: Description of the parameter (const char *)
66 * @param paramArray: Reference to int64_t array containing paramter values for each head (const int64_t *)
67 * @param numHeads: Constant 64-bit integer representing ASCII description of the device interface (const uint64_t)
68 */
69static void farm_print_by_head_to_text(const char* desc, const int64_t* paramArray, const uint64_t numHeads) {
70 for (uint8_t hd = 0; hd < (uint8_t)numHeads; hd++) {
71 jout("\t\t%s %" PRIu8 ": %" PRIu64 "\n", desc, hd, paramArray[hd]);
72 }
73}
74
75/*
76 * Add the 64-bit integer value of a FARM parameter by head to json element
77 *
78 * @param jref: Reference to a JSON element
79 * @param buffer: Reference to character buffer (char *)
80 * @param desc: Description of the parameter (const char *)
81 * @param paramArray: Reference to int64_t array containing paramter values for each head (const int64_t *)
82 * @param numHeads: Constant 64-bit integer representing ASCII description of the device interface (const uint64_t)
83 */
84static void farm_print_by_head_to_json(const json::ref & jref, char (& buffer)[128], const char* desc,
85 const int64_t* paramArray, const uint64_t numHeads) {
86 for (uint8_t hd = 0; hd < (uint8_t)numHeads; hd++) {
87 snprintf(buffer, sizeof(buffer), "%s_%" PRIu8, desc, hd);
88 jref[buffer] = paramArray[hd];
89 }
90}
91
92/*
93 * Swap adjacent 16-bit words of an unsigned 64-bit integer.
94 *
95 * @param param: Constant reference to an unsigned 64-bit integer (const uint64_t *)
96 * @return result
97 */
98static uint64_t farm_byte_swap(const uint64_t param) {
99 const uint64_t even_bytes = 0x0000FFFF0000FFFF;
100 const uint64_t odd_bytes = 0xFFFF0000FFFF0000;
101 return ((param & even_bytes) << 16) | ((param & odd_bytes) >> 16);
102}
103
104/*
105 * Formats an unsigned 64-bit integer into a big-endian null-terminated ascii string.
106 *
107 * @param buffer: Constant reference to character buffer (char *)
108 * @param param: Constant 64-bit integer containing ASCII FARM field information (const uint64_t)
109 * @return reference to the char buffer containing a null-terminated string
110 */
111static char* farm_format_id_string(char* buffer, const uint64_t param) {
112 uint8_t val;
113 uint8_t j = 0;
114 size_t str_size = sizeof(param) / sizeof(buffer[0]);
115
116 for (uint8_t i = 0; i < str_size; i++) {
117 val = (param >> ((str_size - i - 1) * 8)) & 0xFF;
118 if (32 <= val && val < 127) {
119 buffer[j] = val;
120 j++;
121 }
122 }
123 buffer[j] = '\0';
124 return buffer;
125}
126
127/*
128 * Overload function to format and concat two 8-byte FARM fields.
129 *
130 * @param buffer: Constant reference to character buffer (char *)
131 * @param param1: Constant 64-bit integer containing the low 8 bytes of the FARM field (const uint64_t)
132 * @param param2: Constant 64-bit integer containing the high 8 bytes of the FARM field (const uint64_t)
133 * @return reference to char buffer containing a null-terminated string
134 */
135static char* farm_format_id_string(char* buffer, const uint64_t param1, const uint64_t param2) {
137 farm_format_id_string(&buffer[strlen(buffer)], param1);
138 return buffer;
139}
140
141/////////////////////////////////////////////////////////////////////////////////////////
142// Seagate ATA Field Access Reliability Metrics (FARM) log (Log 0xA6)
143
144/*
145 * Prints parsed FARM log (GP Log 0xA6) data from Seagate
146 * drives already present in ataFarmLogFrame structure
147 *
148 * @param farmLog: Constant reference to parsed farm log (const ataFarmLog&)
149 */
150void ataPrintFarmLog(const ataFarmLog& farmLog) {
151 // Request feedback on FARM output on big-endian systems
152 if (isbigendian()) {
153 jinf("FARM support was not tested on Big Endian platforms by the developers.\n"
154 "Please report success/failure to " PACKAGE_BUGREPORT "\n\n");
155 }
156
157 char buffer[128]; // Generic character buffer
158
159 // Get device information
160 char serialNumber[sizeof(farmLog.driveInformation.serialNumber) + sizeof(farmLog.driveInformation.serialNumber2) + 1];
162
163 char worldWideName[64];
164 snprintf(worldWideName, sizeof(worldWideName), "0x%" PRIx64 "%" PRIx64, farm_byte_swap(farmLog.driveInformation.worldWideName),
166
167 char deviceInterface[sizeof(farmLog.driveInformation.deviceInterface)];
169
170 const char* formFactor = farm_get_form_factor(farmLog.driveInformation.factor);
171
172 char firmwareRev[sizeof(farmLog.driveInformation.firmwareRev) + sizeof(farmLog.driveInformation.firmwareRev2) + 1];
174
175 char modelNumber[sizeof(farmLog.driveInformation.modelNumber) + 1];
176 modelNumber[0] = '\0';
177 for (uint8_t i = 0; i < sizeof(farmLog.driveInformation.modelNumber) / sizeof(farmLog.driveInformation.modelNumber[0]); i++) {
178 farm_format_id_string(&modelNumber[strlen(modelNumber)], farm_byte_swap(farmLog.driveInformation.modelNumber[i]));
179 }
180
181 const char* recordingType = farm_get_recording_type(farmLog.driveInformation.driveRecordingType);
182
183 char dateOfAssembly[sizeof(farmLog.driveInformation.dateOfAssembly)];
184 memcpy(dateOfAssembly, &farmLog.driveInformation.dateOfAssembly, sizeof(farmLog.driveInformation.dateOfAssembly));
185
186 // Print plain-text
187 jout("Seagate Field Access Reliability Metrics log (FARM) (GP Log 0xa6)\n");
188 // Page 0: Log Header
189 jout("\tFARM Log Page 0: Log Header\n");
190 jout("\t\tFARM Log Version: %" PRIu64 ".%" PRIu64 "\n", farmLog.header.majorRev, farmLog.header.minorRev);
191 jout("\t\tPages Supported: %" PRIu64 "\n", farmLog.header.pagesSupported);
192 jout("\t\tLog Size: %" PRIu64 "\n", farmLog.header.logSize);
193 jout("\t\tPage Size: %" PRIu64 "\n", farmLog.header.pageSize);
194 jout("\t\tHeads Supported: %" PRIu64 "\n", farmLog.header.headsSupported);
195 jout("\t\tNumber of Copies: %" PRIu64 "\n", farmLog.header.copies);
196 jout("\t\tReason for Frame Capture: %" PRIu64 "\n", farmLog.header.frameCapture);
197
198 // Page 1: Drive Information
199 jout("\tFARM Log Page 1: Drive Information\n");
200 jout("\t\tSerial Number: %s\n", serialNumber);
201 jout("\t\tWorld Wide Name: %s\n", worldWideName);
202 jout("\t\tDevice Interface: %s\n", deviceInterface);
203 jout("\t\tDevice Capacity in Sectors: %" PRIu64 "\n", farmLog.driveInformation.deviceCapacity);
204 jout("\t\tPhysical Sector Size: %" PRIu64 "\n", farmLog.driveInformation.psecSize);
205 jout("\t\tLogical Sector Size: %" PRIu64 "\n", farmLog.driveInformation.lsecSize);
206 jout("\t\tDevice Buffer Size: %" PRIu64 "\n", farmLog.driveInformation.deviceBufferSize);
207 jout("\t\tNumber of Heads: %" PRIu64 "\n", farmLog.driveInformation.heads);
208 jout("\t\tDevice Form Factor: %s\n", formFactor);
209 jout("\t\tRotation Rate: %" PRIu64 " rpm\n", farmLog.driveInformation.rotationRate);
210 jout("\t\tFirmware Rev: %s\n", firmwareRev);
211 jout("\t\tATA Security State (ID Word 128): 0x016%" PRIx64 "\n", farmLog.driveInformation.security);
212 jout("\t\tATA Features Supported (ID Word 78): 0x016%" PRIx64 "\n", farmLog.driveInformation.featuresSupported);
213 jout("\t\tATA Features Enabled (ID Word 79): 0x%016" PRIx64 "\n", farmLog.driveInformation.featuresEnabled);
214 jout("\t\tPower on Hours: %" PRIu64 "\n", farmLog.driveInformation.poh);
215 jout("\t\tSpindle Power on Hours: %" PRIu64 "\n", farmLog.driveInformation.spoh);
216 jout("\t\tHead Flight Hours: %" PRIu64 "\n", farmLog.driveInformation.headFlightHours);
217 jout("\t\tHead Load Events: %" PRIu64 "\n", farmLog.driveInformation.headLoadEvents);
218 jout("\t\tPower Cycle Count: %" PRIu64 "\n", farmLog.driveInformation.powerCycleCount);
219 jout("\t\tHardware Reset Count: %" PRIu64 "\n", farmLog.driveInformation.resetCount);
220 jout("\t\tSpin-up Time: %" PRIu64 " ms\n", farmLog.driveInformation.spinUpTime);
221 jout("\t\tTime to ready of the last power cycle: %" PRIu64 " ms\n", farmLog.driveInformation.timeToReady);
222 jout("\t\tTime drive is held in staggered spin: %" PRIu64 " ms\n", farmLog.driveInformation.timeHeld);
223 jout("\t\tModel Number: %s\n", modelNumber);
224 jout("\t\tDrive Recording Type: %s\n", recordingType);
225 jout("\t\tMax Number of Available Sectors for Reassignment: %" PRIu64 "\n", farmLog.driveInformation.maxNumberForReasign);
226 jout("\t\tAssembly Date (YYWW): %s\n", dateOfAssembly);
227 jout("\t\tDepopulation Head Mask: %" PRIx64 "\n", farmLog.driveInformation.depopulationHeadMask);
228
229 // Page 2: Workload Statistics
230 jout("\tFARM Log Page 2: Workload Statistics\n");
231 jout("\t\tTotal Number of Read Commands: %" PRIu64 "\n", farmLog.workload.totalReadCommands);
232 jout("\t\tTotal Number of Write Commands: %" PRIu64 "\n", farmLog.workload.totalWriteCommands);
233 jout("\t\tTotal Number of Random Read Commands: %" PRIu64 "\n", farmLog.workload.totalRandomReads);
234 jout("\t\tTotal Number of Random Write Commands: %" PRIu64 "\n", farmLog.workload.totalRandomWrites);
235 jout("\t\tTotal Number Of Other Commands: %" PRIu64 "\n", farmLog.workload.totalNumberofOtherCMDS);
236 jout("\t\tLogical Sectors Written: %" PRIu64 "\n", farmLog.workload.logicalSecWritten);
237 jout("\t\tLogical Sectors Read: %" PRIu64 "\n", farmLog.workload.logicalSecRead);
238 jout("\t\tNumber of dither events during current power cycle: %" PRIu64 "\n", farmLog.workload.dither);
239 jout("\t\tNumber of times dither was held off during random workloads: %" PRIu64 "\n", farmLog.workload.ditherRandom);
240 jout("\t\tNumber of times dither was held off during sequential workloads: %" PRIu64 "\n", farmLog.workload.ditherSequential);
241 jout("\t\tNumber of Read commands from 0-3.125%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius1);
242 jout("\t\tNumber of Read commands from 3.125-25%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius2);
243 jout("\t\tNumber of Read commands from 25-75%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius3);
244 jout("\t\tNumber of Read commands from 75-100%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius4);
245 jout("\t\tNumber of Write commands from 0-3.125%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius1);
246 jout("\t\tNumber of Write commands from 3.125-25%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius2);
247 jout("\t\tNumber of Write commands from 25-75%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius3);
248 jout("\t\tNumber of Write commands from 75-100%% of LBA space for last 3 SMART Summary Frames: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius4);
249
250 // Page 3: Error Statistics
251 jout("\tFARM Log Page 3: Error Statistics\n");
252 jout("\t\tUnrecoverable Read Errors: %" PRIu64 "\n", farmLog.error.totalUnrecoverableReadErrors);
253 jout("\t\tUnrecoverable Write Errors: %" PRIu64 "\n", farmLog.error.totalUnrecoverableWriteErrors);
254 jout("\t\tNumber of Reallocated Sectors: %" PRIu64 "\n", farmLog.error.totalReallocations);
255 jout("\t\tNumber of Read Recovery Attempts: %" PRIu64 "\n", farmLog.error.totalReadRecoveryAttepts);
256 jout("\t\tNumber of Mechanical Start Failures: %" PRIu64 "\n", farmLog.error.totalMechanicalStartRetries);
257 jout("\t\tNumber of Reallocated Candidate Sectors: %" PRIu64 "\n", farmLog.error.totalReallocationCanidates);
258 jout("\t\tNumber of ASR Events: %" PRIu64 "\n", farmLog.error.totalASREvents);
259 jout("\t\tNumber of Interface CRC Errors: %" PRIu64 "\n", farmLog.error.totalCRCErrors);
260 jout("\t\tSpin Retry Count: %" PRIu64 "\n", farmLog.error.attrSpinRetryCount);
261 jout("\t\tSpin Retry Count Normalized: %" PRIu64 "\n", farmLog.error.normalSpinRetryCount);
262 jout("\t\tSpin Retry Count Worst: %" PRIu64 "\n", farmLog.error.worstSpinRretryCount);
263 jout("\t\tNumber of IOEDC Errors (Raw): %" PRIu64 "\n", farmLog.error.attrIOEDCErrors);
264 jout("\t\tCTO Count Total: %" PRIu64 "\n", farmLog.error.attrCTOCount);
265 jout("\t\tCTO Count Over 5s: %" PRIu64 "\n", farmLog.error.overFiveSecCTO);
266 jout("\t\tCTO Count Over 7.5s: %" PRIu64 "\n", farmLog.error.overSevenSecCTO);
267
268 // Page 3 flash-LED information
269 uint8_t index;
270 size_t flash_led_size = sizeof(farmLog.error.flashLEDArray) / sizeof(farmLog.error.flashLEDArray[0]);
271 jout("\t\tTotal Flash LED (Assert) Events: %" PRIu64 "\n", farmLog.error.totalFlashLED);
272 jout("\t\tIndex of the last Flash LED: %" PRIu64 "\n", farmLog.error.indexFlashLED);
273 for (uint8_t i = flash_led_size; i > 0; i--) {
274 index = (i - farmLog.error.indexFlashLED + flash_led_size) % flash_led_size;
275 jout("\t\tFlash LED Event %" PRIuMAX ":\n", static_cast<uintmax_t>(flash_led_size - i));
276 jout("\t\t\tEvent Information: 0x%016" PRIx64 "\n", farmLog.error.flashLEDArray[index]);
277 jout("\t\t\tTimestamp of Event %" PRIuMAX " (hours): %" PRIu64 "\n", static_cast<uintmax_t>(flash_led_size - i), farmLog.error.universalTimestampFlashLED[index]);
278 jout("\t\t\tPower Cycle Event %" PRIuMAX ": %" PRIx64 "\n", static_cast<uintmax_t>(flash_led_size - i), farmLog.error.powerCycleFlashLED[index]);
279 }
280
281 // Page 3 unrecoverable errors by-head
282 jout("\t\tUncorrectable errors: %" PRIu64 "\n", farmLog.error.uncorrectables);
283 jout("\t\tCumulative Lifetime Unrecoverable Read errors due to ERC: %" PRIu64 "\n", farmLog.error.cumulativeUnrecoverableReadERC);
284 for (uint8_t hd = 0; hd < (uint8_t)farmLog.driveInformation.heads; hd++) {
285 jout("\t\tCum Lifetime Unrecoverable by head %" PRIu8 ":\n", hd);
286 jout("\t\t\tCumulative Lifetime Unrecoverable Read Repeating: %" PRIu64 "\n", farmLog.error.cumulativeUnrecoverableReadRepeating[hd]);
287 jout("\t\t\tCumulative Lifetime Unrecoverable Read Unique: %" PRIu64 "\n", farmLog.error.cumulativeUnrecoverableReadUnique[hd]);
288 }
289
290 // Page 4: Environment Statistics
291 jout("\tFARM Log Page 4: Environment Statistics\n");
292 jout("\t\tCurrent Temperature (Celsius): %" PRIu64 "\n", farmLog.environment.curentTemp);
293 jout("\t\tHighest Temperature: %" PRIu64 "\n", farmLog.environment.highestTemp);
294 jout("\t\tLowest Temperature: %" PRIu64 "\n", farmLog.environment.lowestTemp);
295 jout("\t\tAverage Short Term Temperature: %" PRIu64 "\n", farmLog.environment.averageTemp);
296 jout("\t\tAverage Long Term Temperature: %" PRIu64 "\n", farmLog.environment.averageLongTemp);
297 jout("\t\tHighest Average Short Term Temperature: %" PRIu64 "\n", farmLog.environment.highestShortTemp);
298 jout("\t\tLowest Average Short Term Temperature: %" PRIu64 "\n", farmLog.environment.lowestShortTemp);
299 jout("\t\tHighest Average Long Term Temperature: %" PRIu64 "\n", farmLog.environment.highestLongTemp);
300 jout("\t\tLowest Average Long Term Temperature: %" PRIu64 "\n", farmLog.environment.lowestLongTemp);
301 jout("\t\tTime In Over Temperature (minutes): %" PRIu64 "\n", farmLog.environment.overTempTime);
302 jout("\t\tTime In Under Temperature (minutes): %" PRIu64 "\n", farmLog.environment.underTempTime);
303 jout("\t\tSpecified Max Operating Temperature: %" PRIu64 "\n", farmLog.environment.maxTemp);
304 jout("\t\tSpecified Min Operating Temperature: %" PRIu64 "\n", farmLog.environment.minTemp);
305 jout("\t\tCurrent Relative Humidity: %" PRIu64 "\n", farmLog.environment.humidity);
306 jout("\t\tCurrent Motor Power: %" PRIu64 "\n", farmLog.environment.currentMotorPower);
307 jout("\t\tCurrent 12 volts: %0.3f\n", farmLog.environment.current12v / 1000.0);
308 jout("\t\tMinimum 12 volts: %0.3f\n", farmLog.environment.min12v / 1000.0);
309 jout("\t\tMaximum 12 volts: %0.3f\n", farmLog.environment.max12v / 1000.0);
310 jout("\t\tCurrent 5 volts: %0.3f\n", farmLog.environment.current5v / 1000.0);
311 jout("\t\tMinimum 5 volts: %0.3f\n", farmLog.environment.min5v / 1000.0);
312 jout("\t\tMaximum 5 volts: %0.3f\n", farmLog.environment.max5v / 1000.0);
313 jout("\t\t12V Power Average: %0.3f\n", farmLog.environment.powerAverage12v / 1000.0);
314 jout("\t\t12V Power Minimum: %0.3f\n", farmLog.environment.powerMin12v / 1000.0);
315 jout("\t\t12V Power Maximum: %0.3f\n", farmLog.environment.powerMax12v / 1000.0);
316 jout("\t\t5V Power Average: %0.3f\n", farmLog.environment.powerAverage5v / 1000.0);
317 jout("\t\t5V Power Minimum: %0.3f\n", farmLog.environment.powerMin5v / 1000.0);
318 jout("\t\t5V Power Maximum: %0.3f\n", farmLog.environment.powerMax5v / 1000.0);
319
320 // Page 5: Reliability Statistics
321 jout("\tFARM Log Page 5: Reliability Statistics\n");
322 jout("\t\tError Rate (SMART Attribute 1 Raw): 0x%016" PRIx64 "\n", farmLog.reliability.attrErrorRateRaw);
323 jout("\t\tError Rate (SMART Attribute 1 Normalized): %" PRIi64 "\n", farmLog.reliability.attrErrorRateNormal);
324 jout("\t\tError Rate (SMART Attribute 1 Worst): %" PRIi64 "\n", farmLog.reliability.attrErrorRateWorst);
325 jout("\t\tSeek Error Rate (SMART Attr 7 Raw): 0x%016" PRIx64 "\n", farmLog.reliability.attrSeekErrorRateRaw);
326 jout("\t\tSeek Error Rate (SMART Attr 7 Normalized): %" PRIi64 "\n", farmLog.reliability.attrSeekErrorRateNormal);
327 jout("\t\tSeek Error Rate (SMART Attr 7 Worst): %" PRIi64 "\n", farmLog.reliability.attrSeekErrorRateWorst);
328 jout("\t\tHigh Priority Unload Events: %" PRIu64 "\n", farmLog.reliability.attrUnloadEventsRaw);
329 jout("\t\tHelium Pressure Threshold Tripped: %" PRIu64 "\n", farmLog.reliability.heliumPresureTrip);
330 jout("\t\tLBAs Corrected By Parity Sector: %" PRIi64 "\n", farmLog.reliability.numberLBACorrectedParitySector);
331
332 // Page 5 by-head reliability parameters
333 farm_print_by_head_to_text("DVGA Skip Write Detect by Head", farmLog.reliability.DVGASkipWriteDetect, farmLog.driveInformation.heads);
334 farm_print_by_head_to_text("RVGA Skip Write Detect by Head", farmLog.reliability.RVGASkipWriteDetect, farmLog.driveInformation.heads);
335 farm_print_by_head_to_text("FVGA Skip Write Detect by Head", farmLog.reliability.FVGASkipWriteDetect, farmLog.driveInformation.heads);
336 farm_print_by_head_to_text("Skip Write Detect Threshold Exceeded by Head", farmLog.reliability.skipWriteDetectThresExceeded, farmLog.driveInformation.heads);
337 farm_print_by_head_to_text("Write Power On (hrs) by Head", farmLog.reliability.writeWorkloadPowerOnTime, farmLog.driveInformation.heads);
338 farm_print_by_head_to_text("MR Head Resistance from Head", (int64_t*)farmLog.reliability.mrHeadResistance, farmLog.driveInformation.heads);
339 farm_print_by_head_to_text("Second MR Head Resistance by Head", farmLog.reliability.secondMRHeadResistance, farmLog.driveInformation.heads);
340 farm_print_by_head_to_text("Number of Reallocated Sectors by Head", farmLog.reliability.reallocatedSectors, farmLog.driveInformation.heads);
341 farm_print_by_head_to_text("Number of Reallocation Candidate Sectors by Head", farmLog.reliability.reallocationCandidates, farmLog.driveInformation.heads);
342
343 // Print JSON if --json or -j is specified
344 json::ref jref = jglb["seagate_farm_log"];
345
346 // Page 0: Log Header
347 json::ref jref0 = jref["page_0_log_header"];
348 jref0["farm_log_version"][0] = farmLog.header.majorRev;
349 jref0["farm_log_version"][1] = farmLog.header.minorRev;
350 jref0["pages_supported"] = farmLog.header.pagesSupported;
351 jref0["log_size"] = farmLog.header.logSize;
352 jref0["page_size"] = farmLog.header.pageSize;
353 jref0["heads_supported"] = farmLog.header.headsSupported;
354 jref0["number_of_copies"] = farmLog.header.copies;
355 jref0["reason_for_frame_capture"] = farmLog.header.frameCapture;
356
357 // Page 1: Drive Information
358 json::ref jref1 = jref["page_1_drive_information"];
359 jref1["serial_number"] = serialNumber;
360 jref1["world_wide_name"] = worldWideName;
361 jref1["device_interface"] = deviceInterface;
362 jref1["device_capacity_in_sectors"] = farmLog.driveInformation.deviceCapacity;
363 jref1["physical_sector_size"] = farmLog.driveInformation.psecSize;
364 jref1["logical_sector_size"] = farmLog.driveInformation.lsecSize;
365 jref1["device_buffer_size"] = farmLog.driveInformation.deviceBufferSize;
366 jref1["number_of_heads"] = farmLog.driveInformation.heads;
367 jref1["form_factor"] = formFactor;
368 jref1["rotation_rate"] = farmLog.driveInformation.rotationRate;
369 jref1["firmware_rev"] = firmwareRev;
370 jref1["poh"] = farmLog.driveInformation.poh;
371 jref1["spoh"] = farmLog.driveInformation.spoh;
372 jref1["head_flight_hours"] = farmLog.driveInformation.headFlightHours;
373 jref1["head_load_events"] = farmLog.driveInformation.headLoadEvents;
374 jref1["power_cycle_count"] = farmLog.driveInformation.powerCycleCount;
375 jref1["reset_count"] = farmLog.driveInformation.resetCount;
376 jref1["spin_up_time"] = farmLog.driveInformation.spinUpTime;
377 jref1["time_to_ready"] = farmLog.driveInformation.timeToReady;
378 jref1["time_held"] = farmLog.driveInformation.timeHeld;
379 jref1["drive_recording_type"] = recordingType;
380 jref1["max_number_for_reasign"] = farmLog.driveInformation.maxNumberForReasign;
381 jref1["date_of_assembly"] = dateOfAssembly;
382 jref1["depopulation_head_mask"] = farmLog.driveInformation.depopulationHeadMask;
383
384 // Page 2: Workload Statistics
385 json::ref jref2 = jref["page_2_workload_statistics"];
386 jref2["total_read_commands"] = farmLog.workload.totalReadCommands;
387 jref2["total_write_commands"] = farmLog.workload.totalWriteCommands;
388 jref2["total_random_reads"] = farmLog.workload.totalRandomReads;
389 jref2["total_random_writes"] = farmLog.workload.totalRandomWrites;
390 jref2["total_other_commands"] = farmLog.workload.totalNumberofOtherCMDS;
391 jref2["logical_sectors_written"] = farmLog.workload.logicalSecWritten;
392 jref2["logical_sectors_read"] = farmLog.workload.logicalSecRead;
393 jref2["dither"] = farmLog.workload.dither;
394 jref2["dither_random"] = farmLog.workload.ditherRandom;
395 jref2["dither_sequential"] = farmLog.workload.ditherSequential;
396 jref2["read_commands_by_radius_0_3"] = farmLog.workload.readCommandsByRadius1;
397 jref2["read_commands_by_radius_3_25"] = farmLog.workload.readCommandsByRadius2;
398 jref2["read_commands_by_radius_25_75"] = farmLog.workload.readCommandsByRadius3;
399 jref2["read_commands_by_radius_75_100"] = farmLog.workload.readCommandsByRadius4;
400 jref2["write_commands_by_radius_0_3"] = farmLog.workload.writeCommandsByRadius1;
401 jref2["write_commands_by_radius_3_25"] = farmLog.workload.writeCommandsByRadius2;
402 jref2["write_commands_by_radius_25_75"] = farmLog.workload.writeCommandsByRadius3;
403 jref2["write_commands_by_radius_75_100"] = farmLog.workload.writeCommandsByRadius4;
404
405 // Page 3: Error Statistics
406 json::ref jref3 = jref["page_3_error_statistics"];
407 jref3["number_of_unrecoverable_read_errors"] = farmLog.error.totalUnrecoverableReadErrors;
408 jref3["number_of_unrecoverable_write_errors"] = farmLog.error.totalUnrecoverableWriteErrors;
409 jref3["number_of_reallocated_sectors"] = farmLog.error.totalReallocations;
410 jref3["number_of_read_recovery_attempts"] = farmLog.error.totalReadRecoveryAttepts;
411 jref3["number_of_mechanical_start_failures"] = farmLog.error.totalMechanicalStartRetries;
412 jref3["number_of_reallocated_candidate_sectors"] = farmLog.error.totalReallocationCanidates;
413 jref3["total_asr_events"] = farmLog.error.totalASREvents;
414 jref3["total_crc_errors"] = farmLog.error.totalCRCErrors;
415 jref3["attr_spin_retry_count"] = farmLog.error.attrSpinRetryCount;
416 jref3["normal_spin_retry_count"] = farmLog.error.normalSpinRetryCount;
417 jref3["worst_spin_rretry_count"] = farmLog.error.worstSpinRretryCount;
418 jref3["number_of_ioedc_errors"] = farmLog.error.attrIOEDCErrors;
419 jref3["command_time_out_count_total"] = farmLog.error.attrCTOCount;
420 jref3["command_time_out_over_5_seconds_count"] = farmLog.error.overFiveSecCTO;
421 jref3["command_time_out_over_7_seconds_count"] = farmLog.error.overSevenSecCTO;
422 jref3["total_flash_led"] = farmLog.error.totalFlashLED;
423 jref3["index_flash_led"] = farmLog.error.indexFlashLED;
424 jref3["uncorrectables"] = farmLog.error.uncorrectables;
425 jref3["cumulative_unrecoverable_read_erc"] = farmLog.error.cumulativeUnrecoverableReadERC;
426 jref3["total_flash_led_errors"] = farmLog.error.totalFlashLED;
427
428 // Page 3 Flash-LED Information
429 for (uint8_t i = flash_led_size; i > 0; i--) {
430 index = (i - farmLog.error.indexFlashLED + flash_led_size) % flash_led_size;
431 snprintf(buffer, sizeof(buffer), "flash_led_event_%i", index);
432 json::ref jref3a = jref3[buffer];
433 jref3a["timestamp_of_event"] = farmLog.error.universalTimestampFlashLED[index];
434 jref3a["event_information"] = farmLog.error.flashLEDArray[index];
435 jref3a["power_cycle_event"] = farmLog.error.powerCycleFlashLED[index];
436 }
437
438 // Page 3 by-head parameters
439 for (uint8_t hd = 0; hd < (uint8_t)farmLog.driveInformation.heads; hd++) {
440 snprintf(buffer, sizeof(buffer), "cum_lifetime_unrecoverable_by_head_%i", hd);
441 json::ref jref3_hd = jref3[buffer];
442 jref3_hd["cum_lifetime_unrecoverable_read_repeating"] = farmLog.error.cumulativeUnrecoverableReadRepeating[hd];
443 jref3_hd["cum_lifetime_unrecoverable_read_unique"] = farmLog.error.cumulativeUnrecoverableReadUnique[hd];
444 }
445
446 // Page 4: Environment Statistics
447 json::ref jref4 = jref["page_4_environment_statistics"];
448 jref4["curent_temp"] = farmLog.environment.curentTemp;
449 jref4["highest_temp"] = farmLog.environment.highestTemp;
450 jref4["lowest_temp"] = farmLog.environment.lowestTemp;
451 jref4["average_temp"] = farmLog.environment.averageTemp;
452 jref4["average_long_temp"] = farmLog.environment.averageLongTemp;
453 jref4["highest_short_temp"] = farmLog.environment.highestShortTemp;
454 jref4["lowest_short_temp"] = farmLog.environment.lowestShortTemp;
455 jref4["highest_long_temp"] = farmLog.environment.highestLongTemp;
456 jref4["lowest_long_temp"] = farmLog.environment.lowestLongTemp;
457 jref4["over_temp_time"] = farmLog.environment.overTempTime;
458 jref4["under_temp_time"] = farmLog.environment.underTempTime;
459 jref4["max_temp"] = farmLog.environment.maxTemp;
460 jref4["min_temp"] = farmLog.environment.minTemp;
461 jref4["humidity"] = farmLog.environment.humidity;
462 jref4["current_motor_power"] = farmLog.environment.currentMotorPower;
463 jref4["current_12v_in_mv"] = farmLog.environment.current12v;
464 jref4["minimum_12v_in_mv"] = farmLog.environment.min12v;
465 jref4["maximum_12v_in_mv"] = farmLog.environment.max12v;
466 jref4["current_5v_in_mv"] = farmLog.environment.current5v;
467 jref4["minimum_5v_in_mv"] = farmLog.environment.min5v;
468 jref4["maximum_5v_in_mv"] = farmLog.environment.max5v;
469 jref4["average_12v_power"] = farmLog.environment.powerAverage12v;
470 jref4["minimum_12v_power"] = farmLog.environment.powerMin12v;
471 jref4["maximum_12v_power"] = farmLog.environment.powerMax12v;
472 jref4["average_5v_power"] = farmLog.environment.powerAverage5v;
473 jref4["minimum_5v_power"] = farmLog.environment.powerMin5v;
474 jref4["maximum_5v_power"] = farmLog.environment.powerMax5v;
475
476 // Page 5: Reliability Statistics
477 json::ref jref5 = jref["page_5_reliability_statistics"];
478 jref5["attr_error_rate_raw"] = farmLog.reliability.attrErrorRateRaw;
479 jref5["error_rate_normalized"] = farmLog.reliability.attrErrorRateNormal;
480 jref5["error_rate_worst"] = farmLog.reliability.attrErrorRateWorst;
481 jref5["attr_seek_error_rate_raw"] = farmLog.reliability.attrSeekErrorRateRaw;
482 jref5["seek_error_rate_normalized"] = farmLog.reliability.attrSeekErrorRateNormal;
483 jref5["seek_error_rate_worst"] = farmLog.reliability.attrSeekErrorRateWorst;
484 jref5["high_priority_unload_events"] = farmLog.reliability.attrUnloadEventsRaw;
485 jref5["helium_presure_trip"] = farmLog.reliability.heliumPresureTrip;
486 jref5["lbas_corrected_by_parity_sector"] = farmLog.reliability.numberLBACorrectedParitySector;
487
488 // Page 5: Reliability Statistics By Head
489 farm_print_by_head_to_json(jref5, buffer, "dvga_skip_write_detect_by_head", farmLog.reliability.DVGASkipWriteDetect, farmLog.driveInformation.heads);
490 farm_print_by_head_to_json(jref5, buffer, "rvga_skip_write_detect_by_head", farmLog.reliability.RVGASkipWriteDetect, farmLog.driveInformation.heads);
491 farm_print_by_head_to_json(jref5, buffer, "fvga_skip_write_detect_by_head", farmLog.reliability.FVGASkipWriteDetect, farmLog.driveInformation.heads);
492 farm_print_by_head_to_json(jref5, buffer, "skip_write_detect_threshold_exceeded_by_head", farmLog.reliability.skipWriteDetectThresExceeded, farmLog.driveInformation.heads);
493 farm_print_by_head_to_json(jref5, buffer, "write_workload_power_on_time_by_head", farmLog.reliability.writeWorkloadPowerOnTime, farmLog.driveInformation.heads);
494 farm_print_by_head_to_json(jref5, buffer, "mr_head_resistance_from_head", (int64_t*)farmLog.reliability.mrHeadResistance, farmLog.driveInformation.heads);
495 farm_print_by_head_to_json(jref5, buffer, "second_mr_head_resistance_by_head", farmLog.reliability.secondMRHeadResistance, farmLog.driveInformation.heads);
496 farm_print_by_head_to_json(jref5, buffer, "number_of_reallocated_sectors_by_head", farmLog.reliability.reallocatedSectors, farmLog.driveInformation.heads);
497 farm_print_by_head_to_json(jref5, buffer, "number_of_reallocation_candidate_sectors_by_head", farmLog.reliability.reallocationCandidates, farmLog.driveInformation.heads);
498}
499
500/////////////////////////////////////////////////////////////////////////////////////////
501// Seagate SCSI Field Access Reliability Metrics (FARM) log (Log page 0x3D, sub-page 0x3)
502
503/*
504 * Prints parsed FARM log (SCSI log page 0x3D, sub-page 0x3) data from Seagate
505 * drives already present in scsiFarmLog structure
506 *
507 * @param farmLog: Pointer to parsed farm log (const scsiFarmLog&)
508 */
509void scsiPrintFarmLog(const scsiFarmLog& farmLog) {
510 // Request feedback on FARM output on big-endian systems
511 if (isbigendian()) {
512 jinf("FARM support was not tested on Big Endian platforms by the developers.\n"
513 "Please report success/failure to " PACKAGE_BUGREPORT "\n\n");
514 }
515
516 // Get device information
517 char serialNumber[sizeof(farmLog.driveInformation.serialNumber) + sizeof(farmLog.driveInformation.serialNumber2) + 1];
519
520 char worldWideName[64];
521 snprintf(worldWideName, sizeof(worldWideName), "0x%" PRIx64 "%" PRIx64, farmLog.driveInformation.worldWideName2,
523
524 char firmwareRev[sizeof(farmLog.driveInformation.firmwareRev) + sizeof(farmLog.driveInformation.firmwareRev2) + 1];
526
527 char deviceInterface[sizeof(farmLog.driveInformation.deviceInterface) + 1];
529
530 char dateOfAssembly[sizeof(farmLog.driveInformation.dateOfAssembly) + 1];
532
533 const char* formFactor = farm_get_form_factor(farmLog.driveInformation.factor);
534
535 const char* recordingType = farm_get_recording_type(farmLog.driveInformation2.driveRecordingType);
536
537 char productID[sizeof(farmLog.driveInformation2.productID) * 4 + 1];
539 farm_format_id_string(&productID[strlen(productID)], farmLog.driveInformation2.productID2);
540 farm_format_id_string(&productID[strlen(productID)], farmLog.driveInformation2.productID3);
541 farm_format_id_string(&productID[strlen(productID)], farmLog.driveInformation2.productID4);
542
543 // Print plain-text
544 jout("\nSeagate Field Access Reliability Metrics log (FARM) (SCSI Log page 0x3d, sub-page 0x3)\n");
545
546 // Parameter 0: Log Header
547 jout("\tFARM Log Parameter 0: Log Header\n");
548 jout("\t\tFARM Log Version: %" PRIu64 ".%" PRIu64 "\n", farmLog.header.majorRev, farmLog.header.minorRev);
549 jout("\t\tPages Supported: %" PRIu64 "\n", farmLog.header.parametersSupported);
550 jout("\t\tLog Size: %" PRIu64 "\n", farmLog.header.logSize);
551 jout("\t\tHeads Supported: %" PRIu64 "\n", farmLog.header.headsSupported);
552 jout("\t\tReason for Frame Capture: %" PRIu64 "\n", farmLog.header.frameCapture);
553
554 // Parameter 1: Drive Information
555 jout("\tFARM Log Parameter 1: Drive Information\n");
556 jout("\t\tSerial Number: %s\n", serialNumber);
557 jout("\t\tWorld Wide Name: %s\n", worldWideName);
558 jout("\t\tFirmware Rev: %s\n", firmwareRev);
559 jout("\t\tDevice Interface: %s\n", deviceInterface);
560 jout("\t\tDevice Capacity in Sectors: %" PRIu64 "\n", farmLog.driveInformation.deviceCapacity);
561 jout("\t\tReason for Frame Capture: %" PRIu64 "\n", farmLog.driveInformation.psecSize);
562 jout("\t\tLogical Sector Size: %" PRIu64 "\n", farmLog.driveInformation.lsecSize);
563 jout("\t\tDevice Buffer Size: %" PRIu64 "\n", farmLog.driveInformation.deviceBufferSize);
564 jout("\t\tNumber of heads: %" PRIu64 "\n", farmLog.driveInformation.heads);
565 jout("\t\tDevice form factor: %s\n", formFactor);
566 jout("\t\tRotation Rate: %" PRIu64 "\n", farmLog.driveInformation.rotationRate);
567 jout("\t\tPower on Hour: %" PRIu64 "\n", farmLog.driveInformation.poh);
568 jout("\t\tPower Cycle count: %" PRIu64 "\n", farmLog.driveInformation.powerCycleCount);
569 jout("\t\tHardware Reset count: %" PRIu64 "\n", farmLog.driveInformation.resetCount);
570 jout("\t\tDate of Assembled: %s\n", dateOfAssembly);
571
572 // Parameter 2: Workload Statistics
573 jout("\tFARM Log Parameter 2: Workload Statistics\n");
574 jout("\t\tTotal Number of Read Commands: %" PRIu64 "\n", farmLog.workload.totalReadCommands);
575 jout("\t\tTotal Number of Write Commands: %" PRIu64 "\n", farmLog.workload.totalWriteCommands);
576 jout("\t\tTotal Number of Random Read Cmds: %" PRIu64 "\n", farmLog.workload.totalRandomReads);
577 jout("\t\tTotal Number of Random Write Cmds: %" PRIu64 "\n", farmLog.workload.totalRandomWrites);
578 jout("\t\tTotal Number of Other Commands: %" PRIu64 "\n", farmLog.workload.totalNumberofOtherCMDS);
579 jout("\t\tLogical Sectors Written: %" PRIu64 "\n", farmLog.workload.logicalSecWritten);
580 jout("\t\tLogical Sectors Read: %" PRIu64 "\n", farmLog.workload.logicalSecRead);
581 jout("\t\tNumber of Read commands from 0-3.125%% of LBA space: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius1);
582 jout("\t\tNumber of Read commands from 3.125-25%% of LBA space: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius2);
583 jout("\t\tNumber of Read commands from 25-50%% of LBA space: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius3);
584 jout("\t\tNumber of Read commands from 50-100%% of LBA space: %" PRIu64 "\n", farmLog.workload.readCommandsByRadius4);
585 jout("\t\tNumber of Write commands from 0-3.125%% of LBA space: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius1);
586 jout("\t\tNumber of Write commands from 3.125-25%% of LBA space: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius2);
587 jout("\t\tNumber of Write commands from 25-50%% of LBA space: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius3);
588 jout("\t\tNumber of Write commands from 50-100%% of LBA space: %" PRIu64 "\n", farmLog.workload.writeCommandsByRadius4);
589
590 // Parameter 3: Error Statistics
591 jout("\tFARM Log Parameter 3: Error Statistics\n");
592 jout("\t\tUnrecoverable Read Errors: %" PRIu64 "\n", farmLog.error.totalUnrecoverableReadErrors);
593 jout("\t\tUnrecoverable Write Errors: %" PRIu64 "\n", farmLog.error.totalUnrecoverableWriteErrors);
594 jout("\t\tNumber of Mechanical Start Failures: %" PRIu64 "\n", farmLog.error.totalMechanicalStartRetries);
595 jout("\t\tFRU code if smart trip from most recent SMART Frame: %" PRIu64 "\n", farmLog.error.tripCode);
596 jout("\t\tInvalid DWord Count Port A: %" PRIu64 "\n", farmLog.error.invalidDWordCountA);
597 jout("\t\tInvalid DWord Count Port B: %" PRIu64 "\n", farmLog.error.invalidDWordCountB);
598 jout("\t\tDisparity Error Count Port A: %" PRIu64 "\n", farmLog.error.disparityErrorCodeA);
599 jout("\t\tDisparity Error Count Port B: %" PRIu64 "\n", farmLog.error.disparityErrorCodeB);
600 jout("\t\tLoss Of DWord Sync Port A: %" PRIu64 "\n", farmLog.error.lossOfDWordSyncA);
601 jout("\t\tLoss Of DWord Sync Port B: %" PRIu64 "\n", farmLog.error.lossOfDWordSyncB);
602 jout("\t\tPhy Reset Problem Port A: %" PRIu64 "\n", farmLog.error.phyResetProblemA);
603 jout("\t\tPhy Reset Problem Port B: %" PRIu64 "\n", farmLog.error.phyResetProblemB);
604
605 // Parameter 4: Environment Statistics
606 jout("\tFARM Log Parameter 4: Environment Statistics\n");
607 jout("\t\tCurrent Temperature (Celsius): %" PRIu64 "\n", farmLog.environment.curentTemp);
608 jout("\t\tHighest Temperature: %" PRIu64 "\n", farmLog.environment.highestTemp);
609 jout("\t\tLowest Temperature: %" PRIu64 "\n", farmLog.environment.lowestTemp);
610 jout("\t\tSpecified Max Operating Temperature: %" PRIu64 "\n", farmLog.environment.maxTemp);
611 jout("\t\tSpecified Min Operating Temperature: %" PRIu64 "\n", farmLog.environment.minTemp);
612 jout("\t\tCurrent Relative Humidity: %" PRIu64 "\n", farmLog.environment.humidity);
613 jout("\t\tCurrent Motor Power: %" PRIu64 "\n", farmLog.environment.currentMotorPower);
614 jout("\t\t12V Power Average: %" PRIu64 "\n", farmLog.environment.powerAverage12v);
615 jout("\t\t12V Power Minimum: %" PRIu64 "\n", farmLog.environment.powerMin12v);
616 jout("\t\t12V Power Maximum: %" PRIu64 "\n", farmLog.environment.powerMax12v);
617 jout("\t\t5V Power Average: %" PRIu64 "\n", farmLog.environment.powerAverage5v);
618 jout("\t\t5V Power Minimum: %" PRIu64 "\n", farmLog.environment.powerMin5v);
619 jout("\t\t5V Power Maximum: %" PRIu64 "\n", farmLog.environment.powerMax5v);
620
621 // Parameter 5: Reliability Statistics
622 jout("\tFARM Log Parameter 5: Reliability Statistics\n");
623 jout("\t\tHelium Pressure Threshold Tripped: %" PRIi64 "\n", farmLog.reliability.heliumPresureTrip);
624
625 // Parameter 6: Drive Information Continued
626 jout("\tFARM Log Parameter 6: Drive Information Continued\n");
627 jout("\t\tDepopulation Head Mask: %" PRIu64 "\n", farmLog.driveInformation2.depopulationHeadMask);
628 jout("\t\tProduct ID: %s\n", productID);
629 jout("\t\tDrive Recording Type: %s\n", recordingType);
630 jout("\t\tHas Drive been Depopped: %" PRIu64 "\n", farmLog.driveInformation2.dpopped);
631 jout("\t\tMax Number of Available Sectors for Reassignment: %" PRIu64 "\n", farmLog.driveInformation2.maxNumberForReasign);
632 jout("\t\tTime to ready of the last power cycle (sec): %" PRIu64 "\n", farmLog.driveInformation2.timeToReady);
633 jout("\t\tTime drive is held in staggered spin (sec): %" PRIu64 "\n", farmLog.driveInformation2.timeHeld);
634 jout("\t\tLast Servo Spin up Time (sec): %" PRIu64 "\n", farmLog.driveInformation2.lastServoSpinUpTime);
635
636 // Parameter 7: Environment Information Continued
637 jout("\tFARM Log Parameter 7: Environment Information Continued\n");
638 jout("\t\tCurrent 12 volts: %" PRIu64 "\n", farmLog.environment2.current12v);
639 jout("\t\tMinimum 12 volts: %" PRIu64 "\n", farmLog.environment2.min12v);
640 jout("\t\tMaximum 12 volts: %" PRIu64 "\n", farmLog.environment2.max12v);
641 jout("\t\tCurrent 5 volts: %" PRIu64 "\n", farmLog.environment2.current5v);
642 jout("\t\tMinimum 5 volts: %" PRIu64 "\n", farmLog.environment2.min5v);
643 jout("\t\tMaximum 5 volts: %" PRIu64 "\n", farmLog.environment2.max5v);
644
645 // "By Head" Parameters
646 jout("\tFARM Log \"By Head\" Information\n");
647 farm_print_by_head_to_text("MR Head Resistance", (int64_t*)farmLog.mrHeadResistance.headValue, farmLog.driveInformation.heads);
648 farm_print_by_head_to_text("Number of Reallocated Sectors", (int64_t*)farmLog.totalReallocations.headValue, farmLog.driveInformation.heads);
649 farm_print_by_head_to_text("Number of Reallocation Candidate Sectors", (int64_t*)farmLog.totalReallocationCanidates.headValue, farmLog.driveInformation.heads);
650 farm_print_by_head_to_text("Write Power On (hrs)", (int64_t*)farmLog.writeWorkloadPowerOnTime.headValue, farmLog.driveInformation.heads);
651 farm_print_by_head_to_text("Cum Lifetime Unrecoverable Read Repeating", (int64_t*)farmLog.cumulativeUnrecoverableReadRepeat.headValue, farmLog.driveInformation.heads);
652 farm_print_by_head_to_text("Cum Lifetime Unrecoverable Read Unique", (int64_t*)farmLog.cumulativeUnrecoverableReadUnique.headValue, farmLog.driveInformation.heads);
653 farm_print_by_head_to_text("Second MR Head Resistance", (int64_t*)farmLog.secondMRHeadResistance.headValue, farmLog.driveInformation.heads);
654
655 // "By Actuator" Parameters
656 const scsiFarmByActuator actrefs[] = {
657 farmLog.actuator0, farmLog.actuator1, farmLog.actuator2, farmLog.actuator3
658 };
659 for (uint8_t i = 0; i < sizeof(actrefs) / sizeof(actrefs[0]); i++) {
660 jout("\tFARM Log Actuator Information 0x%" PRIx64 "\n", actrefs[i].actuatorID);
661 jout("\t\tHead Load Events: %" PRIu64 "\n", actrefs[i].headLoadEvents);
662 jout("\t\tTimeStamp of last IDD test: %" PRIu64 "\n", actrefs[i].timelastIDDTest);
663 jout("\t\tSub-Command of Last IDD Test: %" PRIu64 "\n", actrefs[i].subcommandlastIDDTest);
664 jout("\t\tNumber of Reallocated Sector Reclamations: %" PRIu64 "\n", actrefs[i].numberGListReclam);
665 jout("\t\tServo Status: %" PRIu64 "\n", actrefs[i].servoStatus);
666 jout("\t\tNumber of Slipped Sectors Before IDD Scan: %" PRIu64 "\n", actrefs[i].numberSlippedSectorsBeforeIDD);
667 jout("\t\tNumber of Slipped Sectors Before IDD Scan: %" PRIu64 "\n", actrefs[i].numberSlippedSectorsAfterIDD);
668 jout("\t\tNumber of Resident Reallocated Sectors Before IDD Scan: %" PRIu64 "\n", actrefs[i].numberResidentReallocatedBeforeIDD);
669 jout("\t\tNumber of Resident Reallocated Sectors Before IDD Scan: %" PRIu64 "\n", actrefs[i].numberResidentReallocatedAfterIDD);
670 jout("\t\tSuccessfully Scrubbed Sectors Before IDD Scan: %" PRIu64 "\n", actrefs[i].numberScrubbedSectorsBeforeIDD);
671 jout("\t\tSuccessfully Scrubbed Sectors Before IDD Scan: %" PRIu64 "\n", actrefs[i].numberScrubbedSectorsAfterIDD);
672 jout("\t\tNumber of DOS Scans Performed: %" PRIu64 "\n", actrefs[i].dosScansPerformed);
673 jout("\t\tNumber of LBAs Corrected by ISP: %" PRIu64 "\n", actrefs[i].lbasCorrectedISP);
674 jout("\t\tNumber of Valid Parity Sectors: %" PRIu64 "\n", actrefs[i].numberValidParitySectors);
675 jout("\t\tNumber of LBAs Corrected by Parity Sector: %" PRIu64 "\n", actrefs[i].numberLBACorrectedParitySector);
676 }
677
678 // "By Actuator" Flash LED Information
679 uint8_t index;
680 size_t flash_led_size;
681 const scsiFarmByActuatorFLED fledrefs[] = {
682 farmLog.actuatorFLED0, farmLog.actuatorFLED1, farmLog.actuatorFLED2, farmLog.actuatorFLED3
683 };
684 for (uint8_t i = 0; i < sizeof(fledrefs) / sizeof(fledrefs[0]); i++) {
685 jout("\tFARM Log Actuator 0x%" PRIx64 " Flash LED Information\n", fledrefs[i].actuatorID);
686 jout("\t\tTotal Flash LED Events: %" PRIu64 "\n", fledrefs[i].totalFlashLED);
687 jout("\t\tIndex of Last Flash LED: %" PRIu64 "\n", fledrefs[i].indexFlashLED);
688
689 flash_led_size = sizeof(fledrefs[i].flashLEDArray) / sizeof(fledrefs[i].flashLEDArray[0]);
690 for (uint8_t j = flash_led_size; j > 0; j--) {
691 index = (j - fledrefs[i].indexFlashLED + flash_led_size) % flash_led_size;
692 jout("\t\tEvent %" PRIuMAX ":\n", static_cast<uintmax_t>(flash_led_size - j));
693 jout("\t\t\tEvent Information: 0x%016" PRIx64 "\n", fledrefs[i].flashLEDArray[index]);
694 jout("\t\t\tTimestamp of Event %" PRIuMAX " (hours): %" PRIu64 "\n", static_cast<uintmax_t>(flash_led_size - j), fledrefs[i].universalTimestampFlashLED[index]);
695 jout("\t\t\tPower Cycle Event %" PRIuMAX ": %" PRIx64 "\n", static_cast<uintmax_t>(flash_led_size - j), fledrefs[i].powerCycleFlashLED[index]);
696 }
697 }
698
699 // "By Actuator" Reallocation Information
700 const scsiFarmByActuatorReallocation ararefs[] = {
702 };
703 for (uint8_t i = 0; i < sizeof(ararefs) / sizeof(ararefs[0]); i++) {
704 jout("\tFARM Log Actuator 0x%" PRIx64 " Reallocation\n", ararefs[i].actuatorID);
705 jout("\t\tNumber of Reallocated Sectors: %" PRIu64 "\n", ararefs[i].totalReallocations);
706 jout("\t\tNumber of Reallocated Candidate Sectors: %" PRIu64 "\n", ararefs[i].totalReallocationCanidates);
707 }
708
709 // Print JSON if --json or -j is specified
710 json::ref jref = jglb["seagate_farm_log"];
711
712 // Parameter 0: Log Header
713 json::ref jref0 = jref["log_header"];
714 jref0["farm_log_version"] = farmLog.header.minorRev;
715 jref0["pages_supported"] = farmLog.header.parametersSupported;
716 jref0["log_size"] = farmLog.header.logSize;
717 jref0["heads_supported"] = farmLog.header.headsSupported;
718 jref0["reason_for_frame_capture"] = farmLog.header.frameCapture;
719
720 // Parameter 1: Drive Information
721 json::ref jref1 = jref["drive_information"];
722 jref1["serial_number"] = serialNumber;
723 jref1["world_wide_name"] = worldWideName;
724 jref1["firmware_rev"] = firmwareRev;
725 jref1["device_interface"] = deviceInterface;
726 jref1["device_capacity_in_sectors"] = farmLog.driveInformation.deviceCapacity;
727 jref1["reason_for_frame_capture"] = farmLog.driveInformation.psecSize;
728 jref1["logical_sector_size"] = farmLog.driveInformation.lsecSize;
729 jref1["device_buffer_size"] = farmLog.driveInformation.deviceBufferSize;
730 jref1["number_of_heads"] = farmLog.driveInformation.heads;
731 jref1["device_form_factor"] = formFactor;
732 jref1["rotation_rate"] = farmLog.driveInformation.rotationRate;
733 jref1["power_on_hour"] = farmLog.driveInformation.poh;
734 jref1["power_cycle_count"] = farmLog.driveInformation.powerCycleCount;
735 jref1["hardware_reset_count"] = farmLog.driveInformation.resetCount;
736 jref1["date_of_assembled"] = dateOfAssembly;
737
738 // Parameter 2: Workload Statistics
739 json::ref jref2 = jref["workload_statistics"];
740 jref2["total_number_of_read_commands"] = farmLog.workload.totalReadCommands;
741 jref2["total_number_of_write_commands"] = farmLog.workload.totalWriteCommands;
742 jref2["total_number_of_random_read_cmds"] = farmLog.workload.totalRandomReads;
743 jref2["total_number_of_random_write_cmds"] = farmLog.workload.totalRandomWrites;
744 jref2["total_number_of_other_commands"] = farmLog.workload.totalNumberofOtherCMDS;
745 jref2["logical_sectors_written"] = farmLog.workload.logicalSecWritten;
746 jref2["logical_sectors_read"] = farmLog.workload.logicalSecRead;
747 jref2["number_of_read_commands_from_0_to_3_percent_of_lba_space"] = farmLog.workload.readCommandsByRadius1;
748 jref2["number_of_read_commands_from_3_to_25_percent_of_lba_space"] = farmLog.workload.readCommandsByRadius2;
749 jref2["number_of_read_commands_from_25_to_50_percent_of_lba_space"] = farmLog.workload.readCommandsByRadius3;
750 jref2["number_of_read_commands_from_50_to_100_percent_of_lba_space"] = farmLog.workload.readCommandsByRadius4;
751 jref2["number_of_write_commands_from_0_to_3_percent_of_lba_space"] = farmLog.workload.writeCommandsByRadius1;
752 jref2["number_of_write_commands_from_3_to_25_percent_of_lba_space"] = farmLog.workload.writeCommandsByRadius2;
753 jref2["number_of_write_commands_from_25_to_50_percent_of_lba_space"] = farmLog.workload.writeCommandsByRadius3;
754 jref2["number_of_write_commands_from_50_to_100_percent_of_lba_space"] = farmLog.workload.writeCommandsByRadius4;
755
756 // Parameter 3: Error Statistics
757 json::ref jref3 = jref["error_statistics"];
758 jref3["unrecoverable_read_errors"] = farmLog.error.totalUnrecoverableReadErrors;
759 jref3["unrecoverable_write_errors"] = farmLog.error.totalUnrecoverableWriteErrors;
760 jref3["number_of_mechanical_start_failures"] = farmLog.error.totalMechanicalStartRetries;
761 jref3["fru_code_if_smart_trip_from_most_recent_smart_frame"] = farmLog.error.tripCode;
762 jref3["invalid_dword_count_port_a"] = farmLog.error.invalidDWordCountA;
763 jref3["invalid_dword_count_port_b"] = farmLog.error.invalidDWordCountB;
764 jref3["disparity_error_count_port_a"] = farmLog.error.disparityErrorCodeA;
765 jref3["disparity_error_count_port_b"] = farmLog.error.disparityErrorCodeB;
766 jref3["loss_of_dword_sync_port_a"] = farmLog.error.lossOfDWordSyncA;
767 jref3["loss_of_dword_sync_port_b"] = farmLog.error.lossOfDWordSyncB;
768 jref3["phy_reset_problem_port_a"] = farmLog.error.phyResetProblemA;
769 jref3["phy_reset_problem_port_b"] = farmLog.error.phyResetProblemB;
770
771 // Parameter 4: Environment Statistics
772 json::ref jref4 = jref["environment_statistics"];
773 jref4["current_temperature_(celsius)"] = farmLog.environment.curentTemp;
774 jref4["highest_temperature"] = farmLog.environment.highestTemp;
775 jref4["lowest_temperature"] = farmLog.environment.lowestTemp;
776 jref4["specified_max_operating_temperature"] = farmLog.environment.maxTemp;
777 jref4["specified_min_operating_temperature"] = farmLog.environment.minTemp;
778 jref4["current_relative_humidity"] = farmLog.environment.humidity;
779 jref4["current_motor_power"] = farmLog.environment.currentMotorPower;
780 jref4["12v_power_average"] = farmLog.environment.powerAverage12v;
781 jref4["12v_power_minimum"] = farmLog.environment.powerMin12v;
782 jref4["12v_power_maximum"] = farmLog.environment.powerMax12v;
783 jref4["5v_power_average"] = farmLog.environment.powerAverage5v;
784 jref4["5v_power_minimum"] = farmLog.environment.powerMin5v;
785 jref4["5v_power_maximum"] = farmLog.environment.powerMax5v;
786
787 // Parameter 5: Reliability Statistics
788 json::ref jref5 = jref["reliability_statistics"];
789//jref5["number_of_raw_operations"] = farmLog.reliability.xxxxxx;
790//jref5["cumulative_lifetime_ecc_due_to_erc"] = farmLog.reliability.xxxxxx;
791 jref5["helium_pressure_threshold_tripped"] = farmLog.reliability.heliumPresureTrip;
792
793 // Parameter 6: Drive Information Continued
794 json::ref jref6 = jref["drive_information_continued"];
795 jref6["depopulation_head_mask"] = farmLog.driveInformation2.depopulationHeadMask;
796 jref6["product_id"] = productID;
797 jref6["drive_recording_type"] = recordingType;
798 jref6["has_drive_been_depopped"] = farmLog.driveInformation2.dpopped;
799 jref6["max_number_of_available_sectors_for_reassignment"] = farmLog.driveInformation2.maxNumberForReasign;
800 jref6["time_to_ready_of_the_last_power_cycle_(sec)"] = farmLog.driveInformation2.timeToReady;
801 jref6["time_drive_is_held_in_staggered_spin_(sec)"] = farmLog.driveInformation2.timeHeld;
802 jref6["last_servo_spin_up_time_(sec)"] = farmLog.driveInformation2.lastServoSpinUpTime;
803
804 // Parameter 7: Environment Information Continued
805 json::ref jref7 = jref["environment_information_continued"];
806 jref7["current_12_volts"] = farmLog.environment2.current12v;
807 jref7["minimum_12_volts"] = farmLog.environment2.min12v;
808 jref7["maximum_12_volts"] = farmLog.environment2.max12v;
809 jref7["current_5_volts"] = farmLog.environment2.current5v;
810 jref7["minimum_5_volts"] = farmLog.environment2.min5v;
811 jref7["maximum_5_volts"] = farmLog.environment2.max5v;
812
813 // "By Head" Parameters
814 char buffer[128]; // Generic character buffer
815 json::ref jrefh = jref["head_information"];
816 farm_print_by_head_to_json(jrefh, buffer, "mr_head_resistance", (int64_t*)farmLog.mrHeadResistance.headValue, farmLog.driveInformation.heads);
817 farm_print_by_head_to_json(jrefh, buffer, "number_of_reallocated_sectors", (int64_t*)farmLog.totalReallocations.headValue, farmLog.driveInformation.heads);
818 farm_print_by_head_to_json(jrefh, buffer, "number_of_reallocation_candidate_sectors", (int64_t*)farmLog.totalReallocationCanidates.headValue, farmLog.driveInformation.heads);
819 farm_print_by_head_to_json(jrefh, buffer, "write_power_on_(hrs)", (int64_t*)farmLog.writeWorkloadPowerOnTime.headValue, farmLog.driveInformation.heads);
820 farm_print_by_head_to_json(jrefh, buffer, "cum_lifetime_unrecoverable_read_repeating", (int64_t*)farmLog.cumulativeUnrecoverableReadRepeat.headValue, farmLog.driveInformation.heads);
821 farm_print_by_head_to_json(jrefh, buffer, "cum_lifetime_unrecoverable_read_unique", (int64_t*)farmLog.cumulativeUnrecoverableReadUnique.headValue, farmLog.driveInformation.heads);
822 farm_print_by_head_to_json(jrefh, buffer, "second_mr_head_resistance", (int64_t*)farmLog.secondMRHeadResistance.headValue, farmLog.driveInformation.heads);
823
824 // "By Actuator" Parameters
825 for (unsigned i = 0; i < sizeof(actrefs) / sizeof(actrefs[0]); i++) {
826 snprintf(buffer, sizeof(buffer), "actuator_information_%" PRIx64, actrefs[i].actuatorID);
827 json::ref jrefa = jref[buffer];
828 jrefa["head_load_events"] = actrefs[i].headLoadEvents;
829 jrefa["timestamp_of_last_idd_test"] = actrefs[i].timelastIDDTest;
830 jrefa["sub-command_of_last_idd_test"] = actrefs[i].subcommandlastIDDTest;
831 jrefa["number_of_reallocated_sector_reclamations"] = actrefs[i].numberGListReclam;
832 jrefa["servo_status"] = actrefs[i].servoStatus;
833 jrefa["number_of_slipped_sectors_before_idd_scan"] = actrefs[i].numberSlippedSectorsBeforeIDD;
834 jrefa["number_of_slipped_sectors_before_idd_scan"] = actrefs[i].numberSlippedSectorsAfterIDD;
835 jrefa["number_of_resident_reallocated_sectors_before_idd_scan"] = actrefs[i].numberResidentReallocatedBeforeIDD;
836 jrefa["number_of_resident_reallocated_sectors_before_idd_scan"] = actrefs[i].numberResidentReallocatedAfterIDD;
837 jrefa["successfully_scrubbed_sectors_before_idd_scan"] = actrefs[i].numberScrubbedSectorsBeforeIDD;
838 jrefa["successfully_scrubbed_sectors_before_idd_scan"] = actrefs[i].numberScrubbedSectorsAfterIDD;
839 jrefa["number_of_dos_scans_performed"] = actrefs[i].dosScansPerformed;
840 jrefa["number_of_lbas_corrected_by_isp"] = actrefs[i].lbasCorrectedISP;
841 jrefa["number_of_valid_parity_sectors"] = actrefs[i].numberValidParitySectors;
842 jrefa["number_of_lbas_corrected_by_parity_sector"] = actrefs[i].numberLBACorrectedParitySector;
843 }
844
845 // "By Actuator" Flash LED Information
846 for (unsigned i = 0; i < sizeof(fledrefs) / sizeof(fledrefs[0]); i++) {
847 snprintf(buffer, sizeof(buffer), "actuator_flash_led_information_%" PRIx64, fledrefs[i].actuatorID);
848 json::ref jrefa = jref[buffer];
849 jrefa["total_flash_led_events"] = fledrefs[i].totalFlashLED;
850 jrefa["index_of_last_flash_led"] = fledrefs[i].indexFlashLED;
851
852 snprintf(buffer, sizeof(buffer), "event_%" PRIx64, fledrefs[i].actuatorID);
853 flash_led_size = sizeof(fledrefs[i].flashLEDArray) / sizeof(fledrefs[i].flashLEDArray[0]);
854 for (uint8_t j = flash_led_size; j > 0; j--) {
855 index = (j - fledrefs[i].indexFlashLED + flash_led_size) % flash_led_size;
856 jrefa[buffer]["event_information"] = fledrefs[i].flashLEDArray[index];
857 jrefa[buffer]["timestamp_of_event"] = fledrefs[i].universalTimestampFlashLED[index];
858 jrefa[buffer]["power_cycle_event"] = fledrefs[i].powerCycleFlashLED[index];
859 }
860 }
861
862 // "By Actuator" Reallocation Information
863 for (unsigned i = 0; i < sizeof(ararefs) / sizeof(ararefs[0]); i++) {
864 snprintf(buffer, sizeof(buffer), "actuator_reallocation_information_%" PRIx64, ararefs[i].actuatorID);
865 json::ref jrefa = jref[buffer];
866 jrefa["number_of_reallocated_sectors"] = ararefs[i].totalReallocations;
867 jrefa["number_of_reallocated_candidate_sectors"] = ararefs[i].totalReallocationCanidates;
868 }
869}
Reference to a JSON element.
Definition: json.h:105
void ataPrintFarmLog(const ataFarmLog &farmLog)
Definition: farmprint.cpp:150
static void farm_print_by_head_to_text(const char *desc, const int64_t *paramArray, const uint64_t numHeads)
Definition: farmprint.cpp:69
static uint64_t farm_byte_swap(const uint64_t param)
Definition: farmprint.cpp:98
static void farm_print_by_head_to_json(const json::ref &jref, char(&buffer)[128], const char *desc, const int64_t *paramArray, const uint64_t numHeads)
Definition: farmprint.cpp:84
void scsiPrintFarmLog(const scsiFarmLog &farmLog)
Definition: farmprint.cpp:509
static const char * farm_get_form_factor(const uint64_t formFactor)
Definition: farmprint.cpp:45
static char * farm_format_id_string(char *buffer, const uint64_t param)
Definition: farmprint.cpp:111
static const char * farm_get_recording_type(const uint64_t driveRecordingType)
Definition: farmprint.cpp:26
ptr_t buffer
Definition: megaraid.h:3
json jglb
Definition: smartctl.cpp:53
void void jinf(const char *fmt,...) __attribute_format_printf(1
void jout(const char *fmt,...) __attribute_format_printf(1
uint64_t maxNumberForReasign
Definition: farmcmds.h:85
uint64_t headLoadEvents
Definition: farmcmds.h:72
uint64_t headFlightHours
Definition: farmcmds.h:71
uint64_t modelNumber[10]
Definition: farmcmds.h:82
uint64_t dateOfAssembly
Definition: farmcmds.h:86
uint64_t worldWideName2
Definition: farmcmds.h:55
uint64_t featuresSupported
Definition: farmcmds.h:67
uint64_t deviceCapacity
Definition: farmcmds.h:57
uint64_t powerCycleCount
Definition: farmcmds.h:73
uint64_t deviceBufferSize
Definition: farmcmds.h:60
uint64_t driveRecordingType
Definition: farmcmds.h:83
uint64_t worldWideName
Definition: farmcmds.h:54
uint64_t serialNumber2
Definition: farmcmds.h:53
uint64_t depopulationHeadMask
Definition: farmcmds.h:87
uint64_t deviceInterface
Definition: farmcmds.h:56
uint64_t featuresEnabled
Definition: farmcmds.h:68
uint64_t totalMechanicalStartRetries
Definition: farmcmds.h:127
uint64_t totalReadRecoveryAttepts
Definition: farmcmds.h:126
uint64_t cumulativeUnrecoverableReadUnique[24]
Definition: farmcmds.h:150
uint64_t totalUnrecoverableWriteErrors
Definition: farmcmds.h:124
uint64_t indexFlashLED
Definition: farmcmds.h:139
uint64_t totalASREvents
Definition: farmcmds.h:129
uint64_t uncorrectables
Definition: farmcmds.h:140
uint64_t totalCRCErrors
Definition: farmcmds.h:130
uint64_t totalReallocationCanidates
Definition: farmcmds.h:128
uint64_t totalFlashLED
Definition: farmcmds.h:138
uint64_t attrSpinRetryCount
Definition: farmcmds.h:131
uint64_t powerCycleFlashLED[8]
Definition: farmcmds.h:147
uint64_t cumulativeUnrecoverableReadERC
Definition: farmcmds.h:148
uint64_t totalReallocations
Definition: farmcmds.h:125
uint64_t totalUnrecoverableReadErrors
Definition: farmcmds.h:123
uint64_t cumulativeUnrecoverableReadRepeating[24]
Definition: farmcmds.h:149
uint64_t attrIOEDCErrors
Definition: farmcmds.h:134
uint64_t worstSpinRretryCount
Definition: farmcmds.h:133
uint64_t universalTimestampFlashLED[8]
Definition: farmcmds.h:146
uint64_t normalSpinRetryCount
Definition: farmcmds.h:132
uint64_t overFiveSecCTO
Definition: farmcmds.h:136
uint64_t overSevenSecCTO
Definition: farmcmds.h:137
uint64_t flashLEDArray[8]
Definition: farmcmds.h:142
uint64_t minorRev
Definition: farmcmds.h:37
uint64_t pagesSupported
Definition: farmcmds.h:38
uint64_t majorRev
Definition: farmcmds.h:36
uint64_t copies
Definition: farmcmds.h:42
uint64_t pageSize
Definition: farmcmds.h:40
uint64_t headsSupported
Definition: farmcmds.h:41
uint64_t frameCapture
Definition: farmcmds.h:43
uint64_t logSize
Definition: farmcmds.h:39
ataFarmErrorStatistics error
Definition: farmcmds.h:266
ataFarmHeader header
Definition: farmcmds.h:263
ataFarmReliabilityStatistics reliability
Definition: farmcmds.h:268
ataFarmWorkloadStatistics workload
Definition: farmcmds.h:265
ataFarmEnvironmentStatistics environment
Definition: farmcmds.h:267
ataFarmDriveInformation driveInformation
Definition: farmcmds.h:264
int64_t RVGASkipWriteDetect[24]
Definition: farmcmds.h:215
int64_t secondMRHeadResistance[24]
Definition: farmcmds.h:251
int64_t writeWorkloadPowerOnTime[24]
Definition: farmcmds.h:246
uint64_t mrHeadResistance[24]
Definition: farmcmds.h:229
int64_t DVGASkipWriteDetect[24]
Definition: farmcmds.h:214
int64_t reallocatedSectors[24]
Definition: farmcmds.h:240
int64_t FVGASkipWriteDetect[24]
Definition: farmcmds.h:216
int64_t skipWriteDetectThresExceeded[24]
Definition: farmcmds.h:217
int64_t numberLBACorrectedParitySector
Definition: farmcmds.h:257
int64_t reallocationCandidates[24]
Definition: farmcmds.h:241
uint64_t totalNumberofOtherCMDS
Definition: farmcmds.h:101
uint64_t writeCommandsByRadius1
Definition: farmcmds.h:111
uint64_t totalWriteCommands
Definition: farmcmds.h:98
uint64_t readCommandsByRadius1
Definition: farmcmds.h:107
uint64_t writeCommandsByRadius3
Definition: farmcmds.h:113
uint64_t writeCommandsByRadius4
Definition: farmcmds.h:114
uint64_t readCommandsByRadius3
Definition: farmcmds.h:109
uint64_t writeCommandsByRadius2
Definition: farmcmds.h:112
uint64_t totalReadCommands
Definition: farmcmds.h:97
uint64_t readCommandsByRadius4
Definition: farmcmds.h:110
uint64_t readCommandsByRadius2
Definition: farmcmds.h:108
uint64_t flashLEDArray[8]
Definition: farmcmds.h:580
uint64_t powerCycleFlashLED[8]
Definition: farmcmds.h:582
uint64_t universalTimestampFlashLED[8]
Definition: farmcmds.h:581
uint64_t indexFlashLED
Definition: farmcmds.h:579
uint64_t totalFlashLED
Definition: farmcmds.h:578
uint64_t numberSlippedSectorsBeforeIDD
Definition: farmcmds.h:553
uint64_t lbasCorrectedISP
Definition: farmcmds.h:560
uint64_t numberResidentReallocatedAfterIDD
Definition: farmcmds.h:556
uint64_t headLoadEvents
Definition: farmcmds.h:546
uint64_t subcommandlastIDDTest
Definition: farmcmds.h:550
uint64_t numberScrubbedSectorsAfterIDD
Definition: farmcmds.h:558
uint64_t numberLBACorrectedParitySector
Definition: farmcmds.h:565
uint64_t dosScansPerformed
Definition: farmcmds.h:559
uint64_t numberResidentReallocatedBeforeIDD
Definition: farmcmds.h:555
uint64_t numberScrubbedSectorsBeforeIDD
Definition: farmcmds.h:557
uint64_t numberGListReclam
Definition: farmcmds.h:551
uint64_t numberValidParitySectors
Definition: farmcmds.h:561
uint64_t servoStatus
Definition: farmcmds.h:552
uint64_t numberSlippedSectorsAfterIDD
Definition: farmcmds.h:554
uint64_t timelastIDDTest
Definition: farmcmds.h:549
uint64_t headValue[20]
Definition: farmcmds.h:533
uint64_t depopulationHeadMask
Definition: farmcmds.h:496
uint64_t maxNumberForReasign
Definition: farmcmds.h:503
uint64_t lastServoSpinUpTime
Definition: farmcmds.h:506
uint64_t disparityErrorCodeA
Definition: farmcmds.h:406
uint64_t lossOfDWordSyncA
Definition: farmcmds.h:408
uint64_t phyResetProblemA
Definition: farmcmds.h:410
uint64_t disparityErrorCodeB
Definition: farmcmds.h:407
uint64_t invalidDWordCountB
Definition: farmcmds.h:405
uint64_t totalUnrecoverableWriteErrors
Definition: farmcmds.h:386
uint64_t invalidDWordCountA
Definition: farmcmds.h:404
uint64_t lossOfDWordSyncB
Definition: farmcmds.h:409
uint64_t totalMechanicalStartRetries
Definition: farmcmds.h:389
uint64_t phyResetProblemB
Definition: farmcmds.h:411
uint64_t totalUnrecoverableReadErrors
Definition: farmcmds.h:385
uint64_t minorRev
Definition: farmcmds.h:300
uint64_t headsSupported
Definition: farmcmds.h:304
uint64_t parametersSupported
Definition: farmcmds.h:301
uint64_t majorRev
Definition: farmcmds.h:299
uint64_t frameCapture
Definition: farmcmds.h:306
uint64_t logSize
Definition: farmcmds.h:302
scsiFarmByActuator actuator0
Definition: farmcmds.h:660
scsiFarmByHead totalReallocations
Definition: farmcmds.h:630
scsiFarmHeader header
Definition: farmcmds.h:605
scsiFarmDriveInformation2 driveInformation2
Definition: farmcmds.h:611
scsiFarmByHead totalReallocationCanidates
Definition: farmcmds.h:631
scsiFarmByHead cumulativeUnrecoverableReadUnique
Definition: farmcmds.h:638
scsiFarmByActuatorReallocation actuatorReallocation1
Definition: farmcmds.h:665
scsiFarmEnvironmentStatistics2 environment2
Definition: farmcmds.h:612
scsiFarmReliabilityStatistics reliability
Definition: farmcmds.h:610
scsiFarmDriveInformation driveInformation
Definition: farmcmds.h:606
scsiFarmByActuator actuator1
Definition: farmcmds.h:663
scsiFarmByHead writeWorkloadPowerOnTime
Definition: farmcmds.h:635
scsiFarmEnvironmentStatistics environment
Definition: farmcmds.h:609
scsiFarmWorkloadStatistics workload
Definition: farmcmds.h:607
scsiFarmByActuatorFLED actuatorFLED1
Definition: farmcmds.h:664
scsiFarmByHead secondMRHeadResistance
Definition: farmcmds.h:648
scsiFarmByActuatorReallocation actuatorReallocation2
Definition: farmcmds.h:668
scsiFarmByActuatorFLED actuatorFLED0
Definition: farmcmds.h:661
scsiFarmByHead cumulativeUnrecoverableReadRepeat
Definition: farmcmds.h:637
scsiFarmByActuatorReallocation actuatorReallocation0
Definition: farmcmds.h:662
scsiFarmByActuator actuator3
Definition: farmcmds.h:669
scsiFarmErrorStatistics error
Definition: farmcmds.h:608
scsiFarmByActuatorReallocation actuatorReallocation3
Definition: farmcmds.h:671
scsiFarmByActuator actuator2
Definition: farmcmds.h:666
scsiFarmByHead mrHeadResistance
Definition: farmcmds.h:623
scsiFarmByActuatorFLED actuatorFLED2
Definition: farmcmds.h:667
scsiFarmByActuatorFLED actuatorFLED3
Definition: farmcmds.h:670
uint64_t writeCommandsByRadius3
Definition: farmcmds.h:372
uint64_t writeCommandsByRadius1
Definition: farmcmds.h:370
uint64_t writeCommandsByRadius4
Definition: farmcmds.h:373
uint64_t writeCommandsByRadius2
Definition: farmcmds.h:371
uint64_t readCommandsByRadius1
Definition: farmcmds.h:366
uint64_t readCommandsByRadius3
Definition: farmcmds.h:368
uint64_t totalNumberofOtherCMDS
Definition: farmcmds.h:363
uint64_t readCommandsByRadius2
Definition: farmcmds.h:367
uint64_t readCommandsByRadius4
Definition: farmcmds.h:369
bool isbigendian()
Definition: utility.h:82