| commit | 100c20bfcbb35413a137e00095e072c8ae8eb105 | [log] [tgz] |
|---|---|---|
| author | Jason Ling <jasonling@google.com> | Tue Aug 11 14:50:33 2020 -0700 |
| committer | Jason Ling <jasonling@google.com> | Mon Oct 05 18:06:53 2020 +0000 |
| tree | fc91c8559339207130b4004920e5f9f94492a53a | |
| parent | 32047ef7a5b70e8c610d51113ebdbef8167809b3 [diff] |
hwmontemp: add labels attribute support
Adds Labels support to Hwmontemp. The behavior is meant to be identical
to the behavior of Labels from PSUSensors.
Labels has the following behavior:
When discovering Name, Name1...NameX attributes from the configuration
and an associated temp is found
If tempX_label exists and its contents is in the Labels attribute then
create the sensor
If tempX_label does not exist but tempX is in the Labels attribute then
create the sensor
If Labels attribute is not present or is an empty list then create the
sensor
Tested:
Had a simple , publically available MAX6581 sensor that has
temp1, temp2, temp3, temp4, temp5
and tested with
Labels = ["temp1", "temp2", "temp3", "temp4", "temp5"]
├─/xyz/openbmc_project/sensors/temperature/max6581_1
├─/xyz/openbmc_project/sensors/temperature/max6581_2
├─/xyz/openbmc_project/sensors/temperature/max6581_3
├─/xyz/openbmc_project/sensors/temperature/max6581_4
├─/xyz/openbmc_project/sensors/temperature/max6581_5
Labels omitted
├─/xyz/openbmc_project/sensors/temperature/max6581_1
├─/xyz/openbmc_project/sensors/temperature/max6581_2
├─/xyz/openbmc_project/sensors/temperature/max6581_3
├─/xyz/openbmc_project/sensors/temperature/max6581_4
├─/xyz/openbmc_project/sensors/temperature/max6581_5
Labels containing temp2,temp5
Results:
├─/xyz/openbmc_project/sensors/temperature/max6581_2
├─/xyz/openbmc_project/sensors/temperature/max6581_5
And a similar test with a device that has temperature labels
"Labels": [
"device_label_A",
"device_label_B",
"device_label_C"
],
├─/xyz/openbmc_project/sensors/temperature/device1_label_A
├─/xyz/openbmc_project/sensors/temperature/device1_label_B
├─/xyz/openbmc_project/sensors/temperature/device1_label_C
Signed-off-by: Jason Ling <jasonling@google.com>
Change-Id: I6cb9edb0c7ae68fe01663d4ee1be0070715e9f82
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