Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36528 )
Change subject: boot_state: Reduce accuracy of reported times ......................................................................
boot_state: Reduce accuracy of reported times
When diffing boot logs, lines reporting times spent in each boot_state always get highlighed due the little fluctuation in microsecond-scale. Recude the logged resolution to milliseconds to avoid that.
Change-Id: I7a27d6c250d8432131f30e9a4869cb45ad75d9fd Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/lib/hardwaremain.c 1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/36528/1
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index 2ff2b8c..5967052 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -23,6 +23,7 @@ #include <bootstate.h> #include <console/console.h> #include <console/post_codes.h> +#include <commonlib/helpers.h> #include <cbmem.h> #include <version.h> #include <device/device.h> @@ -256,7 +257,12 @@ run_time = mono_time_diff_microseconds(&samples[1], &samples[2]); exit_time = mono_time_diff_microseconds(&samples[2], &samples[3]);
- printk(BIOS_DEBUG, "BS: %s times (us): entry %ld run %ld exit %ld\n", + /* Report with millisecond accuracy to reduce log diffs. */ + entry_time = DIV_ROUND_CLOSEST(entry_time, 1000); + run_time = DIV_ROUND_CLOSEST(run_time, 1000); + exit_time = DIV_ROUND_CLOSEST(exit_time, 1000); + + printk(BIOS_DEBUG, "BS: %s times (ms): entry %ld run %ld exit %ld\n", state->name, entry_time, run_time, exit_time); } #else