summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/hardwaremain.c8
-rw-r--r--src/lib/prog_loaders.c4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 51ff330d84..3fcf8829f3 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -63,6 +63,7 @@ static boot_state_t bs_payload_boot(void *arg);
struct boot_state_times {
int num_samples;
struct mono_time samples[MAX_TIME_SAMPLES];
+ long console_usecs[MAX_TIME_SAMPLES];
};
/* The prologue (BS_ON_ENTRY) and epilogue (BS_ON_EXIT) of a state can be
@@ -241,6 +242,9 @@ static void bs_sample_time(struct boot_state *state)
{
struct mono_time *mt;
+ long console_usecs = console_time_get_and_reset();
+ state->times.console_usecs[state->times.num_samples] = console_usecs;
+
mt = &state->times.samples[state->times.num_samples];
timer_monotonic_get(mt);
state->times.num_samples++;
@@ -257,6 +261,10 @@ static void bs_report_time(struct boot_state *state)
run_time = mono_time_diff_microseconds(&samples[1], &samples[2]);
exit_time = mono_time_diff_microseconds(&samples[2], &samples[3]);
+ entry_time -= state->times.console_usecs[1];
+ run_time -= state->times.console_usecs[2];
+ exit_time -= state->times.console_usecs[3];
+
/* 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);
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index 72c1de1e34..43f4689940 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -72,6 +72,8 @@ void run_romstage(void)
timestamp_add_now(TS_END_COPYROM);
+ console_time_report();
+
prog_run(&romstage);
fail:
@@ -155,6 +157,8 @@ void run_ramstage(void)
timestamp_add_now(TS_END_COPYRAM);
+ console_time_report();
+
/* This overrides the arg fetched from the relocatable module */
prog_set_arg(&ramstage, cbmem_top());