psu-ng: Continue reading after readFail

Update the PMBus::read() function to allow for not creating journal
trace and elog, but default to continuing to trace and elog, the
previous behavior.

If we reach the limit of read failures that results in a communication
error log, continue to read, but stop logging failures.

If communication restores, we may be able to detect what caused the read
failure, or otherwise detect or clear new faults.

Change-Id: If59b86211ab54c31248ede78f8f117b607298923
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/pmbus.hpp b/pmbus.hpp
index 4fd2880..d0fe747 100644
--- a/pmbus.hpp
+++ b/pmbus.hpp
@@ -165,7 +165,8 @@
   public:
     virtual ~PMBusBase() = default;
 
-    virtual uint64_t read(const std::string& name, Type type) = 0;
+    virtual uint64_t read(const std::string& name, Type type,
+                          bool errTrace = true) = 0;
     virtual std::string readString(const std::string& name, Type type) = 0;
     virtual void writeBinary(const std::string& name, std::vector<uint8_t> data,
                              Type type) = 0;
@@ -285,10 +286,12 @@
      *
      * @param[in] name   - path concatenated to basePath to read
      * @param[in] type   - Path type
+     * @param[in] errTrace - true to enable tracing error (defaults to true)
      *
      * @return uint64_t - Up to 8 bytes of data read from file.
      */
-    uint64_t read(const std::string& name, Type type) override;
+    uint64_t read(const std::string& name, Type type,
+                  bool errTrace = true) override;
 
     /**
      * Read a string from file in sysfs.