Add support for collecting data for BMC dumps
When occ-control receives a USR1 signal, it will trigger the code to
collect the following data:
- number of OCC objects created
- for each active OCC: state, role, hwmon path, poll response, and WOF
data
The data will be written in JSON format to a file which can be collected
and added to a dump. (/tmp/occ_control_dump.json)
To force the data collection:
killall -s SIGUSR1 openpower-occ-control
Change-Id: I7a304f7ce0eb1c9109f630f187adf9c95722652e
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_manager.hpp b/occ_manager.hpp
index a2f1b8a..3758952 100644
--- a/occ_manager.hpp
+++ b/occ_manager.hpp
@@ -13,7 +13,9 @@
#include <sdbusplus/bus.hpp>
#include <sdeventplus/event.hpp>
+#include <sdeventplus/source/signal.hpp>
#include <sdeventplus/utility/timer.hpp>
+#include <stdplus/signal.hpp>
#include <cstring>
#include <functional>
@@ -144,6 +146,15 @@
* is off */
void hostPoweredOff();
+ /** @brief Collect data to include in BMC dumps
+ * This will get called when app receives a SIGUSR1 signal
+ */
+ void collectDumpData(sdeventplus::source::Signal&,
+ const struct signalfd_siginfo*);
+
+ /** @brief Name of file to put the occ-control dump data */
+ static const std::string dumpFile;
+
private:
/** @brief Creates the OCC D-Bus objects.
*/