diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2018-01-19 17:28:18 -0600 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2018-03-12 10:29:43 -0500 |
commit | c72b891193f15622de56f086311ef494cda046ea (patch) | |
tree | 51ac967ef30cf866a344aff60586215b591e548d | |
parent | 5a796e6683a3c8dba6be5d72ef7f7d4d8cdbfcae (diff) | |
download | phosphor-fan-presence-c72b891193f15622de56f086311ef494cda046ea.tar.gz phosphor-fan-presence-c72b891193f15622de56f086311ef494cda046ea.zip |
Minimize service name mapper lookups
Retrieve the service names from the cached dataset within the zone for a
path and interface, updating the cache when not found. This is used when
initializing property values and service name owners.
Additional performance enhancements to use `GetSubTree` prior to
processing a set speed event will be included under
openbmc/openbmc#2911. This will keep unnecessary `GetSubTree` lookups
from occurring for paths/interfaces that don't exist to further improve
upon initializing properties fan control is defined to use.
Tested:
First path updates service name cache for all paths sharing the same
interface
First missing interface on a path updates service name cache for all
paths sharing that interface
Verify mapper lookups for X number of paths sharing the same
interface is reduced to (X-(X-1))
NameOwnerChanged events read/update the same set of service name
cache
Change-Id: Ia235b36ba5ae8cda38342d7521f3d87080c2970a
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
-rw-r--r-- | control/functor.hpp | 6 | ||||
-rw-r--r-- | control/zone.cpp | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/control/functor.hpp b/control/functor.hpp index 06e8db9..8e85fcb 100644 --- a/control/functor.hpp +++ b/control/functor.hpp @@ -107,7 +107,9 @@ struct PropertyChanged { try { + auto service = zone.getService(_path, _iface); auto val = util::SDBusPlus::getProperty<T>(bus, + service, _path, _iface, _property); @@ -306,9 +308,7 @@ struct NameOwnerChanged try { // Initialize NameOwnerChanged data store with service name - name = util::SDBusPlus::getService(bus, - _path, - _iface); + name = zone.getService(_path, _iface); hasOwner = util::SDBusPlus::callMethodAndRead<bool>( bus, "org.freedesktop.DBus", diff --git a/control/zone.cpp b/control/zone.cpp index 41ee0cc..325a5b8 100644 --- a/control/zone.cpp +++ b/control/zone.cpp @@ -186,10 +186,8 @@ void Zone::setServices(const Group* group) bool hasOwner = false; try { - name = util::SDBusPlus::getService( - _bus, - it->first, - std::get<intfPos>(it->second)); + name = getService(it->first, + std::get<intfPos>(it->second)); hasOwner = util::SDBusPlus::callMethodAndRead<bool>( _bus, "org.freedesktop.DBus", |