monitor: include previous targets and tachs in PEL
To discover the source of certain fan ramp-up failures, this change
outputs the previous 8 targets and tach readings. The strategy is to see
if hardware limitations prevent attaining the targets quickly enough.
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: Ia38867986b8a8a651de5d01766393c07d413273c
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index 87c69ac..5b214c4 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -10,6 +10,7 @@
#include <sdeventplus/utility/timer.hpp>
#include <chrono>
+#include <deque>
#include <optional>
#include <utility>
@@ -360,6 +361,22 @@
*/
void updateTachAndTarget();
+ /**
+ * @brief return the previous tach values
+ */
+ const std::deque<uint64_t>& getPrevTach() const
+ {
+ return _prevTachs;
+ }
+
+ /**
+ * @brief return the previous target values
+ */
+ const std::deque<uint64_t>& getPrevTarget() const
+ {
+ return _prevTargets;
+ }
+
private:
/**
* @brief Returns the match string to use for matching
@@ -537,6 +554,16 @@
std::unique_ptr<
sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>>
_countTimer;
+
+ /**
+ * @brief record of previous targets
+ */
+ std::deque<uint64_t> _prevTargets;
+
+ /**
+ * @brief record of previous tach readings
+ */
+ std::deque<uint64_t> _prevTachs;
};
} // namespace monitor