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>
diff --git a/include/IpmbSensor.hpp b/include/IpmbSensor.hpp
index c5548fa..564a070 100644
--- a/include/IpmbSensor.hpp
+++ b/include/IpmbSensor.hpp
@@ -25,7 +25,8 @@
temp,
curr,
power,
- volt
+ volt,
+ util
};
struct IpmbSensor : public Sensor