summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-04-30 15:41:13 -0500
committerRonald G. Minnich <rminnich@gmail.com>2013-05-01 21:36:16 +0200
commit052942923b2320ee9cb2a1bcc2d2689c179ad4f5 (patch)
tree53f740d53f8a8bcda09439bc4ca472851f5e9683 /src/device
parentc0466d46b7ea511f102eb6e57da59d95bf4ef95f (diff)
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@chromium.org> Reviewed-on: http://review.coreboot.org/3162 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/device/device.c b/src/device/device.c
index e0c8bf0523..a971270eba 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
}
}