For each zone log sensor name with max setpoint
Add sensor name that has the maximum setpoint for a PID zone.
Log a debug message when the sensor is changed.
The name is also added to the log file for each log record.
Tested:
Override one CPU temperature sensor
busctl set-property xyz.openbmc_project.CPUSensor /xyz/openbmc_project/sensors/temperature/DTS_CPU1 xyz.openbmc_project.Sensor.Value Value d 82
Observed log message:
swampd[443]: PID Zone 0 max SetPoint 34.5546 requested by DTS_CPU1
Signed-off-by: Nirav Shah <nirav.j2.shah@intel.com>
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: Ifc12cb9a106da1bf41dd35697210f74ba1b589db
diff --git a/test/pid_thermalcontroller_unittest.cpp b/test/pid_thermalcontroller_unittest.cpp
index ef4de66..57a1b9f 100644
--- a/test/pid_thermalcontroller_unittest.cpp
+++ b/test/pid_thermalcontroller_unittest.cpp
@@ -104,7 +104,7 @@
EXPECT_FALSE(p == nullptr);
double value = 90.0;
- EXPECT_CALL(z, addSetPoint(value));
+ EXPECT_CALL(z, addSetPoint(value, "therm1"));
p->outputProc(value);
}
@@ -175,7 +175,7 @@
.WillOnce(Return(9.0))
.WillOnce(Return(7.0));
- EXPECT_CALL(z, addSetPoint(_)).Times(3);
+ EXPECT_CALL(z, addSetPoint(_, "therm1")).Times(3);
std::vector<double> lastReadings = {12.0, 12.0, 7.0};
for (auto& reading : lastReadings)
@@ -208,7 +208,7 @@
.WillOnce(Return(13.0))
.WillOnce(Return(14.0));
- EXPECT_CALL(z, addSetPoint(_)).Times(3);
+ EXPECT_CALL(z, addSetPoint(_, "therm1")).Times(3);
std::vector<double> lastReadings = {8.0, 8.0, 14.0};
for (auto& reading : lastReadings)