summaryrefslogtreecommitdiffstats
path: root/mainloop.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-10-05 10:36:22 -0500
committerMatt Spinler <spinler@us.ibm.com>2017-10-09 10:22:25 -0500
commit9b65f76daeec9f9783b0a14f61f3889dba0c87e0 (patch)
tree3dc8711503ac057665c9b96aea3c03811468f1ab /mainloop.cpp
parent8a37c4b7b1e990fbf58b79204472f2add6b65841 (diff)
downloadphosphor-hwmon-9b65f76daeec9f9783b0a14f61f3889dba0c87e0.tar.gz
phosphor-hwmon-9b65f76daeec9f9783b0a14f61f3889dba0c87e0.zip
Log the failing sysfs filename
Add the name of the sysfs path an access failed on to the journal when an error log is created. This is useful for debug. An example of the path in the journal metadata is: FILE=/sys/class/hwmon/hwmon7/temp1_input Change-Id: I4bc3548619e561cd3acc95ba3ecc778fb08c7104 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'mainloop.cpp')
-rw-r--r--mainloop.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/mainloop.cpp b/mainloop.cpp
index ead9612..6a8e569 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -199,6 +199,15 @@ auto addValue(const SensorSet::key_type& sensor,
xyz::openbmc_project::Sensor::Device::
ReadFailure::CALLOUT_DEVICE_PATH(devPath.c_str()));
+ auto file = sysfs::make_sysfs_path(
+ ioAccess.path(),
+ sensor.first,
+ sensor.second,
+ hwmon::entry::cinput);
+
+ log<level::INFO>("Logging failing sysfs file",
+ entry("FILE=%s", file.c_str()));
+
return static_cast<std::shared_ptr<ValueObject>>(nullptr);
}
@@ -442,6 +451,16 @@ void MainLoop::run()
xyz::openbmc_project::Sensor::Device::
ReadFailure::CALLOUT_DEVICE_PATH(
_devPath.c_str()));
+
+ auto file = sysfs::make_sysfs_path(
+ ioAccess.path(),
+ i.first.first,
+ i.first.second,
+ hwmon::entry::cinput);
+
+ log<level::INFO>("Logging failing sysfs file",
+ entry("FILE=%s", file.c_str()));
+
#ifdef REMOVE_ON_FAIL
destroy.push_back(i.first);
#else
OpenPOWER on IntegriCloud