]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
Shannon Plugin update.
authorroot <root@localhost.localdomain>
Tue, 24 Dec 2019 09:42:56 +0000 (17:42 +0800)
committerKeith Busch <kbusch@kernel.org>
Thu, 26 Dec 2019 18:04:01 +0000 (11:04 -0700)
plugins/shannon/shannon-nvme.c

index 80db4665effbe9a639f258864468bbd657eada05..175d1e7c776efe9a754e5c2415a91bd564420c63 100644 (file)
@@ -39,7 +39,9 @@ typedef enum {
 
 #pragma pack(push,1)
 struct nvme_shannon_smart_log_item {
-       __u8                    _resv[5];
+       __u8                    rsv1[3];
+       __u8                    norm;
+       __u8                    rsv2;
        union {
                __u8            item_val[6];
                struct wear_level {
@@ -52,7 +54,7 @@ struct nvme_shannon_smart_log_item {
                        __u32   count;
                } thermal_throttle;
        };
-       __u8                    resv;
+       __u8                    _resv;
 };
 #pragma pack(pop)
 
@@ -66,35 +68,48 @@ static void show_shannon_smart_log(struct nvme_shannon_smart_log *smart,
 {
        printf("Additional Smart Log for NVME device:%s namespace-id:%x\n",
                devname, nsid);
-       printf("key                               value\n");
-       printf("program_fail_count              : %"PRIu64"\n",
+       printf("key                               normalized value\n");
+       printf("program_fail_count              : %3d%%       %"PRIu64"\n",
+               smart->items[PROGRAM_FAIL_CNT].norm,
                int48_to_long(smart->items[PROGRAM_FAIL_CNT].item_val));
-       printf("erase_fail_count                : %"PRIu64"\n",
+       printf("erase_fail_count                : %3d%%       %"PRIu64"\n",
+               smart->items[ERASE_FAIL_CNT].norm,
                int48_to_long(smart->items[ERASE_FAIL_CNT].item_val));
-       printf("wear_leveling                   : min: %u, max: %u, avg: %u\n",
+       printf("wear_leveling                   : %3d%%       min: %u, max: %u, avg: %u\n",
+               smart->items[WEARLEVELING_COUNT].norm,
                le16_to_cpu(smart->items[WEARLEVELING_COUNT].wear_level.min),
                le16_to_cpu(smart->items[WEARLEVELING_COUNT].wear_level.max),
                le16_to_cpu(smart->items[WEARLEVELING_COUNT].wear_level.avg));
-       printf("end_to_end_error_detection_count: %"PRIu64"\n",
+       printf("end_to_end_error_detection_count: %3d%%       %"PRIu64"\n",
+               smart->items[E2E_ERR_CNT].norm,
                int48_to_long(smart->items[E2E_ERR_CNT].item_val));
-       printf("crc_error_count                 : %"PRIu64"\n",
+       printf("crc_error_count                 : %3d%%       %"PRIu64"\n",
+               smart->items[CRC_ERR_CNT].norm,
                int48_to_long(smart->items[CRC_ERR_CNT].item_val));
-       printf("timed_workload_media_wear       : %.3f%%\n",
+       printf("timed_workload_media_wear       : %3d%%       %.3f%%\n",
+               smart->items[TIME_WORKLOAD_MEDIA_WEAR].norm,
                ((float)int48_to_long(smart->items[TIME_WORKLOAD_MEDIA_WEAR].item_val)) / 1024);
-       printf("timed_workload_host_reads       : %"PRIu64"%%\n",
+       printf("timed_workload_host_reads       : %3d%%       %"PRIu64"%%\n",
+               smart->items[TIME_WORKLOAD_HOST_READS].norm,
                int48_to_long(smart->items[TIME_WORKLOAD_HOST_READS].item_val));
-       printf("timed_workload_timer            : %"PRIu64" min\n",
+       printf("timed_workload_timer            : %3d%%       %"PRIu64" min\n",
+               smart->items[TIME_WORKLOAD_TIMER].norm,
                int48_to_long(smart->items[TIME_WORKLOAD_TIMER].item_val));
-       printf("thermal_throttle_status         : CurTTState: %u%%, TTActiveCnt: %u\n",
+       printf("thermal_throttle_status         : %3d%%       CurTTSta: %u%%, TTCnt: %u\n",
+               smart->items[THERMAL_THROTTLE].norm,
                smart->items[THERMAL_THROTTLE].thermal_throttle.st,
                smart->items[THERMAL_THROTTLE].thermal_throttle.count);
-       printf("retry_buffer_overflow_count     : %"PRIu64"\n",
+       printf("retry_buffer_overflow_count     : %3d%%       %"PRIu64"\n",
+               smart->items[RETRY_BUFFER_OVERFLOW].norm,
                int48_to_long(smart->items[RETRY_BUFFER_OVERFLOW].item_val));
-       printf("pll_lock_loss_count             : %"PRIu64"\n",
+       printf("pll_lock_loss_count             : %3d%%       %"PRIu64"\n",
+               smart->items[PLL_LOCK_LOSS].norm,
                int48_to_long(smart->items[PLL_LOCK_LOSS].item_val));
-       printf("nand_bytes_written              : sectors: %"PRIu64"\n",
+       printf("nand_bytes_written              : %3d%%       sectors: %"PRIu64"\n",
+               smart->items[NAND_WRITE].norm,
                int48_to_long(smart->items[NAND_WRITE].item_val));
-       printf("host_bytes_written              : sectors: %"PRIu64"\n",
+       printf("host_bytes_written              : %3d%%       sectors: %"PRIu64"\n",
+               smart->items[HOST_WRITE].norm,
                int48_to_long(smart->items[HOST_WRITE].item_val));
 }