]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
move show_intel_smart_log to intel-nvme.c
authorChristoph Hellwig <hch@lst.de>
Mon, 13 Mar 2017 23:10:51 +0000 (17:10 -0600)
committerKeith Busch <keith.busch@intel.com>
Tue, 14 Mar 2017 15:00:13 +0000 (11:00 -0400)
To fit in with the rest of the plugin infrastructure.

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

index df0155a815fb5ef04fb7c8ae8b5c9152b07c36c6..dc1347501fe659bafa272bbf446f7c3945ed6b80 100644 (file)
@@ -48,6 +48,56 @@ static int id_ctrl(int argc, char **argv, struct command *cmd, struct plugin *pl
        return __id_ctrl(argc, argv, cmd, plugin, intel_id_ctrl);
 }
 
+static void show_intel_smart_log(struct nvme_additional_smart_log *smart,
+               unsigned int nsid, const char *devname)
+{
+       printf("Additional Smart Log for NVME device:%s namespace-id:%x\n",
+               devname, nsid);
+       printf("key                               normalized raw\n");
+       printf("program_fail_count              : %3d%%       %"PRIu64"\n",
+               smart->program_fail_cnt.norm,
+               int48_to_long(smart->program_fail_cnt.raw));
+       printf("erase_fail_count                : %3d%%       %"PRIu64"\n",
+               smart->erase_fail_cnt.norm,
+               int48_to_long(smart->erase_fail_cnt.raw));
+       printf("wear_leveling                   : %3d%%       min: %u, max: %u, avg: %u\n",
+               smart->wear_leveling_cnt.norm,
+               le16_to_cpu(smart->wear_leveling_cnt.wear_level.min),
+               le16_to_cpu(smart->wear_leveling_cnt.wear_level.max),
+               le16_to_cpu(smart->wear_leveling_cnt.wear_level.avg));
+       printf("end_to_end_error_detection_count: %3d%%       %"PRIu64"\n",
+               smart->e2e_err_cnt.norm,
+               int48_to_long(smart->e2e_err_cnt.raw));
+       printf("crc_error_count                 : %3d%%       %"PRIu64"\n",
+               smart->crc_err_cnt.norm,
+               int48_to_long(smart->crc_err_cnt.raw));
+       printf("timed_workload_media_wear       : %3d%%       %.3f%%\n",
+               smart->timed_workload_media_wear.norm,
+               ((float)int48_to_long(smart->timed_workload_media_wear.raw)) / 1024);
+       printf("timed_workload_host_reads       : %3d%%       %"PRIu64"%%\n",
+               smart->timed_workload_host_reads.norm,
+               int48_to_long(smart->timed_workload_host_reads.raw));
+       printf("timed_workload_timer            : %3d%%       %"PRIu64" min\n",
+               smart->timed_workload_timer.norm,
+               int48_to_long(smart->timed_workload_timer.raw));
+       printf("thermal_throttle_status         : %3d%%       %u%%, cnt: %u\n",
+               smart->thermal_throttle_status.norm,
+               smart->thermal_throttle_status.thermal_throttle.pct,
+               smart->thermal_throttle_status.thermal_throttle.count);
+       printf("retry_buffer_overflow_count     : %3d%%       %"PRIu64"\n",
+               smart->retry_buffer_overflow_cnt.norm,
+               int48_to_long(smart->retry_buffer_overflow_cnt.raw));
+       printf("pll_lock_loss_count             : %3d%%       %"PRIu64"\n",
+               smart->pll_lock_loss_cnt.norm,
+               int48_to_long(smart->pll_lock_loss_cnt.raw));
+       printf("nand_bytes_written              : %3d%%       sectors: %"PRIu64"\n",
+               smart->nand_bytes_written.norm,
+               int48_to_long(smart->nand_bytes_written.raw));
+       printf("host_bytes_written              : %3d%%       sectors: %"PRIu64"\n",
+               smart->host_bytes_written.norm,
+               int48_to_long(smart->host_bytes_written.raw));
+}
+
 static int get_additional_smart_log(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
        struct nvme_additional_smart_log smart_log;
index 6f40303c22c6223189ba4316db68e204dc398a62..4eddbd4d38a054eaa4ab544755d493c427f280e6 100644 (file)
@@ -814,54 +814,6 @@ void show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char
        }
 }
 
