Support retrieving 'utilization' from ME

ME exposes sensors which express host CPU utilization in range 0-255.
This change introduces following things:
- 'MESensor' sensor type introduced alongside legacy 'METemp' for clarity
- ability to expose 'utilization' sensor with range 0-100 (percent)
- scaling utilization value from 0-255 to 0-100

Testing:
- added following configuration on platform:
{
  "Address": 190,
  "Class": "MESensor",
  "Name": "Host CPU Core Utilization",
  "SensorType": "utilization",
  "ScaleValue": 0.392,
  "Type": "IpmbSensor"
}
- configuration properly loaded
- sensors appear on D-Bus and Redfish:
{
    "@odata.id": "/redfish/v1/Chassis/WC_Baseboard/Sensors/Host_CPU_Core_Utilization",
    "@odata.type": "#Sensor.v1_0_0.Sensor",
    "Id": "Host_CPU_Core_Utilization",
    "Name": "Host CPU Core Utilization",
    "Reading": 98.784,
    "ReadingRangeMax": 100.0,
    "ReadingRangeMin": 0.0,
    "ReadingUnits": "Percent",
    "Status": {
        "Health": "OK",
        "State": "Enabled"
    }
}

Change-Id: I49a14820e1b72f9776bd24ba1584d81ee0c95cd5
Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
2 files changed
tree: 4ff90ef22c4fe2afb70f2745732ad9aaca06570b
  1. cmake/
  2. include/
  3. service_files/
  4. src/
  5. tests/
  6. .clang-format
  7. .clang-ignore
  8. .gitignore
  9. cmake-format.json
  10. CMakeLists.txt
  11. Jenkinsfile
  12. LICENSE
  13. MAINTAINERS
  14. README.md
README.md

dbus-sensors

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.

key features

  • 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