]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Added temperature information getting and text formatting
authorBrandon Paupore <brandon.paupore@wdc.com>
Fri, 19 Jun 2020 21:45:08 +0000 (16:45 -0500)
committerKeith Busch <kbusch@kernel.org>
Tue, 30 Jun 2020 17:31:53 +0000 (11:31 -0600)
plugins/wdc/wdc-nvme.c

index 548e14c6cb39cc7f6bfd7f6bf8341de8ad075d14..a1a357ee73148ca9217ee597def9e79ebdeb6a22 100644 (file)
@@ -6565,12 +6565,38 @@ static int wdc_vs_temperature_stats(int argc, char **argv,
        ret = nvme_smart_log(fd, NVME_NSID_ALL, &smart_log);
 
        if (ret == 0) {
+                printf("Temperature Stats for NVME device:%s namespace-id:%x\n",
+                    devicename, WDC_DE_GLOBAL_NSID);
+
                int temperature = ((smart_log.temperature[1] << 8) |
                                    smart_log.temperature[0]) - 273;
 
-               printf("temperature                             : %d C\n",
+               printf("temperature                             : %d °C\n",
                        temperature);
-
+                printf("warning_temp_time                       : %"PRIu32"\n",
+                    smart_log.warning_temp_time);
+               printf("critical_comp_time                      : %"PRIu32"\n",
+                    smart_log.critical_comp_time);
+                printf("DITT support                            : 0\n");
+                /* TODO */
+                printf("HCTM support                            : (NOT) %"PRIu32"\n",
+                    smart_log.warning_temp_time);
+               printf("HCTM Light (TMT1)                       : (NOT) %"PRIu32"\n",
+                    smart_log.warning_temp_time);
+            
+                printf("thm_temp1_trans_count                   : %"PRIu32"\n",
+                    smart_log.thm_temp1_trans_count);
+               printf("thm_temp1_total_time                    : %"PRIu32"\n",
+                    smart_log.thm_temp1_total_time);
+                /* TODO */
+               printf("HCTM Heavy (TMT2)                       : (NOT) %"PRIu32"\n",
+                    smart_log.warning_temp_time);
+                
+                printf("thm_temp2_trans_count                   : %"PRIu32"\n",
+                    smart_log.thm_temp2_trans_count);
+               printf("thm_temp2_total_time                    : %"PRIu32"\n",
+                    smart_log.thm_temp2_total_time);
+                printf("Thermal Shutdown Threshold              : 95 °C\n");  
        }
 
        fprintf(stderr, "NVMe Status:%s(%x)\n", nvme_status_to_string(ret), ret);