summaryrefslogtreecommitdiffstats
path: root/sensors
Commit message (Collapse)AuthorAgeFilesLines
* conf: add ignoreDbusMinMax optionPatrick Venture2019-09-101-0/+10
| | | | | | | | | 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
* 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
* Add Fan Redundancy SupportJames Feist2019-06-051-2/+17
| | | | | | | | | | | | | | 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>
* Make dbusconfiguration reloadable without rebootJames Feist2019-05-093-17/+14
| | | | | | | | | | | | | | | | | 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>
* Expand conf namespaceJames Feist2019-02-264-9/+12
| | | | | | | | | 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>
* dbuspassive: allow scalingJames Feist2019-02-261-2/+2
| | | | | | | | | | | | | | | | For tachs it is beneficial to deal in percent so that multiple controllers can be used with different fan types without having to recalculate. This starts using the unused min and max fields to be able to scale readings. Since max and min are commonly on the value interface, the special value of <int64_t>::lowest() allows these to be gathered from dbus instead of having to enter them manually. Tested-by: Moved pid control to percent and printed outputs Change-Id: I9496eb92a18b68a7cd7f034d41d40ef5175c6974 Signed-off-by: James Feist <james.feist@linux.intel.com>
* swap libconfig++ for json in configuration parsingPatrick Venture2019-02-112-125/+0
| | | | | | | Parse the configuration file as json and not libconfig++. Change-Id: Ic3e71cc810195387617b545566cf757c61c71942 Signed-off-by: Patrick Venture <venture@google.com>
* conf change: sensors: read and write path renamePatrick Venture2019-02-113-20/+20
| | | | | | | | Rename the readpath and writepath for camelcase styling to make all configuration variables consistent. Change-Id: I33f475075c8f40cd2029a5c0bfda950846cd5d44 Signed-off-by: Patrick Venture <venture@google.com>
* sensors: buildjson: add todo for failurePatrick Venture2019-02-081-0/+3
| | | | | | | | The daemon needs to validate the json configuration, either immediately after it's parsed or when objects are built from it. Change-Id: I52b5a558657ba1420bc4589de793cc496392f318 Signed-off-by: Patrick Venture <venture@google.com>
* add support to build sensors from jsonPatrick Venture2019-02-082-0/+108
| | | | | | | Add support to build sensors from a json configuration file. Change-Id: Ic5bcbcd01e085ab0d4efaed314af8dc7e82b0b9d Signed-off-by: Patrick Venture <venture@google.com>
* sensors: add method to grab default timeoutPatrick Venture2019-02-081-0/+14
| | | | | | | | | Add a central method for grabbing the default timeout for a sensor. This is required to allow for a configuration to leave out an unnecessary field. Change-Id: I29ecd9db67b1eb1e66e60ef49859926cf14a4542 Signed-off-by: Patrick Venture <venture@google.com>
* Change all default_bus back to new_system busJames Feist2019-01-291-2/+2
| | | | | | | | | | | | | | | | | new_default now returns a reference to a single bus, phosphor-pid-control uses multiple busses so we do not want that. This was the way it was implemented prior to https://github.com/openbmc/sdbusplus/commit/8ca6025eed193c252149b2908c3d5e37b00b0107 Tested-by: swampd ran normally These errors go away: Jan 28 18:28:45 swampd[1760]: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' Jan 28 18:28:45 swampd[1760]: what(): sd_bus_request_name: org.freedesktop.DBus.Error.InconsistentMessage: Bad message Change-Id: I708cd5e6c45509f27d4fe783c0b0cfb52ff10336 Signed-off-by: James Feist <james.feist@linux.intel.com>
* manager: use pass by reference by defaultPatrick Venture2018-10-302-2/+2
| | | | | | | Even thought the string must be copied, pass by reference. Change-Id: I48113237f342279e3f266bbda6e54d770afd2afc Signed-off-by: Patrick Venture <venture@google.com>
* style: misc camel casingPatrick Venture2018-10-301-4/+4
| | | | | | | Miscellaneous camel casing. Change-Id: I90f7ab36448ad7c6a8e22677345d9d15591a64d5 Signed-off-by: Patrick Venture <venture@google.com>
* style: use system path for dbus headersPatrick Venture2018-10-301-1/+1
| | | | | | | Use system path for dbus headers. Change-Id: I08088eb0932de738fc410104c28847aaf78d95bd Signed-off-by: Patrick Venture <venture@google.com>
* sensors: throw build time exceptions on failurePatrick Venture2018-10-301-3/+13
| | | | | | | Throw build time exceptions on failure. Change-Id: I7f873e15d0827b2424b9a1cfb6b494546952f1aa Signed-off-by: Patrick Venture <venture@google.com>
* errors: add exception for build time failurePatrick Venture2018-10-301-0/+1
| | | | | | | Add a specific exception for build-time failures. Change-Id: I1e6189ca256398d6995d4d0e0127846e1a7249a9 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: dbuswrite: use factory to catch errorsPatrick Venture2018-10-301-2/+4
| | | | | | | | Add factories for creating DbusWrite and DbusWritePercent objects and use these factories. Change-Id: Iad222d4bf6c1fdf561daa4ba9d88a6644c0a5965 Signed-off-by: Patrick Venture <venture@google.com>
* style: function names should be lower camelPatrick Venture2018-10-304-7/+7
| | | | | | | Fix function names to be lower camel. Change-Id: I145e1f4c03d7740bc1525dcffbdce2f78fd61075 Signed-off-by: Patrick Venture <venture@google.com>
* style: member functions should be lower camelPatrick Venture2018-10-304-6/+6
| | | | | | | Rename member functions to be lower camel instead of snake case. Change-Id: Ib227fd3dadb6d9607290277205223a4324cd4ce5 Signed-off-by: Patrick Venture <venture@google.com>
* style: fixup naming of structuresPatrick Venture2018-10-303-5/+7
| | | | | | | Fixup naming of structures to UpperCamel. Change-Id: I6a9bf0b954298089c85d3362e86cd95b3fc5b944 Signed-off-by: Patrick Venture <venture@google.com>
* cleanup: apply constness to read-only iteratorsPatrick Venture2018-10-231-1/+1
| | | | | | | Apply const to read-only iterators to indicate intent more clearly. Change-Id: Ic14304c69361da203d3d3a900180bd54346acc87 Signed-off-by: Patrick Venture <venture@google.com>
* [dbus-passive] Add threshold fan failureJames Feist2018-10-153-0/+10
| | | | | | | | | | | | | | When a threshold is crossed for a monitored sensor, assert fan failure. Tested-by: Changed a sensor threshold so that its current reading made the threshold asserted and noticed via print messages that the sensor went into failure state. Also noticed fans ramp. Wrote unit test to verify sensor can move in and out of error state correctly. Change-Id: I83182536e4874eaba97f3f1d48d53ac110fba833 Signed-off-by: James Feist <james.feist@linux.intel.com>
* cleanup: reduce scope of variablesPatrick Venture2018-10-131-1/+2
| | | | | | | Various things caught by cppcheck that are non-critical. Change-Id: I495453c84bc15788b85036a163ee36b0ac601fa1 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-08-3111-220/+170
| | | | | Change-Id: I6627b5569c2e0f730be7331403218b823a2c622f Signed-off-by: Patrick Venture <venture@google.com>
* Add ability to configure from dbusJames Feist2018-07-231-0/+18
| | | | | | | | | | | | | | This allows configuration of PID control from dbus using entity manager. Sample configuration will be pushed to entity-manager repo shortly. Tested-by: Used yaml configuration and dbus / entity-manager based configuration and pid seemed to work the same. Verified printout of configuration matched generated cpp files. Change-Id: Ia7b016e53262791ffcccdb9b21c1ccddae2926bc Signed-off-by: James Feist <james.feist@linux.intel.com>
* test: dbus: passive read interfacePatrick Venture2018-06-281-5/+5
| | | | | | | | | | Added basic unit-tests and added a factory for creating the DbusPassive read interface so that it can be nicely error checked. This is handled via a valid type check where the only valid types are 'fan' and 'temp'. Change-Id: I558ed09bf509d26f20c6e431bb0789074e9aa841 Signed-off-by: Patrick Venture <venture@google.com>
* dbus: transition to interface for testingPatrick Venture2018-06-221-1/+3
| | | | | | | | | | To make testing easier, the dbus objects now receive a helper interface to use instead of calling into a helper module. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I2521d9c75aec76e92d2e26dc044d01011e44d552 Signed-off-by: Patrick Venture <venture@google.com>
* test: pid: zonePatrick Venture2018-06-221-2/+2
| | | | | | | | | | Add unit-tests for the PID zone module. Add zone_mock. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I51185b2d2daacea6ffb687e8f38c4fe2b2a1bed3 Signed-off-by: Patrick Venture <venture@google.com>
* enable unit-tests: enable for SensorManagerPatrick Venture2018-06-145-18/+33
| | | | | | | | | | | | | Enabled unit-tests in general for the project, and more specifically started with a benign construction test for the SensorManager object. Tested: Verified continues to build and link, and unit-test passes. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: I4ad9a0c57efd0b9ccc37d26faa0cc1b82026b8d7 Signed-off-by: Patrick Venture <venture@google.com>
* sensors: split building from manager objectPatrick Venture2018-06-146-237/+304
| | | | | | | | | | | | To increase testability, split out the building of sensors from the sensor manager. And this further splits out building from a configuration file. Tested: Verified code continued to build and link. Tested: Ran on quanta-q71l board and it behaved as expected. Change-Id: Ib63a11e1107b1864c3c370bba2bd9ef2effa42f3 Signed-off-by: Patrick Venture <venture@google.com>
* Spelling fixesGunnar Mills2018-06-141-1/+1
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I1de3fdd00d0c132987b1eeb78b2945f30d3ab538 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* sensors: host: add commentPatrick Venture2018-06-111-0/+7
| | | | | | | | | Adds a comment for future clean-up where the code needs to have a parameter removed to prevent an early call to emit_object_added before the properties are properly configured. Change-Id: I18f15e933a19793597e2cd3da183f33a94e7511c Signed-off-by: Patrick Venture <venture@google.com>
* Sensor ObjectsPatrick Venture2018-03-088-0/+582
This includes all the sensor objects including a few implementations, including dbus and sysfs sensors. Change-Id: I9897c79f9fd463f00f0e02aeb6c32ffa89635dbe Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud