]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
nvme: Add 'Endurance Group Critical Warning Summary' to the Smart/Health information Log
authorRevanth Rajashekar <revanth.rajashekar@intel.com>
Fri, 13 Sep 2019 18:54:33 +0000 (12:54 -0600)
committerRevanth Rajashekar <revanth.rajashekar@intel.com>
Wed, 18 Sep 2019 16:58:43 +0000 (10:58 -0600)
      * Update show_smart_log
      * Update json_smart_log

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
linux/nvme.h
nvme-print.c

index 50b344165b0beb13eb9fd1ddda2e9b82119f92a5..888c2f3aba08fa1c2ee2194df151807f746f2554 100644 (file)
@@ -525,7 +525,8 @@ struct nvme_smart_log {
        __u8                    avail_spare;
        __u8                    spare_thresh;
        __u8                    percent_used;
-       __u8                    rsvd6[26];
+       __u8                    endu_grp_crit_warn_sumry;
+       __u8                    rsvd7[25];
        __u8                    data_units_read[16];
        __u8                    data_units_written[16];
        __u8                    host_reads[16];
index 5a63f661ae3353fd3eb3b2141523764fdc65ec5f..302ba501b7b8238c90df16fe11ea8fe0fa97f40b 100644 (file)
@@ -1705,45 +1705,46 @@ void show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char
        int i;
 
        printf("Smart Log for NVME device:%s namespace-id:%x\n", devname, nsid);
-       printf("critical_warning                    : %#x\n", smart->critical_warning);
-       printf("temperature                         : %d C\n", temperature);
-       printf("available_spare                     : %u%%\n", smart->avail_spare);
-       printf("available_spare_threshold           : %u%%\n", smart->spare_thresh);
-       printf("percentage_used                     : %u%%\n", smart->percent_used);
-       printf("data_units_read                     : %'.0Lf\n",
+       printf("critical_warning                        : %#x\n", smart->critical_warning);
+       printf("temperature                             : %d C\n", temperature);
+       printf("available_spare                         : %u%%\n", smart->avail_spare);
+       printf("available_spare_threshold               : %u%%\n", smart->spare_thresh);
+       printf("percentage_used                         : %u%%\n", smart->percent_used);
+       printf("endurance group critical warning summary: %#x\n", smart->endu_grp_crit_warn_sumry);
+       printf("data_units_read                         : %'.0Lf\n",
                int128_to_double(smart->data_units_read));
-       printf("data_units_written                  : %'.0Lf\n",
+       printf("data_units_written                      : %'.0Lf\n",
                int128_to_double(smart->data_units_written));
-       printf("host_read_commands                  : %'.0Lf\n",
+       printf("host_read_commands                      : %'.0Lf\n",
                int128_to_double(smart->host_reads));
-       printf("host_write_commands                 : %'.0Lf\n",
+       printf("host_write_commands                     : %'.0Lf\n",
                int128_to_double(smart->host_writes));
-       printf("controller_busy_time                : %'.0Lf\n",
+       printf("controller_busy_time                    : %'.0Lf\n",
                int128_to_double(smart->ctrl_busy_time));
-       printf("power_cycles                        : %'.0Lf\n",
+       printf("power_cycles                            : %'.0Lf\n",
                int128_to_double(smart->power_cycles));
-       printf("power_on_hours                      : %'.0Lf\n",
+       printf("power_on_hours                          : %'.0Lf\n",
                int128_to_double(smart->power_on_hours));
-       printf("unsafe_shutdowns                    : %'.0Lf\n",
+       printf("unsafe_shutdowns                        : %'.0Lf\n",
                int128_to_double(smart->unsafe_shutdowns));
-       printf("media_errors                        : %'.0Lf\n",
+       printf("media_errors                            : %'.0Lf\n",
                int128_to_double(smart->media_errors));
-       printf("num_err_log_entries                 : %'.0Lf\n",
+       printf("num_err_log_entries                     : %'.0Lf\n",
                int128_to_double(smart->num_err_log_entries));
-       printf("Warning Temperature Time            : %u\n", le32_to_cpu(smart->warning_temp_time));
-       printf("Critical Composite Temperature Time : %u\n", le32_to_cpu(smart->critical_comp_time));
+       printf("Warning Temperature Time                : %u\n", le32_to_cpu(smart->warning_temp_time));
+       printf("Critical Composite Temperature Time     : %u\n", le32_to_cpu(smart->critical_comp_time));
        for (i = 0; i < 8; i++) {
                __s32 temp = le16_to_cpu(smart->temp_sensor[i]);
 
                if (temp == 0)
                        continue;
-               printf("Temperature Sensor %d                : %d C\n", i + 1,
+               printf("Temperature Sensor %d           : %d C\n", i + 1,
                        temp - 273);
        }
-       printf("Thermal Management T1 Trans Count   : %u\n", le32_to_cpu(smart->thm_temp1_trans_count));
-       printf("Thermal Management T2 Trans Count   : %u\n", le32_to_cpu(smart->thm_temp2_trans_count));
-       printf("Thermal Management T1 Total Time    : %u\n", le32_to_cpu(smart->thm_temp1_total_time));
-       printf("Thermal Management T2 Total Time    : %u\n", le32_to_cpu(smart->thm_temp2_total_time));
+       printf("Thermal Management T1 Trans Count       : %u\n", le32_to_cpu(smart->thm_temp1_trans_count));
+       printf("Thermal Management T2 Trans Count       : %u\n", le32_to_cpu(smart->thm_temp2_trans_count));
+       printf("Thermal Management T1 Total Time        : %u\n", le32_to_cpu(smart->thm_temp1_total_time));
+       printf("Thermal Management T2 Total Time        : %u\n", le32_to_cpu(smart->thm_temp2_total_time));
 }
 
 void show_ana_log(struct nvme_ana_rsp_hdr *ana_log, const char *devname)
@@ -3209,6 +3210,8 @@ void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char
        json_object_add_value_int(root, "avail_spare", smart->avail_spare);
        json_object_add_value_int(root, "spare_thresh", smart->spare_thresh);
        json_object_add_value_int(root, "percent_used", smart->percent_used);
+       json_object_add_value_int(root, "endurance_grp_critical_warning_summary",
+                       smart->endu_grp_crit_warn_sumry);
        json_object_add_value_float(root, "data_units_read", data_units_read);
        json_object_add_value_float(root, "data_units_written", data_units_written);
        json_object_add_value_float(root, "host_read_commands", host_read_commands);