@Krellan
in commit
/Allow disabling PID loops at runtime/
the following operation was added
https://github.com/openbmc/phosphor-pid-control/blob/7c6d35d5c439196254a7ca600b2d6bc0650adf4a/pid/zone.cpp#L138C13-L138C13
and it makes this condition check always be met in every loop (and it was not original
intention)
"
else if (_maximumSetPointName.compare(_maximumSetPointNamePrev))
"
|
else if (_maximumSetPointName.compare(_maximumSetPointNamePrev)) |
what's more, since the condition is met in every loop
so the debug log will be printed out as well
"
std::cerr << "PID Zone " << _zoneId << " max SetPoint "
<< _maximumSetPoint << " requested by "
<< _maximumSetPointName;
"
https://github.com/openbmc/phosphor-pid-control/blob/7c6d35d5c439196254a7ca600b2d6bc0650adf4a/pid/zone.cpp#L278C8-L280C43
_maximumSetPointName.clear() in every loop is a good idea
because it's consistent with _maximumSetPoint behaviour
but it changes the logic of _maximumSetPointName.compare completly
idea1
shall we modify it accordingly?
1 change the condition
"
else if (_maximumSetPointName.compare(_maximumSetPointNamePrev))
"
=>
'else'
2 add debug flag then the debug log will not be printed all the time
idea2
or simply remove
_maximumSetPointName.clear();
then the previous logic will still work
and _maximumSetPointName actually gets updated in addSetPoint()
if you have any better idea , feel free to let us know
Alang
@Krellan
in commit
/Allow disabling PID loops at runtime/
the following operation was added
https://github.com/openbmc/phosphor-pid-control/blob/7c6d35d5c439196254a7ca600b2d6bc0650adf4a/pid/zone.cpp#L138C13-L138C13
and it makes this condition check always be met in every loop (and it was not original
intention)
"
else if (_maximumSetPointName.compare(_maximumSetPointNamePrev))
"
phosphor-pid-control/pid/zone.cpp
Line 276 in 7c6d35d
what's more, since the condition is met in every loop
so the debug log will be printed out as well
"
std::cerr << "PID Zone " << _zoneId << " max SetPoint "
<< _maximumSetPoint << " requested by "
<< _maximumSetPointName;
"
https://github.com/openbmc/phosphor-pid-control/blob/7c6d35d5c439196254a7ca600b2d6bc0650adf4a/pid/zone.cpp#L278C8-L280C43
_maximumSetPointName.clear() in every loop is a good idea
because it's consistent with _maximumSetPoint behaviour
but it changes the logic of _maximumSetPointName.compare completly
idea1
shall we modify it accordingly?
1 change the condition
"
else if (_maximumSetPointName.compare(_maximumSetPointNamePrev))
"
=>
'else'
2 add debug flag then the debug log will not be printed all the time
idea2
or simply remove
_maximumSetPointName.clear();
then the previous logic will still work
and _maximumSetPointName actually gets updated in addSetPoint()
if you have any better idea , feel free to let us know
Alang