print zone failsafe reason when enter failsafe mode
Tested:
```
Jun 24 01:52:45 bmc sel-logger[640]: cpu0_nbm critical high threshold assert. Reading=49.000000 Threshold=45.000000.
Jun 24 01:52:46 bmc swampd[2944]: Zone 2 fans, entering failsafe mode, output pwm: 100
Jun 24 01:52:46 bmc swampd[2944]: Fail sensor: cpu0_nbm, reason: Sensor threshold asserted
Jun 24 01:52:46 bmc swampd[2944]: Zone 0 fans, entering failsafe mode, output pwm: 100
Jun 24 01:52:46 bmc swampd[2944]: Fail sensor: cpu0_nbm, reason: Sensor threshold asserted
```
Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com>
Change-Id: I607d01b6bed11b00a40153db6521a9c9d23da519
diff --git a/pid/fancontroller.cpp b/pid/fancontroller.cpp
index 378ef9b..11538be 100644
--- a/pid/fancontroller.cpp
+++ b/pid/fancontroller.cpp
@@ -176,6 +176,14 @@
<< (failsafeCurrState ? "entering failsafe"
: "returning to normal")
<< " mode, output pwm: " << percent << "\n";
+
+ std::map<std::string, std::pair<std::string, double>>
+ failSensorList = _owner->getFailSafeSensors();
+ for (const auto& it : failSensorList)
+ {
+ std::cerr << "Fail sensor: " << it.first
+ << ", reason: " << it.second.first << "\n";
+ }
}
}
}