PCI: Report quirk timings with pci_info() instead of pr_debug()
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 14 Mar 2018 12:42:56 +0000 (07:42 -0500)
committerBjorn Helgaas <helgaas@kernel.org>
Mon, 19 Mar 2018 18:08:38 +0000 (13:08 -0500)
With "initcall_debug", we report how long every PCI quirk took.  Previously
we used pr_debug(), which means you have to figure out how to enable debug
output.

Log these timings using pci_info() instead so it doesn't depend on DEBUG,
CONFIG_DYNAMIC_DEBUG, etc.

Also, don't log anything at all unless "initcall_debug" is specified.  This
matches what we do in do_one_initcall_debug().

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/quirks.c

index fc734014206fb0845e9d6549e2b7b554f8845919..4c6825fc8b0f4645a78fc08f256a1e7c1cd93c16 100644 (file)
@@ -3106,10 +3106,8 @@ static ktime_t fixup_debug_start(struct pci_dev *dev,
 {
        ktime_t calltime = 0;
 
 {
        ktime_t calltime = 0;
 
-       pci_dbg(dev, "calling %pF\n", fn);
        if (initcall_debug) {
        if (initcall_debug) {
-               pr_debug("calling  %pF @ %i for %s\n",
-                        fn, task_pid_nr(current), dev_name(&dev->dev));
+               pci_info(dev, "calling  %pF @ %i\n", fn, task_pid_nr(current));
                calltime = ktime_get();
        }
 
                calltime = ktime_get();
        }
 
@@ -3126,8 +3124,7 @@ static void fixup_debug_report(struct pci_dev *dev, ktime_t calltime,
                rettime = ktime_get();
                delta = ktime_sub(rettime, calltime);
                duration = (unsigned long long) ktime_to_ns(delta) >> 10;
                rettime = ktime_get();
                delta = ktime_sub(rettime, calltime);
                duration = (unsigned long long) ktime_to_ns(delta) >> 10;
-               pr_debug("pci fixup %pF returned after %lld usecs for %s\n",
-                        fn, duration, dev_name(&dev->dev));
+               pci_info(dev, "%pF took %lld usecs\n", fn, duration);
        }
 }
 
        }
 }