]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
sfx: fixed some of add_smart_log_items not shown issue
authorWei Hou <wei.hou@scaleflux.com>
Wed, 27 Apr 2022 01:40:00 +0000 (09:40 +0800)
committerDaniel Wagner <dwagner@suse.de>
Fri, 13 May 2022 14:12:37 +0000 (16:12 +0200)
plugins/scaleflux/sfx-nvme.c

index d20e2ceb98c037c219f7fdc2291a624460756a45..b18fd9ff1d1d36b076c87d5d0e5cce9b38b21ba0 100644 (file)
@@ -261,6 +261,31 @@ static void show_sfx_smart_log_jsn(struct nvme_additional_smart_log *smart,
        json_object_add_value_int(entry_stats, "raw",     int48_to_long(smart->read_ecc_cnt.raw));
        json_object_add_value_object(dev_stats, "read_ecc_cnt", entry_stats);
 
+       entry_stats = json_create_object();
+       json_object_add_value_int(entry_stats, "normalized", smart->non_media_crc_err_cnt.norm);
+       json_object_add_value_int(entry_stats, "raw", int48_to_long(smart->non_media_crc_err_cnt.raw));
+       json_object_add_value_object(dev_stats, "non_media_crc_err_cnt", entry_stats);
+
+       entry_stats = json_create_object();
+       json_object_add_value_int(entry_stats, "normalized", smart->compression_path_err_cnt.norm);
+       json_object_add_value_int(entry_stats, "raw", int48_to_long(smart->compression_path_err_cnt.raw));
+       json_object_add_value_object(dev_stats, "compression_path_err_cnt", entry_stats);
+
+       entry_stats = json_create_object();
+       json_object_add_value_int(entry_stats, "normalized", smart->out_of_space_flag.norm);
+       json_object_add_value_int(entry_stats, "raw", int48_to_long(smart->out_of_space_flag.raw));
+       json_object_add_value_object(dev_stats, "out_of_space_flag", entry_stats);
+
+       entry_stats = json_create_object();
+       json_object_add_value_int(entry_stats, "normalized", smart->physical_usage_ratio.norm);
+       json_object_add_value_int(entry_stats, "raw", int48_to_long(smart->physical_usage_ratio.raw));
+       json_object_add_value_object(dev_stats, "physical_usage_ratio", entry_stats);
+
+       entry_stats = json_create_object();
+       json_object_add_value_int(entry_stats, "normalized", smart->grown_bb.norm);
+       json_object_add_value_int(entry_stats, "raw", int48_to_long(smart->grown_bb.raw));
+       json_object_add_value_object(dev_stats, "grown_bb", entry_stats);
+
        json_object_add_value_object(root, "Device stats", dev_stats);
 
        json_print_object(root, NULL);
@@ -331,6 +356,22 @@ static void show_sfx_smart_log(struct nvme_additional_smart_log *smart,
        printf("read_timeout_cnt                : %3d%%       %"PRIu64"\n",
                        smart->read_timeout_cnt.norm,
                        int48_to_long(smart->read_timeout_cnt.raw));
+       printf("non_media_crc_err_cnt           : %3d%%       %" PRIu64 "\n",
+              smart->non_media_crc_err_cnt.norm,
+              int48_to_long(smart->non_media_crc_err_cnt.raw));
+       printf("compression_path_err_cnt        : %3d%%       %" PRIu64 "\n",
+              smart->compression_path_err_cnt.norm,
+              int48_to_long(smart->compression_path_err_cnt.raw));
+       printf("out_of_space_flag               : %3d%%       %" PRIu64 "\n",
+              smart->out_of_space_flag.norm,
+              int48_to_long(smart->out_of_space_flag.raw));
+       printf("phy_capacity_used_ratio         : %3d%%       %" PRIu64 "\n",
+              smart->physical_usage_ratio.norm,
+              int48_to_long(smart->physical_usage_ratio.raw));
+       printf("grown_bb_count                  : %3d%%       %" PRIu64 "\n",
+              smart->grown_bb.norm, int48_to_long(smart->grown_bb.raw));
+
+
 }
 
 static int get_additional_smart_log(int argc, char **argv, struct command *cmd, struct plugin *plugin)