commit | 7170a235f9f42f5b640a532021c6009f8fd941d1 | [log] [tgz] |
---|---|---|
author | Lei YU <yulei.sh@bytedance.com> | Thu Feb 04 16:19:27 2021 +0800 |
committer | Lei YU <yulei.sh@bytedance.com> | Mon Jul 12 11:38:23 2021 +0800 |
tree | 9cc1fc56abe7916056fac390b680de8fef51c1ae | |
parent | e76a5a6df5cd22c6d36691542c3d542204d6da89 [diff] |
psusensor: Use configurable read interval The intervals to read the psusensor value and event were hard-coded to 1000 ms. For some sensors user may need to use a different interval to poll, e.g. it should not poll the voltage of RTC battery because it drains the battery. The ADC sensor already has the similar change. Make them configurable parameters from entity-manager's json, so that the user could use customized poll rate to poll the specific sensors. If the "PollRate" is not set in the json config, the behavior is the same as before that uses the default 1s poll rate. The config parameters are the same as HwmonTemp and ADC sensor. E.g. the below json config changes the poll rate to 2.0s for pmbus sensor at i2c 5-0076. { "Address": "0x76", "Bus": 5, "Name": "CPU0_VR_0", "Labels": [ "pin", "temp1", "vout1" ], "PollRate": 2.0, "Thresholds": [...], "Type": "pmbus" } Tested: Add `PollRate` in pmbus's sensor and verify the related sensors' poll rate is changed accordingly. Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: I94109e65455dd5c27509ce89a62ef92738714298
dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.
runtime re-configurable from d-bus (entity-manager or the like)
isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible
async single-threaded: uses sdbusplus/asio bindings
multiple data inputs: hwmon, d-bus, direct driver access