device: Log times with millisecond resolution
To print times with 1 us resolution just adds unnecessary noise when comparing logs across different boots. Furthermore, just the printk itself is 1 ms if some slow console is enabled. Change-Id: Ibea43124a1937f404a6e71fd9431086b2b72290a Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37425 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
94694a810e
commit
e3d9d67e99
|
@ -903,16 +903,17 @@ static void scan_bus(struct device *busdev)
|
||||||
{
|
{
|
||||||
int do_scan_bus;
|
int do_scan_bus;
|
||||||
struct stopwatch sw;
|
struct stopwatch sw;
|
||||||
|
long scan_time;
|
||||||
stopwatch_init(&sw);
|
|
||||||
|
|
||||||
if (!busdev->enabled)
|
if (!busdev->enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printk(BIOS_SPEW, "%s scanning...\n", dev_path(busdev));
|
printk(BIOS_DEBUG, "%s scanning...\n", dev_path(busdev));
|
||||||
|
|
||||||
post_log_path(busdev);
|
post_log_path(busdev);
|
||||||
|
|
||||||
|
stopwatch_init(&sw);
|
||||||
|
|
||||||
do_scan_bus = 1;
|
do_scan_bus = 1;
|
||||||
while (do_scan_bus) {
|
while (do_scan_bus) {
|
||||||
struct bus *link;
|
struct bus *link;
|
||||||
|
@ -928,8 +929,9 @@ static void scan_bus(struct device *busdev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "%s: scanning of bus %s took %ld usecs\n",
|
scan_time = stopwatch_duration_msecs(&sw);
|
||||||
__func__, dev_path(busdev), stopwatch_duration_usecs(&sw));
|
printk(BIOS_DEBUG, "%s: bus %s finished in %ld msecs\n", __func__,
|
||||||
|
dev_path(busdev), scan_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
void scan_bridges(struct bus *bus)
|
void scan_bridges(struct bus *bus)
|
||||||
|
@ -1116,22 +1118,23 @@ static void init_dev(struct device *dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!dev->initialized && dev->ops && dev->ops->init) {
|
if (!dev->initialized && dev->ops && dev->ops->init) {
|
||||||
#if CONFIG(HAVE_MONOTONIC_TIMER)
|
|
||||||
struct stopwatch sw;
|
struct stopwatch sw;
|
||||||
stopwatch_init(&sw);
|
long init_time;
|
||||||
#endif
|
|
||||||
if (dev->path.type == DEVICE_PATH_I2C) {
|
if (dev->path.type == DEVICE_PATH_I2C) {
|
||||||
printk(BIOS_DEBUG, "smbus: %s[%d]->",
|
printk(BIOS_DEBUG, "smbus: %s[%d]->",
|
||||||
dev_path(dev->bus->dev), dev->bus->link_num);
|
dev_path(dev->bus->dev), dev->bus->link_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "%s init ...\n", dev_path(dev));
|
printk(BIOS_DEBUG, "%s init\n", dev_path(dev));
|
||||||
|
|
||||||
|
stopwatch_init(&sw);
|
||||||
dev->initialized = 1;
|
dev->initialized = 1;
|
||||||
dev->ops->init(dev);
|
dev->ops->init(dev);
|
||||||
#if CONFIG(HAVE_MONOTONIC_TIMER)
|
|
||||||
printk(BIOS_DEBUG, "%s init finished in %ld usecs\n", dev_path(dev),
|
init_time = stopwatch_duration_msecs(&sw);
|
||||||
stopwatch_duration_usecs(&sw));
|
printk(BIOS_DEBUG, "%s init finished in %ld msecs\n", dev_path(dev),
|
||||||
#endif
|
init_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue