[coreboot-gerrit] Patch set updated for coreboot: 376ee09 device tree: track init times

Aaron Durbin (adurbin@google.com) gerrit at coreboot.org
Wed May 1 18:57:06 CEST 2013


Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3162

-gerrit

commit 376ee090d8b05b5f7578668242be994df700e544
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Tue Apr 30 15:41:13 2013 -0500

    device tree: track init times
    
    With the introduction of a monotonic timer it is possible to
    track the individual times of each device's init() call. Add this
    ability behind a HAVE_MONOTONIC_TIMER option.
    
    Example log messages:
    Root Device init 5 usecs
    CPU_CLUSTER: 0 init 66004 usecs
    PCI: 00:00.0 init 1020 usecs
    PCI: 00:02.0 init 456941 usecs
    PCI: 00:13.0 init 3 usecs
    PCI: 00:14.0 init 3 usecs
    PCI: 00:15.0 init 92 usecs
    PCI: 00:15.1 init 37 usecs
    PCI: 00:15.2 init 36 usecs
    PCI: 00:15.3 init 35 usecs
    PCI: 00:15.4 init 35 usecs
    PCI: 00:15.5 init 36 usecs
    PCI: 00:15.6 init 35 usecs
    PCI: 00:16.0 init 3666 usecs
    PCI: 00:17.0 init 63 usecs
    PCI: 00:1b.0 init 3 usecs
    PCI: 00:1c.0 init 89 usecs
    PCI: 00:1c.1 init 15 usecs
    PCI: 00:1c.2 init 15 usecs
    PCI: 00:1c.3 init 15 usecs
    PCI: 00:1c.4 init 15 usecs
    PCI: 00:1c.5 init 16 usecs
    PCI: 00:1d.0 init 4 usecs
    PCI: 00:1f.0 init 495 usecs
    PCI: 00:1f.2 init 29 usecs
    PCI: 00:1f.3 init 4 usecs
    PCI: 00:1f.6 init 4 usecs
    
    Change-Id: Ibe499848432c7ab20166ab10d6dfb07db03eab01
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 src/device/device.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/device/device.c b/src/device/device.c
index e0c8bf0..a971270 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -43,6 +43,7 @@
 #if CONFIG_ARCH_X86
 #include <arch/ebda.h>
 #endif
+#include <timer.h>
 
 /** Linked list of ALL devices */
 struct device *all_devices = &dev_root;
@@ -1103,6 +1104,12 @@ static void init_dev(struct device *dev)
 		return;
 
 	if (!dev->initialized && dev->ops && dev->ops->init) {
+#if CONFIG_HAVE_MONOTONIC_TIMER
+		struct mono_time start_time;
+		struct rela_time dev_init_time;
+
+		timer_monotonic_get(&start_time);
+#endif
 		if (dev->path.type == DEVICE_PATH_I2C) {
 			printk(BIOS_DEBUG, "smbus: %s[%d]->",
 			       dev_path(dev->bus->dev), dev->bus->link_num);
@@ -1111,6 +1118,11 @@ static void init_dev(struct device *dev)
 		printk(BIOS_DEBUG, "%s init\n", dev_path(dev));
 		dev->initialized = 1;
 		dev->ops->init(dev);
+#if CONFIG_HAVE_MONOTONIC_TIMER
+		dev_init_time = current_time_from(&start_time);
+		printk(BIOS_DEBUG, "%s init %ld usecs\n", dev_path(dev),
+		       rela_time_in_microseconds(&dev_init_time));
+#endif
 	}
 }
 



More information about the coreboot-gerrit mailing list