|
|
61fcf4 |
From 6c916ee527e14bf4c4640ffeef8efdd891ba9ef4 Mon Sep 17 00:00:00 2001
|
|
|
61fcf4 |
From: Maurizio Lombardi <mlombard@redhat.com>
|
|
|
61fcf4 |
Date: Thu, 30 Jun 2022 16:17:44 +0200
|
|
|
61fcf4 |
Subject: [PATCH 4/7] nvme-cli: Adds event number in persistent event entries
|
|
|
61fcf4 |
|
|
|
61fcf4 |
Persistent Event Entries:
|
|
|
61fcf4 |
Event Number: 0
|
|
|
61fcf4 |
Event Type: SMART/Health Log Snapshot Event(0x1)
|
|
|
61fcf4 |
Event Type Revision: 1
|
|
|
61fcf4 |
Event Header Length: 21
|
|
|
61fcf4 |
Controller Identifier: 66
|
|
|
61fcf4 |
Event Timestamp: 44392
|
|
|
61fcf4 |
|
|
|
61fcf4 |
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
|
|
|
61fcf4 |
---
|
|
|
61fcf4 |
nvme-print.c | 30 ++++++++++++++++--------------
|
|
|
61fcf4 |
1 file changed, 16 insertions(+), 14 deletions(-)
|
|
|
61fcf4 |
|
|
|
61fcf4 |
diff --git a/nvme-print.c b/nvme-print.c
|
|
|
61fcf4 |
index 21524a50..3b82b174 100755
|
|
|
61fcf4 |
--- a/nvme-print.c
|
|
|
61fcf4 |
+++ b/nvme-print.c
|
|
|
61fcf4 |
@@ -1174,8 +1174,9 @@ void json_persistent_event_log(void *pevent_log_info, __u32 size)
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
valid_attrs = json_create_object();
|
|
|
61fcf4 |
|
|
|
61fcf4 |
- json_object_add_value_uint(valid_attrs, "event_type",
|
|
|
61fcf4 |
- pevent_entry_head->etype);
|
|
|
61fcf4 |
+ json_object_add_value_uint(valid_attrs, "event_number", i);
|
|
|
61fcf4 |
+ json_object_add_value_string(valid_attrs, "event_type",
|
|
|
61fcf4 |
+ nvme_pel_event_to_string(pevent_entry_head->etype));
|
|
|
61fcf4 |
json_object_add_value_uint(valid_attrs, "event_type_rev",
|
|
|
61fcf4 |
pevent_entry_head->etype_rev);
|
|
|
61fcf4 |
json_object_add_value_uint(valid_attrs, "event_header_len",
|
|
|
61fcf4 |
@@ -1505,7 +1506,8 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
le16_to_cpu(pevent_entry_head->el)) >= size)
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
|
|
|
61fcf4 |
- printf("Event Type: %u\n", pevent_entry_head->etype);
|
|
|
61fcf4 |
+ printf("Event Number: %u\n", i);
|
|
|
61fcf4 |
+ printf("Event Type: %s\n", nvme_pel_event_to_string(pevent_entry_head->etype));
|
|
|
61fcf4 |
printf("Event Type Revision: %u\n", pevent_entry_head->etype_rev);
|
|
|
61fcf4 |
printf("Event Header Length: %u\n", pevent_entry_head->ehl);
|
|
|
61fcf4 |
printf("Controller Identifier: %u\n",
|
|
|
61fcf4 |
@@ -1521,12 +1523,12 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
switch (pevent_entry_head->etype) {
|
|
|
61fcf4 |
case NVME_SMART_HEALTH_EVENT:
|
|
|
61fcf4 |
smart_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Smart Health Event: \n");
|
|
|
61fcf4 |
+ printf("Smart Health Event Entry: \n");
|
|
|
61fcf4 |
nvme_show_smart_log(smart_event, NVME_NSID_ALL, devname, flags);
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_FW_COMMIT_EVENT:
|
|
|
61fcf4 |
fw_commit_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("FW Commit Event: \n");
|
|
|
61fcf4 |
+ printf("FW Commit Event Entry: \n");
|
|
|
61fcf4 |
printf("Old Firmware Revision: %"PRIu64"\n",
|
|
|
61fcf4 |
le64_to_cpu(fw_commit_event->old_fw_rev));
|
|
|
61fcf4 |
printf("New Firmware Revision: %"PRIu64"\n",
|
|
|
61fcf4 |
@@ -1543,7 +1545,7 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_TIMESTAMP_EVENT:
|
|
|
61fcf4 |
ts_change_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Time Stamp Change Event: \n");
|
|
|
61fcf4 |
+ printf("Time Stamp Change Event Entry: \n");
|
|
|
61fcf4 |
printf("Previous Timestamp: %"PRIu64"\n",
|
|
|
61fcf4 |
le64_to_cpu(ts_change_event->previous_timestamp));
|
|
|
61fcf4 |
printf("Milliseconds Since Reset: %"PRIu64"\n",
|
|
|
61fcf4 |
@@ -1555,7 +1557,7 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
|
|
|
61fcf4 |
por_info_list = por_info_len / sizeof(*por_event);
|
|
|
61fcf4 |
|
|
|
61fcf4 |
- printf("Power On Reset Event: \n");
|
|
|
61fcf4 |
+ printf("Power On Reset Event Entry: \n");
|
|
|
61fcf4 |
fw_rev = pevent_log_info + offset;
|
|
|
61fcf4 |
printf("Firmware Revision: %"PRIu64"\n", le64_to_cpu(*fw_rev));
|
|
|
61fcf4 |
printf("Reset Information List: \n");
|
|
|
61fcf4 |
@@ -1578,13 +1580,13 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_NSS_HW_ERROR_EVENT:
|
|
|
61fcf4 |
nss_hw_err_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("NVM Subsystem Hardware Error Event Code: %u, %s\n",
|
|
|
61fcf4 |
+ printf("NVM Subsystem Hardware Error Event Code Entry: %u, %s\n",
|
|
|
61fcf4 |
le16_to_cpu(nss_hw_err_event->nss_hw_err_event_code),
|
|
|
61fcf4 |
nvme_show_nss_hw_error(nss_hw_err_event->nss_hw_err_event_code));
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_CHANGE_NS_EVENT:
|
|
|
61fcf4 |
ns_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Change Namespace Event: \n");
|
|
|
61fcf4 |
+ printf("Change Namespace Event Entry: \n");
|
|
|
61fcf4 |
printf("Namespace Management CDW10: %u\n",
|
|
|
61fcf4 |
le32_to_cpu(ns_event->nsmgt_cdw10));
|
|
|
61fcf4 |
printf("Namespace Size: %"PRIu64"\n",
|
|
|
61fcf4 |
@@ -1603,7 +1605,7 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_FORMAT_START_EVENT:
|
|
|
61fcf4 |
format_start_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Format NVM Start Event: \n");
|
|
|
61fcf4 |
+ printf("Format NVM Start Event Entry: \n");
|
|
|
61fcf4 |
printf("Namespace Identifier: %u\n",
|
|
|
61fcf4 |
le32_to_cpu(format_start_event->nsid));
|
|
|
61fcf4 |
printf("Format NVM Attributes: %u\n",
|
|
|
61fcf4 |
@@ -1613,7 +1615,7 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_FORMAT_COMPLETION_EVENT:
|
|
|
61fcf4 |
format_cmpln_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Format NVM Completion Event: \n");
|
|
|
61fcf4 |
+ printf("Format NVM Completion Event Entry: \n");
|
|
|
61fcf4 |
printf("Namespace Identifier: %u\n",
|
|
|
61fcf4 |
le32_to_cpu(format_cmpln_event->nsid));
|
|
|
61fcf4 |
printf("Smallest Format Progress Indicator: %u\n",
|
|
|
61fcf4 |
@@ -1627,7 +1629,7 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_SANITIZE_START_EVENT:
|
|
|
61fcf4 |
sanitize_start_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Sanitize Start Event: \n");
|
|
|
61fcf4 |
+ printf("Sanitize Start Event Entry: \n");
|
|
|
61fcf4 |
printf("SANICAP: %u\n", sanitize_start_event->sani_cap);
|
|
|
61fcf4 |
printf("Sanitize CDW10: %u\n",
|
|
|
61fcf4 |
le32_to_cpu(sanitize_start_event->sani_cdw10));
|
|
|
61fcf4 |
@@ -1636,7 +1638,7 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_SANITIZE_COMPLETION_EVENT:
|
|
|
61fcf4 |
sanitize_cmpln_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Sanitize Completion Event: \n");
|
|
|
61fcf4 |
+ printf("Sanitize Completion Event Entry: \n");
|
|
|
61fcf4 |
printf("Sanitize Progress: %u\n",
|
|
|
61fcf4 |
le16_to_cpu(sanitize_cmpln_event->sani_prog));
|
|
|
61fcf4 |
printf("Sanitize Status: %u\n",
|
|
|
61fcf4 |
@@ -1646,7 +1648,7 @@ void nvme_show_persistent_event_log(void *pevent_log_info,
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
case NVME_THERMAL_EXCURSION_EVENT:
|
|
|
61fcf4 |
thermal_exc_event = pevent_log_info + offset;
|
|
|
61fcf4 |
- printf("Thermal Excursion Event: \n");
|
|
|
61fcf4 |
+ printf("Thermal Excursion Event Entry: \n");
|
|
|
61fcf4 |
printf("Over Temperature: %u\n", thermal_exc_event->over_temp);
|
|
|
61fcf4 |
printf("Threshold: %u\n", thermal_exc_event->threshold);
|
|
|
61fcf4 |
break;
|
|
|
61fcf4 |
--
|
|
|
61fcf4 |
2.31.1
|
|
|
61fcf4 |
|