summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Set ignoreDbusMinMax for StepwiseHEADmasterJames Feist2019-11-121-0/+1
| | | | | | | | | | Temperature readings should not be in percent. Add ignoreDbusMinMax as inheritFromDbus was removed. Tested: modified fan floor by changing stepwise controller Change-Id: I1bf4e15ca78bc894dc82dd68e787fd6fbd3d0aef Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add ignoreDbusMinMax to temp configurationsJames Feist2019-11-111-0/+1
| | | | | | | | | | | | | | Originally 'inheritFromDBus' was only set for fan configurations. This was removed, so now everything was inheriting from Dbus. Set the inverse of 'inheritFromDBus' of ignoreDbusMinMax to temp configurations so that they get the correct reading. Tested: Used sensor override in a loop on a sensor and saw the reading in the pid be correct Change-Id: I29dab298921f9c5204d29341555f2c5d2d011aa2 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Start phoshphor-pid-control after fansensorPeter Lundgren2019-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Occasionally, phosphor-pid-control fails to start logging: swampd[2688]: terminate called after throwing an instance of 'std::runtime_error' swampd[2688]: what(): ObjectMapper Call Failure This happens multiple times: systemd[1]: phosphor-pid-control.service: Main process exited, code=killed, status=6/ABRT systemd[1]: phosphor-pid-control.service: Failed with result 'signal'. systemd[1]: phosphor-pid-control.service: Service RestartSec=1s expired, scheduling restart. systemd[1]: phosphor-pid-control.service: Scheduled restart job, restart counter is at 2. systemd[1]: Stopped Swampd Margin-based Fan Control Daemon. systemd[1]: phosphor-pid-control.service: Start request repeated too quickly. systemd[1]: phosphor-pid-control.service: Failed with result 'signal'. systemd[1]: Failed to start Swampd Margin-based Fan Control Daemon. and systemd gives up and stops trying to restart the service. $ systemctl --no-page status phosphor-pid-control.service * phosphor-pid-control.service - Swampd Margin-based Fan Control Daemon Loaded: loaded (/lib/systemd/system/phosphor-pid-control.service; enabled; vendor preset: enabled) Active: failed (Result: signal) since Thu 2019-10-31 18:05:11 UTC; 1min 56s ago Process: 2738 ExecStart=/usr/bin/swampd (code=killed, signal=ABRT) Main PID: 2738 (code=killed, signal=ABRT) xyz.openbmc_project.fansensor.service is the service from dbus-sensors that phosphor-pid-control uses to interact with the fans and pwms. phosphor-pid-control should not start until after fansensor. Tested: swampd comes up reliably on a system using xyz.openbmc_project.fansensor.service. I have not tried a system that isn't using dbus-sensors. Signed-off-by: Peter Lundgren <peterlundgren@google.com> Change-Id: Iec019bfabcc77279c7dfe8d4899ac07c1c41a428
* conf: add ignoreDbusMinMax optionPatrick Venture2019-09-106-3/+166
| | | | | | | | | Add an optional field to the sensor configuration, s.t. it'll tell a dbus passive sensor to ignore the MinValue and MaxValue properties from dbus. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ia6a8c802c2dc5bf41e5e860b21d7764cc09e6b6b
* build: drop flto option to workaround gcc issuePatrick Venture2019-09-091-4/+2
| | | | | | | | | | main.o swampd-util.o ./.libs/libswampd.a -lstdc++fs -lphosphor_logging -lsdbusplus -lsystemd -lphosphor_dbus 00:59:59 | lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:154 Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I387d1530ff7daaa217dce980e357ea612f7ddfdb
* sensors: buildjson: only load min/max if type fanPatrick Venture2019-08-291-2/+17
| | | | | | | | | The min/max value in the json configuration only provide meaning in the context of a fan sensor. This patch only loads the configuration options in that case, and reports a warning if otherwise detected. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I20898ab3c87f4e9c6005683420a30c6685944c96
* sensors: buildjson: minor min/max cleanupPatrick Venture2019-08-291-10/+5
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I9d01753a40f1146d49e1a03a18dbea704f3fff84
* s/swampd.service/phosphor-pid-control.service/gPatrick Venture2019-07-182-4/+4
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ia1f08915f5541142cb3e10aa68043d3d2cad0167
* rename away from RPMPatrick Venture2019-07-168-34/+34
| | | | | | | | | | The SetPoint output from a thermal PID is likely RPM, and that value is then fed into a fan controller PID as the set-point (unit: RPM). This does not have to be RPM, however. Continue renaming variables and methods to remove the explicit unit-naming. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I570dee0c688338f9a458cac7123314717bee2b42
* rename RPMSetPoint to SetPointPatrick Venture2019-07-169-26/+26
| | | | | | | | | | | The PIDs were originally focused on collecting RPM set points from thermal PIDs and then having fan PIDs use the highest value collected, it doesn't need to be strictly an RPM set point. It does however need to be one type of value. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I1d589cf4b2688d7e86030c10496d737dc5bbdadf
* gitignore: add service filePatrick Venture2019-07-161-0/+2
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ib144b0759ce3b5db92e16c8801df365fb07e1a7c
* bugfix: writePath is the dbus object path for the sensorPatrick Venture2019-07-162-8/+4
| | | | | | | | | | For the sensor, if writePath is used for dbus active, it is always FanPwm (presently) and needs to be the object path. Tested: Not tested, only code inspected. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I4eafaff4316aac9dab9a2c9e1bd61093a670b023
* Allow setting setpoint based on dynamic thresholdsJames Feist2019-07-162-48/+165
| | | | | | | | | | | | | | | | | As we allow dynamic thresholds in dbus-sensors to track the t-control of dimms etc, we want to be able to set a setpoint based on a offset from a threshold. This adds the ability to create a "SetPointOffset" that is a threshold of the given sensor. For instance a "SetPointOffset" of "WarningHigh" would get the sensors "WarningHigh" value then add the "SetPoint" value to it (commonly negative for WarningHigh/CriticalHigh). Tested: Turned on debug print and saw correct setpoint being loaded into config Change-Id: Idb9760ea5a66347f24573fb26937f8f278834a19 Signed-off-by: James Feist <james.feist@linux.intel.com>
* sensors: ignore min/max in json for D-Bus passive sensor readKun Yi2019-07-113-16/+0
| | | | | | | | | | | | | | | | | | | | min/max values were meant to scale write to be PWM, but were overloaded in commit 75eb769d351434547899186f73ff70ae00d7934a to scale sensor read to percent as well. However currently the D-Bus sensors built from JSON can only specify one pair of min/max values,so they cannot be used for both read/write interfaces. Fix the behavior by ignoring min/max in settings when building D-Bus passive read interface and only read them from D-Bus. Tested: D-Bus passive sensor value is no longer scaled if there is no MinValue/MaxValue specified. Resolves: openbmc/phosphor-pid-control#14 Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: I206bbe75c77e79f765eca76cfa015321dcba4aa7
* util: Avoid division by invalid valueKun Yi2019-07-101-1/+1
| | | | | | | Check for max > min before dividing by difference Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: Ic2a983bb6f7c04f1deafcab228b76ff60012f011
* dbuspassive: Fix typo in variable checkKun Yi2019-07-101-1/+1
| | | | | | | When setting min, should check for min instead of max. Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: I0097bb329408f807fea6d68ca0055c5d8215aba3
* README: configure: fixup markdownPatrick Venture2019-06-261-19/+8
| | | | | | | | The tool used to write this implemented features not available in the makrdown used by github. Therefore, this removes those features. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I3a3eed1c8f298fe88f0ddbcb43aa897ec4d6f623
* Adding service fileVijay Khemka2019-06-253-0/+41
| | | | | | | Service file for swampd has been added Signed-off-by: Vijay Khemka <vijaykhemka@fb.com> Change-Id: If449c0e943f1a82e9d18599391f0dc68c28009ec
* dbusconfiguration: Protect better against bad configJames Feist2019-06-241-6/+7
| | | | | | | | | | | | | | | Configurations with no input are not allowed. The current code looked for if there were any sensors avaiable. On our systems an input was not being displayed due to a bug, but the output was there, causing pid control to crash. Protect against this issue. Tested: Had sensor bug in tree, and pid control didn't segfault Change-Id: I42869748bac0b85affae5f5c671b859fec996a54 Signed-off-by: James Feist <james.feist@linux.intel.com>
* README: add timeout field to configure detailsPatrick Venture2019-06-191-3/+11
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I1d58fc0408d4c1bf29927dfe36155139e87ba242
* README: configure: add PID notesPatrick Venture2019-06-181-23/+169
| | | | | | | | Add some initial PID notes. Added some TODO line items for things that need further documentation. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If9d219a6410d4f36af04e0d69d4a865dbdd19492
* README: start adding configuration detailsPatrick Venture2019-06-142-0/+113
| | | | | | | Add details for configuring the sensor. Not yet the zones. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I073a4dde4fd6c785ffaea2daed03ebbe83d0d1d2
* README: cleanup obsolete or unimportant dataPatrick Venture2019-06-141-160/+8
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ib2b0d89df2f5475fd571d9bec474ae7b769cf28a
* README: cleanup and split out oem-ipmi detailsPatrick Venture2019-06-142-73/+80
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I459a910f39695f22732bfdef2d70a9d594af290d
* README: formatting cleanupPatrick Venture2019-06-141-27/+26
| | | | | | | | Dropped this into an auto-formatter today as part of setting up for the next changes. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Iee4fbdc2ba58bfe435dafc07bae7ad47f2e4ef61
* Add Fan Redundancy SupportJames Feist2019-06-058-18/+276
| | | | | | | | | | | | | | This adds fan redundancy support to passive sensors. If there are redundancy interfaces on dbus, we'll fail a sensor if the status is set to failed. Tested: Set Redundancy to Failed On Dbus, saw all fans in collection boost. Then restarted swampd, came up and still boosted. Set redundancy OK, and they all slowed down. Change-Id: I8879bef1471bbc168435d6b22dd20006b9dca133 Signed-off-by: James Feist <james.feist@linux.intel.com>
* docs: Add a small guide for thermal tuningKun Yi2019-06-052-0/+56
| | | | | | | | Add a guide explaining the tuning procedure and logging format, and point README to it Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: I287b0ef4a5ede1c62751d1671e2eec188133a074
* Add stepwise parserHank Liou2019-05-282-19/+147
| | | | | | | | 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>
* Check fans for failureWill Liang2019-05-232-1/+141
| | | | | | | | Add check the fan fail. If detect fan fail then into the fail safe mode. Signed-off-by: Will Liang <will.liang@quantatw.com> Change-Id: I6ef9d42e131500c1b38a708e1c6fda15dc712f60
* main: fix loggingEnabled checkingKun Yi2019-05-171-2/+2
| | | | | | | | | loggingPath is not populated after args are parsed. Tested: with -l, swampd correctly generated logs Resolves: openbmc/phosphor-pid-control#12 Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: Ic103879f6b65d4e89c49e8d9700c5d71b9549f4d
* Remove FanProfile configurationJames Feist2019-05-131-111/+42
| | | | | | | | | | | | | If we add a "Profiles" vector into the PID and Stepwise entity-manager configurations the logic becomes much more simple. We default to all profiles, and can limit the scope of some configurations to the selected profile. Tested: Switched between Acoustic/Performance mode and saw a UpperClippingCurve get added / removed. Change-Id: Ib0448b59210f696c8a28a99da06f98b065eadf08 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Make dbusconfiguration reloadable without rebootJames Feist2019-05-0910-112/+161
| | | | | | | | | | | | | | | | | Now that asio is being used instead of threads, we can reload the fan configuration without having to restart the application. This moves the ownership of the passive and host bus outside of the SensorManager so that it can be recreated each reload. Tested: Watched logs and saw full fan config get reloaded after changing fan configuration Tested: Ran on json configured system and it behaved as expected. Change-Id: I00e6b27f75384fd41de2017b723f159c9691ae97 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Consolidate all util.hppJames Feist2019-05-0816-135/+133
| | | | | | | | This deletes all lower level util.hpp and cats them into the top level util.hpp to avoid name conflicts. Change-Id: Ia11e4a08053a3970b0aadf21d1156ab26def36bd Signed-off-by: James Feist <james.feist@linux.intel.com>
* explicitly expect a directory for loggingPatrick Venture2019-05-082-2/+3
| | | | | | | | Verify the logging parameter is explicitly a directory. Treat the path as a directory for creating the logging files. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I84d6be79780df3f52deeb1ff1b7a50de6175c055
* split parameters for logging and tuningPatrick Venture2019-05-088-24/+36
| | | | | | | | | add a flag to enable/disable tuning: default off add an option for specifying a folder for outputting logs. Closes: #10 Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I43864768f1dee8672f13288d3cf5a0c87c373aed
* main: drop log file path checkPatrick Venture2019-05-081-2/+1
| | | | | | | Remove check that the log file path exists. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I8324ea847fd57de54ab1a9d252fd12a3ddafc4d8
* Remove threadsJames Feist2019-04-079-197/+167
| | | | | | | | | | | | | | | This converts phosphor-pid-control into an async single threaded application. The reason for doing this is on our systems phosphor-pid-control had the largest VSZ when viewed under top. Before this patch the VSZ was at 50720, after it is at 7760. Tested-by: Could still interact with all interfaces under rest-dbus and sensor override worked to ramp fans when changing cpu temps. Change-Id: Ie0a837bdf0d1b1df61dc7aff87e5d503b9e0e875 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Bugfix: dbusconfiguration: read correct hysteresisJames Feist2019-04-021-1/+1
| | | | | | | s/positive/negative Change-Id: Ib7761abae47404706c69255fc2861d0f58c26369 Signed-off-by: James Feist <james.feist@linux.intel.com>
* build: install into bin instead of sbinPatrick Venture2019-03-281-1/+1
| | | | | | | | | | Installs swampd and setsensor into bin instead of sbin per guidelines. Warning: Every platform requires its own service file, please update your service file when you pick up this change. Change-Id: Ib7fe057d8758a8851049e88d41d13ca80b0b9862 Signed-off-by: Patrick Venture <venture@google.com>
* bugfix: grab hystersis parameter from pid jsonPatrick Venture2019-03-262-2/+51
| | | | | | | | | | 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>
* autotools: Fix for autoconf-archive 2019.01.19Patrick Venture2019-03-194-4/+14
| | | | | | | | | The code coverage macros from the archive changed in a backward incompatible way. This adds a workaround to autodetect either version and do the right thing. Change-Id: I63d1cdf6edb125d75872d6dae38f8602fc043431 Signed-off-by: Patrick Venture <venture@google.com>
* pid: zone: add zone id to log namePatrick Venture2019-03-181-1/+1
| | | | | | | | When a log path is provided, append the zone id to the log so that each zone will have its own log file. Change-Id: I56f92669eda23148127f53fd50e119912a24200b Signed-off-by: Patrick Venture <venture@google.com>
* swap out getopts for cli11Patrick Venture2019-03-112-34/+21
| | | | | | | Swap out getopt for cli11 for parsing parameters. Change-Id: If6845c359dafc28b545925faa4701d401c7b8dd2 Signed-off-by: Patrick Venture <venture@google.com>
* experiment: cppcheck cleanupPatrick Venture2019-03-111-1/+1
| | | | | | | | [experiments/drive.cpp:83] -> [experiments/drive.cpp:96]: (style) Variable 'check' is reassigned a value before the old one has been used. Change-Id: I241a2b38418ab89790d2d8762aaceb3cd080ad77 Signed-off-by: Patrick Venture <venture@google.com>
* use filesystem instead of experimentalPatrick Venture2019-03-082-7/+2
| | | | | | | | Use filesystem now that it should be available instead of experimental::filesystem. Change-Id: I8648ac2b279eea42c13d6b12f312a2e1e02aa152 Signed-off-by: Patrick Venture <venture@google.com>
* build: add CODE_COVERAGE_CXXFLAGS everywherePatrick Venture2019-03-061-2/+6
| | | | | | | Add this explicitly everywhere. Change-Id: Ia7a6edd077100de545186b9e298e3bc8e4456fba Signed-off-by: Patrick Venture <venture@google.com>
* build: enable code coveragePatrick Venture2019-03-064-4/+68
| | | | | | | | Enable code coverage for the project. Valgrind not enabled in this step. Change-Id: I62891f6054e5e5315d7f150a1f3dcf619f2740db Signed-off-by: Patrick Venture <venture@google.com>
* build: rework gtest checksPatrick Venture2019-03-062-22/+73
| | | | | | | Rework gtest checks to be modeled after openbmc/gpioplus. Change-Id: I54539c7031dbf87fea5d2c8ad56e415be8917f7a Signed-off-by: Patrick Venture <venture@google.com>
* gitignore: add coverage piecesPatrick Venture2019-03-061-0/+9
| | | | | | | Add coverage bits to gitignore. Change-Id: Ia023c7e8d3a0035d72774c90ad76b0895149573f Signed-off-by: Patrick Venture <venture@google.com>
* add tuning enable variablePatrick Venture2019-02-2810-68/+105
| | | | | | | | | | | Add a variable that when set, enables tuning logging. This variable is set to false. Tuning can be enabled via "-t" "--tuning" on the command line. With a parameter is the path where to write the logging information. Change-Id: I6eb8035d56cc3301face21e9375c02fc9fcc5b31 Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud