aboutsummaryrefslogtreecommitdiff
path: root/daemon/Hwmon.cpp
diff options
context:
space:
mode:
authorDrew Richardson <drew.richardson@arm.com>2014-07-16 12:00:00 -0700
committerDrew Richardson <drew.richardson@arm.com>2014-12-19 15:54:51 -0800
commit8b39b6c50a01bcfa280151b43079dab428cbab45 (patch)
tree66294093e2cd51c0df7afa6d119ec78f65274515 /daemon/Hwmon.cpp
parent020278c1a682ea75ddb63fe4e0d373116935199f (diff)
downloadgator-5.19.tar.gz
gator: Version 5.195.19
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'daemon/Hwmon.cpp')
-rw-r--r--daemon/Hwmon.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/daemon/Hwmon.cpp b/daemon/Hwmon.cpp
index 778f307..e444247 100644
--- a/daemon/Hwmon.cpp
+++ b/daemon/Hwmon.cpp
@@ -28,6 +28,7 @@ public:
const char *getTitle() const { return title; }
bool isDuplicate() const { return duplicate; }
const char *getDisplay() const { return display; }
+ const char *getCounterClass() const { return counter_class; }
const char *getUnit() const { return unit; }
int getModifier() const { return modifier; }
@@ -58,6 +59,7 @@ private:
char *label;
const char *title;
const char *display;
+ const char *counter_class;
const char *unit;
int modifier;
double previous_value;
@@ -87,7 +89,8 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
case SENSORS_FEATURE_IN:
title = "Voltage";
input = SENSORS_SUBFEATURE_IN_INPUT;
- display = "average";
+ display = "maximum";
+ counter_class = "absolute";
unit = "V";
modifier = 1000;
monotonic = false;
@@ -96,6 +99,7 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
title = "Fan";
input = SENSORS_SUBFEATURE_FAN_INPUT;
display = "average";
+ counter_class = "absolute";
unit = "RPM";
modifier = 1;
monotonic = false;
@@ -104,6 +108,7 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
title = "Temperature";
input = SENSORS_SUBFEATURE_TEMP_INPUT;
display = "maximum";
+ counter_class = "absolute";
unit = "°C";
modifier = 1000;
monotonic = false;
@@ -111,7 +116,8 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
case SENSORS_FEATURE_POWER:
title = "Power";
input = SENSORS_SUBFEATURE_POWER_INPUT;
- display = "average";
+ display = "maximum";
+ counter_class = "absolute";
unit = "W";
modifier = 1000000;
monotonic = false;
@@ -120,6 +126,7 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
title = "Energy";
input = SENSORS_SUBFEATURE_ENERGY_INPUT;
display = "accumulate";
+ counter_class = "delta";
unit = "J";
modifier = 1000000;
monotonic = true;
@@ -127,7 +134,8 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
case SENSORS_FEATURE_CURR:
title = "Current";
input = SENSORS_SUBFEATURE_CURR_INPUT;
- display = "average";
+ display = "maximum";
+ counter_class = "absolute";
unit = "A";
modifier = 1000;
monotonic = false;
@@ -136,6 +144,7 @@ HwmonCounter::HwmonCounter(HwmonCounter *next, const sensors_chip_name *chip, co
title = "Humidity";
input = SENSORS_SUBFEATURE_HUMIDITY_INPUT;
display = "average";
+ counter_class = "absolute";
unit = "%";
modifier = 1000;
monotonic = false;
@@ -311,6 +320,7 @@ void Hwmon::writeEvents(mxml_node_t *root) const {
mxmlElementSetAttr(node, "name", counter->getLabel());
}
mxmlElementSetAttr(node, "display", counter->getDisplay());
+ mxmlElementSetAttr(node, "class", counter->getCounterClass());
mxmlElementSetAttr(node, "units", counter->getUnit());
if (counter->getModifier() != 1) {
mxmlElementSetAttrf(node, "modifier", "%d", counter->getModifier());