monitor: include previous targets and tachs in PEL
To discover the source of certain fan ramp-up failures, this change
outputs the previous 8 targets and tach readings. The strategy is to see
if hardware limitations prevent attaining the targets quickly enough.
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: Ia38867986b8a8a651de5d01766393c07d413273c
diff --git a/monitor/system.cpp b/monitor/system.cpp
index 050913e..aff3bdc 100644
--- a/monitor/system.cpp
+++ b/monitor/system.cpp
@@ -1,5 +1,5 @@
/**
- * Copyright © 2021 IBM Corporation
+ * Copyright © 2022 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -483,11 +483,20 @@
values["present"] = fan->present();
values["functional"] = sensor->functional();
values["tach"] = sensor->getInput();
+
if (sensor->hasTarget())
{
values["target"] = sensor->getTarget();
}
+ // convert between string/json to remove newlines
+ values["prev_tachs"] = json(sensor->getPrevTach()).dump();
+
+ if (sensor->hasTarget())
+ {
+ values["prev_targets"] = json(sensor->getPrevTarget()).dump();
+ }
+
data["sensors"][sensor->name()] = values;
}
}