History log of /openbmc/phosphor-pid-control/test/pid_json_unittest.cpp (Results 1 – 14 of 14)
Revision Date Author Comments
# 31058fd3 13-Jan-2023 Josh Lehan <krellan@google.com>

Implementing the TempToMargin feature

Wrapping the input name std::string in a new structure SensorInput, so
that the TempToMargin information can be cleanly carried along with
it, all the way down

Implementing the TempToMargin feature

Wrapping the input name std::string in a new structure SensorInput, so
that the TempToMargin information can be cleanly carried along with
it, all the way down to the PID input processing layer where it is
needed. This allows the conversion to be done just-in-time before the
temperature reading is interpreted, minimizing the blast radius of
this change. Nonetheless, because of the type change, there was a
somewhat large blast radius to implement this feature.

The design, and the documentation, is already here:
https://github.com/openbmc/phosphor-pid-control/issues/23

Tested: Added unit tests for JSON parsing and for proper execution
of the TempToMargin feature. They pass. Ran it locally, on our
appropriately-configured system, and it seems to work for me.

Change-Id: I598ba485195aaa70c26e91a1da3ab88fff8c3a4c
Signed-off-by: Josh Lehan <krellan@google.com>

show more ...


# 57a7af6a 14-Jun-2023 Harvey Wu <Harvey.Wu@quantatw.com>

fix compile error when enable meson test option

- Fix compile error:
[-Werror=sign-compare]

Signed-off-by: Harvey Wu <Harvey.Wu@quantatw.com>
Change-Id: Iaedcf75b14b7b5526ff6728a33305735470967ca


# 9f9a06aa 14-Dec-2022 Josh Lehan <krellan@google.com>

Fix interval calculation bug and D-Bus init

The new timing parameters were not settable from the D-Bus code path,
only from the old static JSON code path. Also, the divison would not
occur, causing

Fix interval calculation bug and D-Bus init

The new timing parameters were not settable from the D-Bus code path,
only from the old static JSON code path. Also, the divison would not
occur, causing the variable to remain at 1000 by default, not 10,
causing the thermal intervals to run 100 times slower than intended!

I fixed the algorithm used to calculate when the thermal intervals
should be inserted amongst the fan intervals. Now, the division is
not necessary, and any value should work, so long as the thermal
interval is greater than or equal to the fan interval.

I also fixed a subtle bug regarding the timer scheduling. It was
reinitializing the timer expiration time from "now" each interval,
instead of cleanly incrementing from the original expiration. This
caused the timer to run slower than intended, as the execution time
of each interval would not be subtracted out from the remaining time
that needs to be waited for, as it should have been.

Tested: Default values, for timing parameters, now work as intended

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: I759387b97af3ce93a76459faf5e9e7be3474016e

show more ...


# c612c051 12-Dec-2022 Josh Lehan <krellan@google.com>

Allow derivativeCoeff and DCoefficient optional

To avoid breaking existing configurations in the field, treat the
new "derivativeCoeff" parameter as optional, not mandatory.

This affects both the o

Allow derivativeCoeff and DCoefficient optional

To avoid breaking existing configurations in the field, treat the
new "derivativeCoeff" parameter as optional, not mandatory.

