Throttle PLDM traces after 5 minutes while waiting for PDRs
Existing code waits up to 40 minutes for the OCC active sensors PDRs to
be available. If not available, a BD8D2685 PEL will get logged and
occ-control will continue to wait for the PDRs.
This change will throttle the occ-control PLDM traces after 5 minutes,
while continuing to wait for the PDRs. A PEL will still get generated if
the timeout expires.
Tested on Rainier
Change-Id: I35ec939317efee7a458b96709ea9cfc2abe7bebf
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_manager.hpp b/occ_manager.hpp
index b3034f1..9745682 100644
--- a/occ_manager.hpp
+++ b/occ_manager.hpp
@@ -111,10 +111,10 @@
sdpEvent, std::bind(&Manager::occsNotAllRunning, this)))
#ifdef PLDM
,
- throttleTraceTimer(
+ throttlePldmTraceTimer(
std::make_unique<
sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>>(
- sdpEvent, std::bind(&Manager::throttleTraceExpired, this)))
+ sdpEvent, std::bind(&Manager::throttlePldmTraceExpired, this)))
#endif
#endif // POWER10
{
@@ -350,15 +350,23 @@
*/
std::unique_ptr<
sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>>
- throttleTraceTimer;
+ throttlePldmTraceTimer;
+ /**
+ * @brief onPldmTimeoutCreatePel flag will be used to indicate if
+ * a PEL should get created when the throttlePldmTraceTimer expires.
+ * The first time the throttlePldmTraceTimer expires, the traces
+ * will be throttled and then the timer gets restarted. The
+ * next time the timer expires, a PEL will get created.
+ */
+ bool onPldmTimeoutCreatePel = false;
/** @brief Check if all of the OCC Active sensors are available and if not
* restart the discoverTimer
*/
- void throttleTraceExpired();
+ void throttlePldmTraceExpired();
/** @brief Create a PEL when the code is not able to obtain the OCC PDRs
- * via PLDM. This is called when the throttleTraceTimer expires.
+ * via PLDM. This is called when the throttlePldmTraceTimer expires.
*/
void createPldmSensorPEL();
#endif