libmultipath: add debug messages to hwentry lookup/merging code
authorMartin Wilck <mwilck@suse.com>
Fri, 8 Jun 2018 10:20:24 +0000 (12:20 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 21 Jun 2018 07:38:56 +0000 (09:38 +0200)
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/config.c

index 6e01455..7123da8 100644 (file)
@@ -103,6 +103,16 @@ out:
        return retval;
 }
 
+static void _log_match(const char *fn, const struct hwentry *h,
+                      const char *vendor, const char *product,
+                      const char *revision)
+{
+       condlog(4, "%s: found match /%s:%s:%s/ for '%s:%s:%s'", fn,
+               h->vendor, h->product, h->revision,
+               vendor, product, revision);
+}
+#define log_match(h, v, p, r) _log_match(__func__, (h), (v), (p), (r))
+
 struct hwentry *
 find_hwe (const struct _vector *hwtable,
          const char * vendor, const char * product, const char * revision)
@@ -120,6 +130,7 @@ find_hwe (const struct _vector *hwtable,
                if (hwe_regmatch(tmp, vendor, product, revision))
                        continue;
                ret = tmp;
+               log_match(tmp, vendor, product, revision);
                break;
        }
        return ret;
@@ -458,8 +469,13 @@ restart:
                                         hwe2->product, hwe2->revision))
                                continue;
                        /* dup */
+                       log_match(hwe1, hwe2->vendor,
+                                 hwe2->product, hwe2->revision);
                        merge_hwe(hwe2, hwe1);
                        if (hwe_strmatch(hwe2, hwe1) == 0) {
+                               condlog(4, "%s: removing hwentry %s:%s:%s",
+                                       __func__, hwe1->vendor, hwe1->product,
+                                       hwe1->revision);
                                vector_del_slot(hw, i);
                                free_hwe(hwe1);
                                n -= 1;