[blivet][rhel7-branch] Fix up some logging methods. (#1155984)

Samantha N. Bueno sbueno+anaconda at redhat.com
Wed Jun 10 12:22:07 UTC 2015


On Tue, Jun 09, 2015 at 03:05:49PM -0500, David Lehman wrote:
> On 06/08/2015 07:50 AM, Samantha N. Bueno wrote:
> >(Should be no anaconda changes with this version; old had the subject
> >"Remove a few lookup methods in blivet". This doesn't make custom part
> >with many disks as fast as it was in 7.0, but it helps quite a bit.)
> >
> >Some small adjustments to a couple logging methods to help reduce the
> >verbosity, which can cause some lag when e.g. scanning disks if you have
> >a significant number of them on your system.
> >
> >Resolves: rhbz#1155984
> >---
> >  blivet/devicetree.py | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> >diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> >index 9f1aa9e..73b6f79 100644
> >--- a/blivet/devicetree.py
> >+++ b/blivet/devicetree.py
> >@@ -1111,7 +1111,7 @@ class DeviceTree(object):
> >
> >      def addUdevDevice(self, info):
> >          name = udev.device_get_name(info)
> >-        log_method_call(self, name=name, info=pprint.pformat(info))
> >+        log_method_call(self, name=name)
> 
> Does this give a noticeable speedup? It is going to significantly reduce
> my ability to debug problems using storage.log.

I think this is ok to leave as it was originally. The line below, "got
device: %r" was a much bigger culprit to the slowness.
 
> David
> 
> >          uuid = udev.device_get_uuid(info)
> >          sysfs_path = udev.device_get_sysfs_path(info)
> >
> >@@ -1227,7 +1227,7 @@ class DeviceTree(object):
> >                      if parent.name not in self.exclusiveDisks:
> >                          self.exclusiveDisks.append(parent.name)
> >
> >-        log.info("got device: %r", device)
> >+        log.info("got device: %r", device.name)
> >
> >          # now handle the device's formatting
> >          self.handleUdevDeviceFormat(info, device)
> >@@ -2337,7 +2337,8 @@ class DeviceTree(object):
> >              result = next((d for d in devices if d.name == name or \
> >                 ((d.type == "lvmlv" or d.type == "lvmvg") and d.name == name.replace("--","-"))),
> >                 None)
> >-        log_method_return(self, result)
> >+
> >+        log_method_return(self, getattr(result, "name", None))
> >          return result
> >
> >      def getDeviceByPath(self, path, incomplete=False, hidden=False):
> >
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list