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