summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire Weinan <cweinan@google.com>2022-08-15 06:04:45 +0300
committerEd Tanous <ed@tanous.net>2022-08-15 22:31:16 +0300
commitc21c64b6523d882c927c0e3e29d65c364b3aa1d5 (patch)
tree9f336565c077f9c672aaf2de81f2713fa22b1213
parent2b82937ecef572954b49569177b16831cbc09cfe (diff)
downloadbmcweb-c21c64b6523d882c927c0e3e29d65c364b3aa1d5.tar.xz
LogServices: Fix dump timestamp regression
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/55468 was a refactoring task that was not intended to have any client impact. However it had a bug where it unintentionally changed the “Created” timestamp of log entries of all dump types to be smaller (earlier) than pre-refactoring. Tested: FaultLog entry before fix (timestamp too large--reported as max Redfish time): curl k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1 { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "9999-12-31T23:59:59+00:00", "EntryType": "Event", "Id": "1", "Name": "FaultLog Dump Entry" } FaultLog entry after fix (timestamp reported correctly): curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1 { "@odata.id": "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "Created": "2022-08-14T10:29:40+00:00", "EntryType": "Event", "Id": "1", "Name": "FaultLog Dump Entry" } Tested similarly for a BMC Dump entry. Interestingly, it seems like the System Dump entry timestamp before the refactoring task was too small, and the bug actually helped to correct it. In any case, this change reverts timestamp behavior to match what it was pre-refactoring. Redfish Service Validator succeeded on the following URI trees: /redfish/v1/Managers/bmc/LogServices/FaultLog /redfish/v1/Managers/bmc/LogServices/Dump /redfish/v1/Systems/system/LogServices/Dump Signed-off-by: Claire Weinan <cweinan@google.com> Change-Id: I7badbd348595a7bcb61982a4cd6b7e82a16b0219
-rw-r--r--redfish-core/lib/log_services.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 32afd36c5c..8c062aaaeb 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -384,7 +384,7 @@ inline void parseDumpEntryFromDbusObject(
messages::internalError(asyncResp->res);
break;
}
- timestamp = *usecsTimeStamp;
+ timestamp = (*usecsTimeStamp / 1000 / 1000);
break;
}
}