PEL: Remove dump status bits from PELs
Stop filling in the bits in the PEL that say there are un-offloaded
dumps. These require calls to the dump daemon that can be slow and even
time out if the dump daemon is busy.
These aren't parsed out in the peltool output anyway, and there are
other ways to determine if there are dumps - someone could just look at
the dump D-Bus directly.
This isn't a direct revert of the commit that introduced it because of
all the merge conflicts trying to do a revert entailed.
Tested:
Can still create PELs.
Change-Id: I975f06ebf3638b39315fdea49393d1941a6f5216
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 1975e95..84645b7 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -95,8 +95,6 @@
"xyz.openbmc_project.State.Decorator.OperationalStatus";
constexpr auto logSetting = "xyz.openbmc_project.Logging.Settings";
constexpr auto associationDef = "xyz.openbmc_project.Association.Definitions";
-constexpr auto dumpEntry = "xyz.openbmc_project.Dump.Entry";
-constexpr auto dumpProgress = "xyz.openbmc_project.Common.Progress";
constexpr auto hwIsolationCreate = "org.open_power.HardwareIsolation.Create";
constexpr auto hwIsolationEntry = "xyz.openbmc_project.HardwareIsolation.Entry";
constexpr auto association = "xyz.openbmc_project.Association";
@@ -689,73 +687,6 @@
return ret;
}
-std::vector<bool>
- DataInterface::checkDumpStatus(const std::vector<std::string>& type) const
-{
- DBusSubTree subtree;
- std::vector<bool> result(type.size(), false);
-
- // Query GetSubTree for the availability of dump interface
- auto method = _bus.new_method_call(service_name::objectMapper,
- object_path::objectMapper,
- interface::objectMapper, "GetSubTree");
- method.append(std::string{"/"}, 0,
- std::vector<std::string>{interface::dumpEntry});
- auto reply = _bus.call(method, dbusTimeout);
-
- reply.read(subtree);
-
- if (subtree.empty())
- {
- return result;
- }
-
- std::vector<bool>::iterator itDumpStatus = result.begin();
- uint8_t count = 0;
- for (const auto& [path, serviceInfo] : subtree)
- {
- const auto& service = serviceInfo.begin()->first;
- // Check for dump type on the object path
- for (const auto& it : type)
- {
- if (path.find(it) != std::string::npos)
- {
- DBusValue value, progress;
-
- // If dump type status is already available go for next path
- if (*itDumpStatus)
- {
- break;
- }
-
- // Check for valid dump to be available if following
- // conditions are met for the dump entry path -
- // Offloaded == false and Status == Completed
- getProperty(service, path, interface::dumpEntry, "Offloaded",
- value);
- getProperty(service, path, interface::dumpProgress, "Status",
- progress);
- auto offload = std::get<bool>(value);
- auto status = std::get<std::string>(progress);
- if (!offload && (status.find("Completed") != std::string::npos))
- {
- *itDumpStatus = true;
- count++;
- if (count >= type.size())
- {
- return result;
- }
- break;
- }
- }
- ++itDumpStatus;
- }
- itDumpStatus = result.begin();
- }
-
- return result;
-}
-
void DataInterface::createGuardRecord(const std::vector<uint8_t>& binPath,
const std::string& type,
const std::string& logPath) const
diff --git a/extensions/openpower-pels/data_interface.hpp b/extensions/openpower-pels/data_interface.hpp
index c6cfe4e..93a0e47 100644
--- a/extensions/openpower-pels/data_interface.hpp
+++ b/extensions/openpower-pels/data_interface.hpp
@@ -444,14 +444,6 @@
extractConnectorFromLocCode(const std::string& locationCode);
/**
- * @brief Returns the dump status
- *
- * @return bool dump status
- */
- virtual std::vector<bool>
- checkDumpStatus(const std::vector<std::string>& type) const = 0;
-
- /**
* @brief Create guard record
*
* @param[in] binPath: phal devtree binary path used as key
@@ -865,16 +857,6 @@
bool getQuiesceOnError() const override;
/**
- * @brief Returns the dump status
- *
- * @param[in] type - The dump type to check for
- *
- * @return bool dump status
- */
- std::vector<bool>
- checkDumpStatus(const std::vector<std::string>& type) const override;
-
- /**
* @brief Create guard record
*
* @param[in] binPath: phal devtree binary path used as key
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index 628943b..a40bb8c 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -338,7 +338,6 @@
// FF: SRC format, set below
setProgressCode(dataIface);
- setDumpStatus(dataIface);
setBMCFormat();
setBMCPosition();
setMotherboardCCIN(dataIface);
@@ -1463,28 +1462,6 @@
return mrus;
}
-void SRC::setDumpStatus(const DataInterfaceBase& dataIface)
-{
- std::vector<bool> dumpStatus{false, false, false};
-
- try
- {
- std::vector<std::string> dumpType = {"bmc/entry", "resource/entry",
- "system/entry"};
- dumpStatus = dataIface.checkDumpStatus(dumpType);
-
- // For bmc - set bit 0 of nibble [4-7] bits of byte-1 SP dump
- // For resource - set bit 2 of nibble [4-7] bits of byte-2 Hypervisor
- // For system - set bit 1 of nibble [4-7] bits of byte-2 HW dump
- _hexData[0] |= ((dumpStatus[0] << 19) | (dumpStatus[1] << 9) |
- (dumpStatus[2] << 10));
- }
- catch (const std::exception& e)
- {
- lg2::error("Checking dump status failed: {ERROR}", "ERROR", e);
- }
-}
-
std::vector<uint8_t> SRC::getSrcStruct()
{
std::vector<uint8_t> data;
diff --git a/extensions/openpower-pels/src.hpp b/extensions/openpower-pels/src.hpp
index edd26e1..2d1cdc5 100644
--- a/extensions/openpower-pels/src.hpp
+++ b/extensions/openpower-pels/src.hpp
@@ -585,13 +585,6 @@
getMRUsFromJSON(const nlohmann::json& mruJSON);
/**
- * @brief Sets the dump status
- *
- * @param[in] dataIface - The DataInterface object
- */
- void setDumpStatus(const DataInterfaceBase& dataIface);
-
- /**
* @brief The SRC version field
*/
uint8_t _version;
diff --git a/test/openpower-pels/src_test.cpp b/test/openpower-pels/src_test.cpp
index 2fb8770..069dacd 100644
--- a/test/openpower-pels/src_test.cpp
+++ b/test/openpower-pels/src_test.cpp
@@ -1316,64 +1316,6 @@
EXPECT_EQ(callout->priority(), 'M');
}
-// Test for bmc & platform dump status bits
-TEST_F(SRCTest, DumpStatusBitsCheck)
-{
- message::Entry entry;
- entry.src.type = 0xBD;
- entry.src.reasonCode = 0xABCD;
- entry.subsystem = 0x42;
-
- AdditionalData ad;
- NiceMock<MockDataInterface> dataIface;
- std::vector<std::string> dumpType{"bmc/entry", "resource/entry",
- "system/entry"};
-
- {
- EXPECT_CALL(dataIface, checkDumpStatus(dumpType))
- .WillOnce(Return(std::vector<bool>{true, false, false}));
-
- SRC src{entry, ad, dataIface};
- EXPECT_TRUE(src.valid());
-
- const auto& hexwords = src.hexwordData();
- EXPECT_EQ(0x00080055, hexwords[0]);
- }
-
- {
- EXPECT_CALL(dataIface, checkDumpStatus(dumpType))
- .WillOnce(Return(std::vector<bool>{false, true, false}));
-
- SRC src{entry, ad, dataIface};
- EXPECT_TRUE(src.valid());
-
- const auto& hexwords = src.hexwordData();
- EXPECT_EQ(0x00000255, hexwords[0]);
- }
-
- {
- EXPECT_CALL(dataIface, checkDumpStatus(dumpType))
- .WillOnce(Return(std::vector<bool>{false, false, true}));
-
- SRC src{entry, ad, dataIface};
- EXPECT_TRUE(src.valid());
-
- const auto& hexwords = src.hexwordData();
- EXPECT_EQ(0x00000455, hexwords[0]);
- }
-
- {
- EXPECT_CALL(dataIface, checkDumpStatus(dumpType))
- .WillOnce(Return(std::vector<bool>{true, true, true}));
-
- SRC src{entry, ad, dataIface};
- EXPECT_TRUE(src.valid());
-
- const auto& hexwords = src.hexwordData();
- EXPECT_EQ(0x00080655, hexwords[0]);
- }
-}
-
// Test SRC with additional data - PEL_SUBSYSTEM
TEST_F(SRCTest, TestPELSubsystem)
{