From 012c17be05ab951b038c0fad637964a67b10989f Mon Sep 17 00:00:00 2001 From: Minsik Jeon Date: Wed, 8 Jan 2025 18:52:44 +0900 Subject: [PATCH] ocp-nvme: Add missing data media_dies_offline to smart_extended_log. related commit : https://github.com/linux-nvme/nvme-cli/commit/d4b5f77dc862530aed8523da3662ecab3850f0f4 Signed-off-by: Minsik Jeon --- plugins/ocp/ocp-print-json.c | 8 ++++++-- plugins/ocp/ocp-print-stdout.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/ocp/ocp-print-json.c b/plugins/ocp/ocp-print-json.c index 4346239c..e3ce2daf 100644 --- a/plugins/ocp/ocp-print-json.c +++ b/plugins/ocp/ocp-print-json.c @@ -239,8 +239,10 @@ static void json_smart_extended_log_v1(struct ocp_smart_extended_log *log) le16_to_cpu(log->total_media_dies)); json_object_add_value_uint(root, "Total die failure tolerance", le16_to_cpu(log->total_die_failure_tolerance)); + json_object_add_value_uint(root, "Media dies offline", + le16_to_cpu(log->media_dies_offline)); json_object_add_value_uint(root, "Max temperature recorded", - le16_to_cpu(log->max_temperature_recorded)); + log->max_temperature_recorded); json_object_add_value_uint64(root, "Nand avg erase count", le64_to_cpu(log->nand_avg_erase_count)); json_object_add_value_uint(root, "Command timeouts", @@ -399,8 +401,10 @@ static void json_smart_extended_log_v2(struct ocp_smart_extended_log *log) le16_to_cpu(log->total_media_dies)); json_object_add_value_uint(root, "total_die_failure_tolerance", le16_to_cpu(log->total_die_failure_tolerance)); + json_object_add_value_uint(root, "media_dies_offline", + le16_to_cpu(log->media_dies_offline)); json_object_add_value_uint(root, "max_temperature_recorded", - le16_to_cpu(log->max_temperature_recorded)); + log->max_temperature_recorded); json_object_add_value_uint64(root, "nand_avg_erase_count", le64_to_cpu(log->nand_avg_erase_count)); json_object_add_value_uint(root, "command_timeouts", diff --git a/plugins/ocp/ocp-print-stdout.c b/plugins/ocp/ocp-print-stdout.c index 0934b408..5e135873 100644 --- a/plugins/ocp/ocp-print-stdout.c +++ b/plugins/ocp/ocp-print-stdout.c @@ -184,7 +184,7 @@ static void stdout_smart_extended_log(struct ocp_smart_extended_log *log, unsign printf(" Media dies offline %"PRIu16"\n", le16_to_cpu(log->media_dies_offline)); printf(" Max temperature recorded %d\n", - le16_to_cpu(log->max_temperature_recorded)); + log->max_temperature_recorded); printf(" Nand avg erase count %"PRIu64"\n", le64_to_cpu(log->nand_avg_erase_count)); printf(" Command timeouts %"PRIu32"\n", -- 2.50.1