Improve sensor tree handling in sdrutils.hpp

This change adds a bimap of sensor number to path to improve
lookup of both types.

Also, with the current implementation each time a sensor number is
requested, the sensor tree must be retrieved from dbus and
parsed.  This is fairly expensive and mostly unnecessary
because the sensor tree doesn't change often.

To help improve performance, this change also caches the sensor
tree and number mapping so requests can be returned quickly.
The sensor tree cache is cleared whenever a sensor interface
is added or removed.  Regenerating the sensor tree cache
causes the sensor number map cache to also be regenerated so
both contain the latest sensor information.

Tested: Manually added SEL events to verify that they are
mapped to the correct sensors.

'ipmitool sel list' command with 105 SEL entries improved from
8.25 seconds to 1.50 seconds.

Change-Id: I0366e41985c980cbfa28f66a2a979f30ab98141a
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
1 file changed