Kyösti Mälkki submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved Marshall Dawson: Looks good to me, approved Angel Pons: Looks good to me, approved
boot_state: Reduce precision 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. Reduce the logged precision to
milliseconds to avoid that.

Change-Id: I7a27d6c250d8432131f30e9a4869cb45ad75d9fd
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36528
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
---
M src/lib/hardwaremain.c
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 2ff2b8c..51ff330 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 precision to reduce log diffs. */
+ entry_time = DIV_ROUND_CLOSEST(entry_time, USECS_PER_MSEC);
+ run_time = DIV_ROUND_CLOSEST(run_time, USECS_PER_MSEC);
+ exit_time = DIV_ROUND_CLOSEST(exit_time, USECS_PER_MSEC);
+
+ printk(BIOS_DEBUG, "BS: %s times (ms): entry %ld run %ld exit %ld\n",
state->name, entry_time, run_time, exit_time);
}
#else

To view, visit change 36528. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7a27d6c250d8432131f30e9a4869cb45ad75d9fd
Gerrit-Change-Number: 36528
Gerrit-PatchSet: 8
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged