dbus-sdr: Remove excessive `Failed to GetAll` error message

The `Failed to GetAll` message will happen if any of the sensor doesn't
have `Inventory.Decorator.Ipmi` dbus interface. Instead of making a
`GetAll` call to all sensors, we will check if the sensor have the
interface first before requesting it. This will remove the need to
attempt sigificantly amount of unnecessary dbus calls.

Tested:
ipmitool sdr return the same sensor as before, but with no excessive
error message.

There is also some performance gain after removing the extra dbus calls.

Before,
```
$ time ipmitool sdr | wc -l
346

real    0m13.786s
user    0m0.315s
sys     0m0.115s

$ time ipmitool sdr | wc -l
346

real    0m14.692s
user    0m0.274s
sys     0m0.196s
```

After,
```
$ time ipmitool sdr | wc -l
346

real    0m11.765s
user    0m0.205s
sys     0m0.155s

$ time ipmitool sdr | wc -l
346

real    0m11.403s
user    0m0.269s
sys     0m0.141s
```

Change-Id: Ieab19fbae9e1fb40c2cfac9cd584cf40dba3f500
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/include/dbus-sdr/sdrutils.hpp b/include/dbus-sdr/sdrutils.hpp
index c4b7cfa..c129876 100644
--- a/include/dbus-sdr/sdrutils.hpp
+++ b/include/dbus-sdr/sdrutils.hpp
@@ -24,9 +24,11 @@
 #include <ipmid/api.hpp>
 #include <ipmid/types.hpp>
 #include <map>
+#include <optional>
 #include <phosphor-logging/log.hpp>
 #include <sdbusplus/bus/match.hpp>
 #include <string>
+#include <unordered_set>
 #include <vector>
 
 #pragma once
@@ -370,11 +372,16 @@
 std::map<std::string, Value> getEntityManagerProperties(const char* path,
                                                         const char* interface);
 
+std::optional<std::unordered_set<std::string>>&
+    getIpmiDecoratorPaths(const std::optional<ipmi::Context::ptr>& ctx);
+
 const std::string* getSensorConfigurationInterface(
     const std::map<std::string, std::vector<std::string>>&
         sensorInterfacesResponse);
 
-void updateIpmiFromAssociation(const std::string& path,
-                               const DbusInterfaceMap& sensorMap,
-                               uint8_t& entityId, uint8_t& entityInstance);
+void updateIpmiFromAssociation(
+    const std::string& path,
+    const std::unordered_set<std::string>& ipmiDecoratorPaths,
+    const DbusInterfaceMap& sensorMap, uint8_t& entityId,
+    uint8_t& entityInstance);
 } // namespace ipmi