summaryrefslogtreecommitdiffstats
path: root/readd.cpp
Commit message (Collapse)AuthorAgeFilesLines
* mainloop: add uniqueness to busnamePatrick Venture2018-05-071-0/+3
| | | | | | | | | | | | | There can be multiple daemon instances that have the same devpath which leads to a collision which errors silently. This adds uniqueness to the path, which was no longer human-readable to avoid this collision situation. Tested: Ran on quanta-q71l with unique devices and two instances pointing to the same device and it correctly set them up with unique but deterministic bus names. Change-Id: Id5aea3c3df5f793b28557a74995608ec40792a43 Signed-off-by: Patrick Venture <venture@google.com>
* Find hwmon path based on input path typeMatt Spinler2018-03-071-2/+11
| | | | | | | | | | | | | | | | If the input path starts with /devices, find the hwmon path using the findHwmonFromDevPath function, otherwise use findHwmonFromOFPath. Also change the argument name to something more generic. Did not change the argument's short name so the service file isn't coupled to this change. Tested: Tested with both paths. Change-Id: I5feb8a897fc86117b102ce44584ed977282cb955 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Rename functionMatt Spinler2018-03-051-1/+1
| | | | | | | | | | | A future commit will add a new function to find the hwmon device from a different type of path, so clarify the current function name in preparation. Tested: Compiled Change-Id: I3c990f4a91b12e592e22818b085dcd3736e5fcde Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* mainloop: Cache devpath at startupBrad Bishop2017-08-311-0/+8
| | | | | | | | | | Currently the devpath is determined after a bus error to make a callout. Finding the path at startup is less prone to race conditions around ENOENT on driver unload in the event of a callout. Change-Id: I8ce8d9f630c8b7ecc398082002aa113ab352d3cb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Don't exit program on sysfs read failures.Patrick Venture2017-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | We have an unreliable fan in one of the test systems and at present if the sysfs entry is unavailable or returns failure, then the program will exit. The program could be serving many sensors, and any one failure will cause it to exit. This is true not only when initially creating the sensors, but also if any sensor read fails at run-time. Testing: I verified the program logged the failures, which may not be ideal if there is a buggy sensor, but, I also ran it and managed to catch it where the sensor wasn't there initially and it cleanly reported only the sensors that were responsive and didn't just exit. There is certainly a case to be made for re-scanning periodically if the sensor returns or there was a timing issue, and there is a separate bug for that. This commit means only to make the program more robust on failure. Change-Id: I310a3e3c0e0ea86e439341a296b741ded18f46f2 Signed-off-by: Patrick Venture <venture@google.com>
* Add cmdline --of-name optionBrad Bishop2017-01-171-2/+13
| | | | | | | | Add an option for passing hwmon instances via the open firmware device path. This allows udev triggers based on the path. Change-Id: Icffc9734208204a052dc2910500df88136590e7d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Grab DBus connectionBrad Bishop2017-01-131-0/+1
| | | | | | | | Connect to DBus and own a busname. Create a freedesktop ObjectManager. Change-Id: I186dadc5a5172f44edf9cfc8d0a338677636de04 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add config optionsBrad Bishop2017-01-131-1/+5
| | | | | | | | Obtain the DBus service name prefix and sensors namespace root path from the configure script. Change-Id: I5c48882b62b09a466b3b7b30b3935d65ccc58326 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add a shutdown option to main loopBrad Bishop2017-01-131-1/+4
| | | | | | | | | | A shutdown option allows another thread to shut the server down. Typically this is only done at the end of a testcase that runs the server in one thread, and then executes tests from another. Change-Id: I7658bba79285d7c3e41b578c3510faa3363c5e01 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove main loop from application fileBrad Bishop2017-01-121-50/+2
| | | | | | | | Isolate main in its own file for maximum flexibility when linking. Change-Id: I7b1f591386d69a7044c65e7aab2116626166e4ff Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add Vim modelinesBrad Bishop2017-01-121-0/+1
| | | | | Change-Id: I23f30cd9be56089498089f8b12abe3f3e186b525 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Run astyleBrad Bishop2017-01-121-2/+2
| | | | | Change-Id: Iba20bab3093f15339760d4f782cc6d6e89156ab0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add licensesBrad Bishop2017-01-111-0/+15
| | | | | | | Add licenses to all implementation files. Change-Id: Ia7ba2f01e706a26fadb4331fe31254d9d7b5fd8c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix memory leakVishwanatha Subbanna2016-12-051-2/+2
| | | | | | | | | After parsing the command line arguments, ArgumentParser does a release of unique pointer which will just release the ownership. This pointer is then never cleaned up resulting in leak. Fix is to reset the unique_ptr to null Change-Id: Ifa69399e2440547947b214dc4a36c3065b6ff608 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Convert build process to autotoolsMatthew Barth2016-10-131-0/+79
Replaced the use of a manual Makefile with the use of autotools to automatically verify and generate the necessary build files. Follow the steps outlined within the README.md file to build the package. Change-Id: Ieed870c63b2bef83b3741dd22e413c25916ed408 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud