]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
remove json_add_smart_log
authorChristoph Hellwig <hch@lst.de>
Mon, 13 Mar 2017 23:10:52 +0000 (17:10 -0600)
committerKeith Busch <keith.busch@intel.com>
Tue, 14 Mar 2017 15:01:26 +0000 (11:01 -0400)
This is the json variant of the Intel additional smart log, but it
appears to be entirely unused.  If we want to bring it back it should
be moved to intel-nvme.c, though.

Signed-off-by: Christoph Hellwig <hch@lst.de>
nvme-print.c
nvme-print.h

index 4eddbd4d38a054eaa4ab544755d493c427f280e6..a86902e6fbf1a4dbbe1924551119e5662dd4f178 100644 (file)
@@ -1408,59 +1408,6 @@ void json_fw_log(struct nvme_firmware_log_page *fw_log, const char *devname)
        json_free_object(root);
 }
 
-void json_add_smart_log(struct nvme_additional_smart_log *smart,
-                       unsigned int nsid, const char *devname)
-{
-       struct json_object *root;
-       struct json_object *data;
-       char fmt[128];
-
-       root = json_create_object();
-       data = json_create_object();
-
-       json_object_add_value_int(data, "Program Fail Count",
-                                 int48_to_long(smart->program_fail_cnt.raw));
-       json_object_add_value_int(data, "Erase Fail Count",
-                                 int48_to_long(smart->erase_fail_cnt.raw));
-       json_object_add_value_int(data, "Wear Leveling Min",
-                                 le16toh(smart->wear_leveling_cnt.wear_level.min));
-       json_object_add_value_int(data, "Wear Leveling Max",
-                                 le16toh(smart->wear_leveling_cnt.wear_level.max));
-       json_object_add_value_int(data, "Wear Leveling Avg",
-                                 le16toh(smart->wear_leveling_cnt.wear_level.avg));
-       json_object_add_value_int(data, "End-to-end Error Detection Count",
-                                 int48_to_long(smart->e2e_err_cnt.raw));
-       json_object_add_value_int(data, "CRC Error Count",
-                                 int48_to_long(smart->crc_err_cnt.raw));
-       json_object_add_value_float(data, "Timed Workload Media Wear",
-                                   ((long double)int48_to_long(smart->timed_workload_media_wear.raw)) / 1024);
-
-       json_object_add_value_int(data, "Timed Workload Host Reads",
-                                 int48_to_long(smart->timed_workload_host_reads.raw));
-       json_object_add_value_int(data, "Timed Workload Timer",
-                                 int48_to_long(smart->timed_workload_timer.raw));
-       snprintf(fmt, sizeof(fmt), "%u%%",
-                smart->thermal_throttle_status.thermal_throttle.pct);
-       json_object_add_value_string(data, "Thermal Throttle status Percentage",
-                                    fmt);
-       json_object_add_value_int(data, "Thermal Throttle Status Count",
-                                 smart->thermal_throttle_status.thermal_throttle.count);
-       json_object_add_value_int(data, "Retry Buffer Overflow Count",
-                                 int48_to_long(smart->retry_buffer_overflow_cnt.raw));
-       json_object_add_value_int(data, "PLL Lock Loss Count",
-                                 int48_to_long(smart->pll_lock_loss_cnt.raw));
-       json_object_add_value_int(data, "Nand Bytes Written",
-                                 int48_to_long(smart->nand_bytes_written.raw));
-       json_object_add_value_int(data, "Host Bytes Written",
-                                 int48_to_long(smart->host_bytes_written.raw));
-
-       snprintf(fmt, sizeof(fmt), "Additional Smart Log for %s", devname);
-       json_object_add_value_object(root, fmt, data);
-       json_print_object(root, NULL);
-       json_free_object(data);
-       json_free_object(root);
-}
-
 void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char *devname)
 {
        struct json_object *root;
index cd1c9e755fe34a24a62c63f07b135a5b7ced0891..0502d0d48ee4eaba27dab3a0d9e1d2f6034ee4f4 100644 (file)
@@ -37,8 +37,6 @@ void json_nvme_id_ns(struct nvme_id_ns *ns, unsigned int flags);
 void json_nvme_resv_report(struct nvme_reservation_status *status);
 void json_error_log(struct nvme_error_log_page *err_log, int entries, const char *devname);
 void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char *devname);
-void json_add_smart_log(struct nvme_additional_smart_log *smart,
-                       unsigned int nsid, const char *devname);
 void json_fw_log(struct nvme_firmware_log_page *fw_log, const char *devname);
 void json_print_list_items(struct list_item *items, unsigned amnt);