commit | 9bbe60260d080b31b0e2ceaef42f95caaf28e553 | [log] [tgz] |
---|---|---|
author | Carol Wang <wangkair@cn.ibm.com> | Thu Aug 01 17:31:30 2019 +0800 |
committer | Carol Wang <wangkair@cn.ibm.com> | Tue Aug 27 13:42:44 2019 +0800 |
tree | fc22c6063dea6253a0092cd3dc6208e40cfb4f1d | |
parent | 2227bd52c5bb8d62dcfe33b58d65515d21e9be17 [diff] |
Support averaging power values Support new env variables 'AVERAGE_power* = "true"' in hwmon config file. When this env variable is set, power value is the calculated average value. Otherwise, power value is from power*_input by default. The new average of power is calculated since the last time the sensor's values were changed and read. average = (cur_average*cur_average_interval - pre_average*pre_average_interval) / (cur_average_interval - pre_average_interval) hwmon config example: AVERAGE_power2 = "true" AVERAGE_power3 = "true" AVERAGE_power4 = "true" Tested: Set AVERAGE_power* in p0 OCC hwmon conf but not in p1 OCC hwmon conf, then get power sensor info with restapi to check the values. 1. The values of p0*power are all average values. 2. The values of p1*power are all input values. Note: Delete $(CODE_COVERAGE_CPPFLAGS) in AM_CPPFLAGS in test/Makefile.am. This option will define NDEBUG during configuration, then assert in code doesn't work. Resolves: openbmc/openbmc#3187 Signed-off-by: Carol Wang <wangkair@cn.ibm.com> Change-Id: I8d97a7b2905c79cd4f2c276b32e7f5590ffc0483
Exposes generic hwmon entries as DBus objects. More information can be found at Sensor Architecture
To build this package, do the following steps: 1. ./bootstrap.sh 2. ./configure ${CONFIGURE_FLAGS} 3. make To clean the repository run `./bootstrap.sh clean`.
To enable the use of Linux features like cgroups prioritization and udev/systemd control, one instance of phosphor-hwmon is intended to be run per hwmon sysfs class instance. This requires an algorithm for selecting a stable, well-known D-Bus busname. The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default), ID is a std::hash of the /sys/devices path backing the hwmon class instance, and N is the implemented phosphor-hwmon D-Bus API version.