control: Record configuration load/reload paths
Add `main` recorder entries to the flight recorder when the
configurations are loaded or reloaded thru SIGHUP.
Change-Id: Ib720f6342a8579e2fc0df30e8975dd140dba28e2
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/manager.cpp b/control/json/manager.cpp
index c45c873..ae007ad 100644
--- a/control/json/manager.cpp
+++ b/control/json/manager.cpp
@@ -17,7 +17,6 @@
#include "manager.hpp"
-#include "../utils/flight_recorder.hpp"
#include "action.hpp"
#include "event.hpp"
#include "fan.hpp"
@@ -26,6 +25,7 @@
#include "power_state.hpp"
#include "profile.hpp"
#include "sdbusplus.hpp"
+#include "utils/flight_recorder.hpp"
#include "zone.hpp"
#include <systemd/sd-bus.h>
@@ -75,6 +75,7 @@
void Manager::sighupHandler(sdeventplus::source::Signal&,
const struct signalfd_siginfo*)
{
+ FlightRecorder::instance().log("main", "SIGHUP received");
// Save current set of available and active profiles
std::map<configKey, std::unique_ptr<Profile>> profiles;
profiles.swap(_profiles);
@@ -94,6 +95,9 @@
_activeProfiles.swap(activeProfiles);
log<level::ERR>("Error reloading configs, no changes made",
entry("LOAD_ERROR=%s", re.what()));
+ FlightRecorder::instance().log(
+ "main", fmt::format("Error reloading configs, no changes made: {}",
+ re.what()));
}
}