Revert "log debug information for sensor threshold assert events"
This reverts commit 9bf6804c2d76b92005ad9851cb052d407ea3117f.
This causes ipmbsensor crash
Change-Id: I8517d801ea1598b190c140f317ef29d1bc172ee0
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
diff --git a/include/sensor.hpp b/include/sensor.hpp
index 7fa9300..a8321fd 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -48,7 +48,6 @@
std::shared_ptr<sdbusplus::asio::dbus_interface> availableInterface;
std::shared_ptr<sdbusplus::asio::dbus_interface> operationalInterface;
double value = std::numeric_limits<double>::quiet_NaN();
- double rawValue = std::numeric_limits<double>::quiet_NaN();
bool overriddenState = false;
bool internalSet = false;
double hysteresisTrigger;
diff --git a/src/ADCSensor.cpp b/src/ADCSensor.cpp
index aa7b50e..c3980e0 100644
--- a/src/ADCSensor.cpp
+++ b/src/ADCSensor.cpp
@@ -79,7 +79,6 @@
}
association = objectServer.add_interface(
"/xyz/openbmc_project/sensors/voltage/" + name, association::interface);
-
setInitialProperties(conn);
}
@@ -168,9 +167,11 @@
// todo read scaling factors from configuration
try
{
- rawValue = std::stod(response);
- double nvalue = (rawValue / sensorScaleFactor) / scaleFactor;
+ double nvalue = std::stod(response);
+
+ nvalue = (nvalue / sensorScaleFactor) / scaleFactor;
nvalue = std::round(nvalue * roundFactor) / roundFactor;
+
updateValue(nvalue);
}
catch (std::invalid_argument&)
@@ -192,7 +193,6 @@
int fd = open(path.c_str(), O_RDONLY);
if (fd < 0)
{
- std::cerr << "adcsensor " << name << " failed to open " << path << "\n";
return; // we're no longer valid
}
inputDev.assign(fd);
@@ -201,14 +201,6 @@
std::shared_ptr<ADCSensor> self = weakRef.lock();
if (ec == boost::asio::error::operation_aborted)
{
- if (self)
- {
- std::cerr << "adcsensor " << self->name << " read cancelled\n";
- }
- else
- {
- std::cerr << "adcsensor read cancelled no self\n";
- }
return; // we're being canceled
}
@@ -216,10 +208,6 @@
{
self->setupRead();
}
- else
- {
- std::cerr << "adcsensor weakref no self\n";
- }
});
}
diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp
index 20cfded..127d68a 100644
--- a/src/CPUSensor.cpp
+++ b/src/CPUSensor.cpp
@@ -223,9 +223,9 @@
try
{
std::getline(responseStream, response);
- rawValue = std::stod(response);
+ double nvalue = std::stod(response);
responseStream.clear();
- double nvalue = rawValue / CPUSensor::sensorScaleFactor;
+ nvalue /= CPUSensor::sensorScaleFactor;
if (show)
{
diff --git a/src/HwmonTempSensor.cpp b/src/HwmonTempSensor.cpp
index 35dc5f3..649ca68 100644
--- a/src/HwmonTempSensor.cpp
+++ b/src/HwmonTempSensor.cpp
@@ -106,8 +106,6 @@
if ((err == boost::system::errc::bad_file_descriptor) ||
(err == boost::asio::error::misc_errors::not_found))
{
- std::cerr << "Hwmon temp sensor " << name << " removed " << path
- << "\n";
return; // we're being destroyed
}
std::istream responseStream(&readBuf);
@@ -117,8 +115,8 @@
std::getline(responseStream, response);
try
{
- rawValue = std::stod(response);
- double nvalue = rawValue / sensorScaleFactor;
+ double nvalue = std::stod(response);
+ nvalue /= sensorScaleFactor;
updateValue(nvalue);
}
catch (const std::invalid_argument&)
@@ -136,8 +134,6 @@
int fd = open(path.c_str(), O_RDONLY);
if (fd < 0)
{
- std::cerr << "Hwmon temp sensor " << name << " not valid " << path
- << "\n";
return; // we're no longer valid
}
inputDev.assign(fd);
@@ -147,15 +143,6 @@
std::shared_ptr<HwmonTempSensor> self = weakRef.lock();
if (ec == boost::asio::error::operation_aborted)
{
- if (self)
- {
- std::cerr << "Hwmon temp sensor " << self->name
- << " read cancelled " << self->path << "\n";
- }
- else
- {
- std::cerr << "Hwmon sensor read cancelled, no self\n";
- }
return; // we're being canceled
}
if (self)
diff --git a/src/IpmbSensor.cpp b/src/IpmbSensor.cpp
index 53c0f12..bc9d842 100644
--- a/src/IpmbSensor.cpp
+++ b/src/IpmbSensor.cpp
@@ -241,6 +241,7 @@
return false;
}
resp = data[0];
+
return true;
}
case (ReadingFormat::byte3):
@@ -347,18 +348,6 @@
read();
return;
}
- else
- {
- // rawValue only used in debug logging
- // up to 5th byte in data are used to derive value
- size_t end = std::min(sizeof(uint64_t), data.size());
- uint64_t rawData = 0;
- for (size_t i = 0; i < end; i++)
- {
- reinterpret_cast<uint8_t*>(rawData)[i] = data[i];
- }
- rawValue = static_cast<double>(rawData);
- }
/* Adjust value as per scale and offset */
value = (value * scaleVal) + offsetVal;
diff --git a/src/PSUSensor.cpp b/src/PSUSensor.cpp
index f93846d..6b27207 100644
--- a/src/PSUSensor.cpp
+++ b/src/PSUSensor.cpp
@@ -143,9 +143,9 @@
try
{
std::getline(responseStream, response);
- rawValue = std::stod(response);
+ double nvalue = std::stod(response);
responseStream.clear();
- double nvalue = rawValue / sensorFactor;
+ nvalue /= sensorFactor;
updateValue(nvalue);
}
diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
index acfe659..ba3b0a1 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -149,9 +149,9 @@
try
{
std::getline(responseStream, response);
- rawValue = std::stod(response);
+ double nvalue = std::stod(response);
responseStream.clear();
- updateValue(rawValue);
+ updateValue(nvalue);
}
catch (const std::invalid_argument&)
{
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index 6aa077c..986d183 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -244,7 +244,6 @@
static int cLoFalse = 0;
static int cLoMidstate = 0;
static int cDebugThrottle = 0;
-static constexpr int assertLogCount = 10;
struct ChangeParam
{
@@ -277,12 +276,7 @@
if (value >= threshold.value)
{
thresholdChanges.emplace_back(threshold, true, value);
- if (++cHiTrue < assertLogCount)
- {
- std::cerr << "Sensor " << sensor->name << " high threshold "
- << threshold.value << " assert: value " << value
- << " raw data " << sensor->rawValue << "\n";
- }
+ ++cHiTrue;
}
else if (value < (threshold.value - sensor->hysteresisTrigger))
{
@@ -299,13 +293,7 @@
if (value <= threshold.value)
{
thresholdChanges.emplace_back(threshold, true, value);
- if (++cLoTrue < assertLogCount)
- {
- std::cerr << "Sensor " << sensor->name << " low threshold "
- << threshold.value << " assert: value "
- << sensor->value << " raw data "
- << sensor->rawValue << "\n";
- }
+ ++cLoTrue;
}
else if (value > (threshold.value + sensor->hysteresisTrigger))
{