svn commit: r328669 - in stable/11: sbin/nvmecontrol sys/dev/nvme
Alexander Motin
mav at FreeBSD.org
Thu Feb 1 16:15:04 UTC 2018
Author: mav
Date: Thu Feb 1 16:15:03 2018
New Revision: 328669
URL: https://svnweb.freebsd.org/changeset/base/328669
Log:
MFC r308851 (by imp):
Expand the SMART / Health Information Log Page (Page 02) printout
based on NVM Express 1.2.1 Standard.
Modified:
stable/11/sbin/nvmecontrol/logpage.c
stable/11/sys/dev/nvme/nvme.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sbin/nvmecontrol/logpage.c
==============================================================================
--- stable/11/sbin/nvmecontrol/logpage.c Thu Feb 1 16:13:28 2018 (r328668)
+++ stable/11/sbin/nvmecontrol/logpage.c Thu Feb 1 16:15:03 2018 (r328669)
@@ -162,10 +162,18 @@ print_log_error(void *buf, uint32_t size)
}
static void
+print_temp(uint16_t t)
+{
+ printf("%u K, %2.2f C, %3.2f F\n", t, (float)t - 273.15, (float)t * 9 / 5 - 459.67);
+}
+
+
+static void
print_log_health(void *buf, uint32_t size __unused)
{
struct nvme_health_information_page *health = buf;
char cbuf[UINT128_DIG + 1];
+ int i;
printf("SMART/Health Information Log\n");
printf("============================\n");
@@ -182,10 +190,8 @@ print_log_health(void *buf, uint32_t size __unused)
health->critical_warning.bits.read_only);
printf(" Volatile memory backup: %d\n",
health->critical_warning.bits.volatile_memory_backup);
- printf("Temperature: %u K, %2.2f C, %3.2f F\n",
- health->temperature,
- (float)health->temperature - (float)273.15,
- ((float)health->temperature * (float)9/5) - (float)459.67);
+ printf("Temperature: ");
+ print_temp(health->temperature);
printf("Available spare: %u\n",
health->available_spare);
printf("Available spare threshold: %u\n",
@@ -193,9 +199,9 @@ print_log_health(void *buf, uint32_t size __unused)
printf("Percentage used: %u\n",
health->percentage_used);
- printf("Data units (512,000 byte) read: %s\n",
+ printf("Data units (512,000 byte) read: %s\n",
uint128_to_str(to128(health->data_units_read), cbuf, sizeof(cbuf)));
- printf("Data units (512,000 byte) written: %s\n",
+ printf("Data units written: %s\n",
uint128_to_str(to128(health->data_units_written), cbuf, sizeof(cbuf)));
printf("Host read commands: %s\n",
uint128_to_str(to128(health->host_read_commands), cbuf, sizeof(cbuf)));
@@ -213,6 +219,15 @@ print_log_health(void *buf, uint32_t size __unused)
uint128_to_str(to128(health->media_errors), cbuf, sizeof(cbuf)));
printf("No. error info log entries: %s\n",
uint128_to_str(to128(health->num_error_info_log_entries), cbuf, sizeof(cbuf)));
+
+ printf("Warning Temp Composite Time: %d\n", health->warning_temp_time);
+ printf("Error Temp Composite Time: %d\n", health->error_temp_time);
+ for (i = 0; i < 7; i++) {
+ if (health->temp_sensor[i] == 0)
+ continue;
+ printf("Temperature Sensor %d: ", i + 1);
+ print_temp(health->temp_sensor[i]);
+ }
}
static void
Modified: stable/11/sys/dev/nvme/nvme.h
==============================================================================
--- stable/11/sys/dev/nvme/nvme.h Thu Feb 1 16:13:28 2018 (r328668)
+++ stable/11/sys/dev/nvme/nvme.h Thu Feb 1 16:15:03 2018 (r328669)
@@ -724,8 +724,11 @@ struct nvme_health_information_page {
uint64_t unsafe_shutdowns[2];
uint64_t media_errors[2];
uint64_t num_error_info_log_entries[2];
+ uint32_t warning_temp_time;
+ uint32_t error_temp_time;
+ uint16_t temp_sensor[8];
- uint8_t reserved2[320];
+ uint8_t reserved2[296];
} __packed __aligned(4);
struct nvme_firmware_page {
More information about the svn-src-stable
mailing list