Skip to content

Commit 549a13a

Browse files
author
Gopinath P
committed
plugin/ocp: Added OCP 2.7 smart extended log changes
ocp_smart_extended_log strcuture enhancement and print statement modification in stdout_smart_extended_log and json_smart_extended_log_v1 Reviewed-by: Karthik Balan <[email protected]> Reviewed-by: Arunpandian J <[email protected]> Signed-off-by: Gopinath P <[email protected]>
1 parent 50ec8d9 commit 549a13a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

plugins/ocp/ocp-print-json.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ static void json_smart_extended_log_v1(struct ocp_smart_extended_log *log)
243243
le16_to_cpu(log->media_dies_offline));
244244
json_object_add_value_uint(root, "Max temperature recorded",
245245
log->max_temperature_recorded);
246+
json_object_add_value_uint(root, "Form factor",
247+
log->form_factor);
246248
json_object_add_value_uint64(root, "Nand avg erase count",
247249
le64_to_cpu(log->nand_avg_erase_count));
248250
json_object_add_value_uint(root, "Command timeouts",
@@ -276,6 +278,8 @@ static void json_smart_extended_log_v1(struct ocp_smart_extended_log *log)
276278
for (i = 0; i < 64; i++)
277279
ascii += sprintf(ascii, "%c", log->dssd_firmware_build_label[i]);
278280
json_object_add_value_string(root, "Dssd firmware build label", ascii_arr);
281+
json_object_add_value_uint(root, "Die in use bad nand block",
282+
le64_to_cpu(log->die_in_use_bad_nand_block));
279283
fallthrough;
280284
case 2 ... 3:
281285
json_object_add_value_uint(root, "Errata Version Field",

plugins/ocp/ocp-print-stdout.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ static void stdout_smart_extended_log(struct ocp_smart_extended_log *log, unsign
185185
le16_to_cpu(log->media_dies_offline));
186186
printf(" Max temperature recorded %d\n",
187187
log->max_temperature_recorded);
188+
printf(" Form factor %d\n",
189+
log->form_factor);
188190
printf(" Nand avg erase count %"PRIu64"\n",
189191
le64_to_cpu(log->nand_avg_erase_count));
190192
printf(" Command timeouts %"PRIu32"\n",
@@ -217,6 +219,8 @@ static void stdout_smart_extended_log(struct ocp_smart_extended_log *log, unsign
217219
for (i = 0; i < sizeof(log->dssd_firmware_build_label); i++)
218220
printf("%c", log->dssd_firmware_build_label[i]);
219221
printf("\n");
222+
printf(" Die in use bad nand block %"PRIu64"\n",
223+
le64_to_cpu(log->die_in_use_bad_nand_block));
220224
fallthrough;
221225
case 2 ... 3:
222226
printf(" Errata Version Field %d\n",

plugins/ocp/ocp-smart-extended-log.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct ocp_smart_extended_log {
128128
__le16 total_die_failure_tolerance; /* [219:218] */
129129
__le16 media_dies_offline; /* [221:220] */
130130
__u8 max_temperature_recorded; /* [222] */
131-
__u8 rsvd223; /* [223] */
131+
__u8 form_factor; /* [223] */
132132
__le64 nand_avg_erase_count; /* [231:224] */
133133
__le32 command_timeouts; /* [235:232] */
134134
__le32 sys_area_program_fail_count_raw; /* [239:236] */
@@ -145,8 +145,9 @@ struct ocp_smart_extended_log {
145145
__u8 lifetime_power_consumed[6]; /* [269:264] */
146146
__u8 dssd_firmware_revision[8]; /* [277:270] */
147147
__u8 dssd_firmware_build_uuid[16]; /* [293:278] */
148-
__u8 dssd_firmware_build_label[64]; /* [375:294] */
149-
__u8 rsvd358[136]; /* [493:358] */
148+
__u8 dssd_firmware_build_label[64]; /* [357:294] */
149+
__le64 die_in_use_bad_nand_block; /* [365:358] */
150+
__u8 rsvd358[128]; /* [493:366] */
150151
__le16 log_page_version; /* [495:494] */
151152
__u8 log_page_guid[16]; /* [511:496] */
152153
};

0 commit comments

Comments
 (0)