-void show_intel_smart_log(struct nvme_additional_smart_log *smart, unsigned int nsid, const char *devname)
-{
-       printf("Additional Smart Log for NVME device:%s namespace-id:%x\n", devname, nsid);
-       printf("key                               normalized raw\n");
-       printf("program_fail_count              : %3d%%       %"PRIu64"\n",
-               smart->program_fail_cnt.norm,
-               int48_to_long(smart->program_fail_cnt.raw));
-       printf("erase_fail_count                : %3d%%       %"PRIu64"\n",
-               smart->erase_fail_cnt.norm,
-               int48_to_long(smart->erase_fail_cnt.raw));
-       printf("wear_leveling                   : %3d%%       min: %u, max: %u, avg: %u\n",
-               smart->wear_leveling_cnt.norm,
-               le16_to_cpu(smart->wear_leveling_cnt.wear_level.min),
-               le16_to_cpu(smart->wear_leveling_cnt.wear_level.max),
-               le16_to_cpu(smart->wear_leveling_cnt.wear_level.avg));
-       printf("end_to_end_error_detection_count: %3d%%       %"PRIu64"\n",
-               smart->e2e_err_cnt.norm,
-               int48_to_long(smart->e2e_err_cnt.raw));
-       printf("crc_error_count                 : %3d%%       %"PRIu64"\n",
-               smart->crc_err_cnt.norm,
-               int48_to_long(smart->crc_err_cnt.raw));
-       printf("timed_workload_media_wear       : %3d%%       %.3f%%\n",
-               smart->timed_workload_media_wear.norm,
-               ((float)int48_to_long(smart->timed_workload_media_wear.raw)) / 1024);
-       printf("timed_workload_host_reads       : %3d%%       %"PRIu64"%%\n",
-               smart->timed_workload_host_reads.norm,
-               int48_to_long(smart->timed_workload_host_reads.raw));
-       printf("timed_workload_timer            : %3d%%       %"PRIu64" min\n",
-               smart->timed_workload_timer.norm,
-               int48_to_long(smart->timed_workload_timer.raw));
-       printf("thermal_throttle_status         : %3d%%       %u%%, cnt: %u\n",
-               smart->thermal_throttle_status.norm,
-               smart->thermal_throttle_status.thermal_throttle.pct,
-               smart->thermal_throttle_status.thermal_throttle.count);
-       printf("retry_buffer_overflow_count     : %3d%%       %"PRIu64"\n",
-               smart->retry_buffer_overflow_cnt.norm,
-               int48_to_long(smart->retry_buffer_overflow_cnt.raw));
-       printf("pll_lock_loss_count             : %3d%%       %"PRIu64"\n",
-               smart->pll_lock_loss_cnt.norm,
-               int48_to_long(smart->pll_lock_loss_cnt.raw));
-       printf("nand_bytes_written              : %3d%%       sectors: %"PRIu64"\n",
-               smart->nand_bytes_written.norm,
-               int48_to_long(smart->nand_bytes_written.raw));
-       printf("host_bytes_written              : %3d%%       sectors: %"PRIu64"\n",
-               smart->host_bytes_written.norm,
-               int48_to_long(smart->host_bytes_written.raw));
-}
-
 char *nvme_feature_to_string(int feature)
 {
        switch (feature) {
index f5e4c8f4d157f02b0c90fadc4589adc34e31967e..cd1c9e755fe34a24a62c63f07b135a5b7ced0891 100644 (file)
@@ -23,7 +23,6 @@ void show_nvme_id_ns(struct nvme_id_ns *ns, unsigned int flags);
 void show_nvme_resv_report(struct nvme_reservation_status *status);
 void show_lba_range(struct nvme_lba_range_type *lbrt, int nr_ranges);
 void show_error_log(struct nvme_error_log_page *err_log, int entries, const char *devname);
-void show_intel_smart_log(struct nvme_additional_smart_log *smart, unsigned int nsid, const char *devname);
 void show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char *devname);
 void show_fw_log(struct nvme_firmware_log_page *fw_log, const char *devname);
 void show_ctrl_registers(void *bar, unsigned int mode);