zone: Add debug thermal/power interface
- Add xyz.openbmc_project.Debug.Pid.ThermalPower interface to
fanctrl/zoneX/pid dbus to record some datas in thermal/power
PID loop.
Tested:
```
busctl introspect xyz.openbmc_project.State.FanCtrl /xyz/openbmc_project/settings/fanctrl/zone0/CPU0_PID xyz.openbmc_project.Debug.Pid.ThermalPower
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.ClassType property s "Temperature" emits-change
.Input property d 36.594 emits-change
.Leader property s "Die_CPU0" emits-change
.Output property d 4200 emits-change
.Setpoint property d 70 emits-change
```
Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com>
Change-Id: I6846c3878c2ca5eaeeb6eaf48aaf0f604a2beccf
diff --git a/pid/zone.hpp b/pid/zone.hpp
index 85a9064..2854997 100644
--- a/pid/zone.hpp
+++ b/pid/zone.hpp
@@ -11,6 +11,7 @@
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server.hpp>
#include <xyz/openbmc_project/Control/Mode/server.hpp>
+#include <xyz/openbmc_project/Debug/Pid/ThermalPower/server.hpp>
#include <xyz/openbmc_project/Debug/Pid/Zone/server.hpp>
#include <xyz/openbmc_project/Object/Enable/server.hpp>
@@ -30,7 +31,10 @@
using ModeObject = ServerObject<ModeInterface, DebugZoneInterface>;
using ProcessInterface =
sdbusplus::xyz::openbmc_project::Object::server::Enable;
-using ProcessObject = ServerObject<ProcessInterface>;
+using DebugThermalPowerInterface =
+ sdbusplus::xyz::openbmc_project::Debug::Pid::server::ThermalPower;
+using ProcessObject =
+ ServerObject<ProcessInterface, DebugThermalPowerInterface>;
namespace pid_control
{
@@ -108,13 +112,18 @@
/* Method for recording the maximum SetPoint PID config name */
std::string leader() const override;
/* Method for control process for each loop at runtime */
- void addPidControlProcess(std::string name, sdbusplus::bus_t& bus,
+ void addPidControlProcess(std::string name, std::string type,
+ double setpoint, sdbusplus::bus_t& bus,
std::string objPath, bool defer);
bool isPidProcessEnabled(std::string name);
void initPidFailSafePercent(void);
void addPidFailSafePercent(std::string name, double percent);
+ void updateThermalPowerDebugInterface(std::string pidName,
+ std::string leader, double input,
+ double output) override;
+
private:
template <bool fanSensorLogging>
void processSensorInputs(const std::vector<std::string>& sensorInputs,