commit | 16966b5586260a285097c2c2ce8b565e1d212edd | [log] [tgz] |
---|---|---|
author | Ed Tanous <edtanous@google.com> | Wed Sep 15 15:06:59 2021 -0700 |
committer | Ed Tanous <ed@tanous.net> | Mon Jul 18 15:18:54 2022 +0000 |
tree | 037a56fa8b086674ccac9d78c44dbed6fa6d69e0 | |
parent | bce0f038383c54dc3da515610893abeefe3be045 [diff] |
Enable an io-uring build There exists a bug where calls that we previously thought were non-blocking, actually do block when used with hwmon or filesystem fds. This causes high latencies on the dbus interfaces when lots of sensors are used in a single daemon, as is the case in PSUSensor. This patchset moves the PSUSensor code over to using io-uring, through boost asio, using the random_access_file class. This helps with performance in a number of ways, the largest of which being that sensor reads are no longer blocking. Tested: Booted the sensor system on Tyan S7106; dbus-monitor shows sensors scanning normally. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I654eafcfab5a24b65b89c204ab43d81c7ae064cf
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
A typical dbus-sensors object support the following dbus interfaces:
Path /xyz/openbmc_project/sensors/<type>/<sensor_name> Interfaces xyz.openbmc_project.Sensor.Value xyz.openbmc_project.Sensor.Threshold.Critical xyz.openbmc_project.Sensor.Threshold.Warning xyz.openbmc_project.State.Decorator.Availability xyz.openbmc_project.State.Decorator.OperationalStatus xyz.openbmc_project.Association.Definitions
Sensor interfaces collection are described here.
Consumer examples of these interfaces are Redfish, Phosphor-Pid-Control, IPMI SDR.
dbus-sensor daemons are reactors that dynamically create and update sensors configuration when system configuration gets updated.
Using asio timers and async calls, dbus-sensor daemons read sensor values and check thresholds periodically. PropertiesChanged signals will be broadcasted for other services to consume when value or threshold status change. OperationStatus is set to false if the sensor is determined to be faulty.
A simple sensor example can be found here.
Sensor devices are described using Exposes records in configuration file. Name and Type fields are required. Different sensor types have different fields. Refer to entity manager schema for complete list.