This affects both the old JSON parser, and the new D-Bus
entity-manager parser (it's called "DCoefficient" there).

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: Ifcaf47d66e009b48e41b510a2ef1686b8860ad35

show more ...


# 0e8fc398 04-Oct-2022 Bonnie Lo <Bonnie_Lo@wiwynn.com>

Support derivative term in PID algorithm and support to set cycle interval time from fan table

1. Support to calculate derivative term in PID algorithm.
2. Add two properties: cycleIntervalTimeMS an

Support derivative term in PID algorithm and support to set cycle interval time from fan table

1. Support to calculate derivative term in PID algorithm.
2. Add two properties: cycleIntervalTimeMS and updateThermalsTimeMS
in fan table that could be used to decide "time interval of PID control loop"
and "time interval to update thermals' cached value".

Tested:

- PID algorithm:
1. Check pid-control-service could calculate output PWM
according to the fan table.

[Test log]
root@greatlakes:~# systemctl status phosphor-pid-control -l
* phosphor-pid-control.service - Phosphor-Pid-Control Margin-based Fan Control Daemon
Loaded: loaded (/lib/systemd/system/phosphor-pid-control.service; enabled; preset: enabled)
Active: active (running) since Fri 2018-03-09 05:09:35 PST; 1min 47s ago
Main PID: 3105 (swampd)
CGroup: /system.slice/phosphor-pid-control.service
`-3105 /usr/bin/swampd -c /usr/share/entity-manager/configurations/fan-table.json
...
Mar 09 05:10:29 greatlakes phosphor-pid-control[3105]: PID Zone 1 max SetPoint 3.75 requested by
PID_NIC_SENSOR_TEMP BMC_SENSOR_FAN0_TACH BMC_SENSOR_FAN2_TACH BMC_SENSOR_FAN4_TACH BMC_SENSOR_FAN6_TACH

- Cycle interval time:
1. Set cycleIntervalTimeMS and updateThermalsTimeMS
to 1000 ms in fan table
2. Check service would update thermal every second from debug log.

[Test log]
root@greatlakes:~# journalctl -u phosphor-pid-control --since "Mar 09 04:52:16"
Mar 09 04:52:16 greatlakes systemd[1]: Started Phosphor-Pid-Control Margin-based Fan Control Daemon.
...
Mar 09 04:53:28 greatlakes phosphor-pid-control[2795]: processThermals
Mar 09 04:53:28 greatlakes phosphor-pid-control[2795]: processFans
Mar 09 04:53:29 greatlakes phosphor-pid-control[2795]: processThermals
Mar 09 04:53:29 greatlakes phosphor-pid-control[2795]: processFans
Mar 09 04:53:30 greatlakes phosphor-pid-control[2795]: processThermals
Mar 09 04:53:30 greatlakes phosphor-pid-control[2795]: processFans

Change-Id: I04e1b440603c3ad66a1e26c96451992785da6fe6
Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>

show more ...


# a1ae4fa1 28-Oct-2022 Harvey.Wu <Harvey.Wu@quantatw.com>

fix compile warning when meson build

- Fix compile warning:
[-Werror=unused-variable], [-Werror=sign-compare] and
deprecated INSTANTIATE_TEST_CASE_P

Signed-off-by: Harvey.Wu <Harvey.Wu@quantatw

fix compile warning when meson build

- Fix compile warning:
[-Werror=unused-variable], [-Werror=sign-compare] and
deprecated INSTANTIATE_TEST_CASE_P

Signed-off-by: Harvey.Wu <Harvey.Wu@quantatw.com>
Change-Id: If8713f0b938cd5306bbe19a9078731db0c3667dc

show more ...


# 1df9e879 08-Oct-2020 Patrick Venture <venture@google.com>

drop struct keyword for non-packed objects

As a style decision, struct is often used with packed structures to
indicate they are used like C-structs. Cleanup this codebase to not use
the extra stru

drop struct keyword for non-packed objects

As a style decision, struct is often used with packed structures to
indicate they are used like C-structs. Cleanup this codebase to not use
the extra struct keyword throughout.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I2f83bb1989e4d1f2f843ba3e45fb82e04f0fa61c

show more ...


# a076487a 08-Aug-2020 Patrick Venture <venture@google.com>

sensors/zones: place in namespace and cleanup

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I527dbc8477a232945f696227a7b0b2adbee45175


# 375f7098 29-Mar-2019 Hank Liou <Hank.Liou@quantatw.com>

Add stepwise parser

The json parser cannot read stepwise setting from config.
This change adds support to stepwise type of pid.

Change-Id: I650c5bd6a0040bf25630e33b3bd36abf388f0cd8
Signed-off-by: H

Add stepwise parser

The json parser cannot read stepwise setting from config.
This change adds support to stepwise type of pid.

Change-Id: I650c5bd6a0040bf25630e33b3bd36abf388f0cd8
Signed-off-by: Hank Liou <Hank.Liou@quantatw.com>

show more ...


# e3eeef45 26-Mar-2019 Patrick Venture <venture@google.com>

bugfix: grab hystersis parameter from pid json

The code incorrectly attempts to read the hystersis parameters from the
wrong scope of the json object. This fixes it to read from the pid
configurati

bugfix: grab hystersis parameter from pid json

The code incorrectly attempts to read the hystersis parameters from the
wrong scope of the json object. This fixes it to read from the pid
configuration's scope.

Tested: Added a new unit-test to hit this case.
Change-Id: I808bc907ec33a0b12d68a88fd316c3c9fae41516
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# f81f2886 26-Feb-2019 James Feist <james.feist@linux.intel.com>

Expand conf namespace

Put rest of conf.hpp in the conf namespace. This is
largely a sed replace, and wrapping from_json in
conf namespace as it failed to build.

Change-Id: I9fe5c7b2fface44618c43af2

Expand conf namespace

Put rest of conf.hpp in the conf namespace. This is
largely a sed replace, and wrapping from_json in
conf namespace as it failed to build.

Change-Id: I9fe5c7b2fface44618c43af2367035afc39bcb64
Signed-off-by: James Feist <james.feist@linux.intel.com>

show more ...


# 3484beda 25-Feb-2019 James Feist <james.feist@linux.intel.com>

s/minThermalRPM/minThermalOutput

The minThermalRPM is only an RPM by the fact that
that is the units of the PID. As the PID units can
be anything, change this to minThermalOutput to allow
for differ

s/minThermalRPM/minThermalOutput

The minThermalRPM is only an RPM by the fact that
that is the units of the PID. As the PID units can
be anything, change this to minThermalOutput to allow
for different units (i.e. percent).

Change-Id: Ic53fef1159ade5a413e5d519d407947f3023d8e3
Signed-off-by: James Feist <james.feist@linux.intel.com>

show more ...


# 903b0427 20-Feb-2019 Patrick Venture <venture@google.com>

conf change: s/feedFwdOffOffsetCoeff/feedFwdOffsetCoeff/g

Fixup spelling mistake for configuration field name.

Change-Id: I92d0af06f4e15f4408dd10f0dd9cd71099b77f4f
Signed-off-by: Patrick Venture <v

conf change: s/feedFwdOffOffsetCoeff/feedFwdOffsetCoeff/g

Fixup spelling mistake for configuration field name.

Change-Id: I92d0af06f4e15f4408dd10f0dd9cd71099b77f4f
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# d1491724 08-Feb-2019 Patrick Venture <venture@google.com>

add support to build zones and PIDs from json

Add support to build zones and PIDs from a json configuration file.

Change-Id: If8608dcd3e084cebabb71fc39851044df4d5d7c2
Signed-off-by: Patrick Venture

add support to build zones and PIDs from json

Add support to build zones and PIDs from a json configuration file.

Change-Id: If8608dcd3e084cebabb71fc39851044df4d5d7c2
Signed-off-by: Patrick Venture <venture@google.com>

show more ...