lib/thread: Start stopwatch after printk

We are currently counting how long it takes to print the waiting
message, in addition to the actual time we spent waiting. This results
in inflating the measurement by 1.7ms when the serial console is
enabled. This CL makes it so the print happens before the stopwatch
starts.

BUG=b:179699789
TEST=No longer see printk time taken into account on serial console

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ib48e37c1b2cb462d634141bf767673936aa2dd26
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58960
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Rob Barnes <robbarnes@google.com>
This commit is contained in:
Raul E Rangel 2021-11-04 15:57:00 -06:00 committed by Raul Rangel
parent 4e9bb3308e
commit fae525f547
1 changed files with 2 additions and 2 deletions

View File

@ -398,10 +398,10 @@ enum cb_err thread_join(struct thread_handle *handle)
if (handle->state == THREAD_UNINITIALIZED) if (handle->state == THREAD_UNINITIALIZED)
return CB_ERR_ARG; return CB_ERR_ARG;
stopwatch_init(&sw);
printk(BIOS_SPEW, "waiting for thread\n"); printk(BIOS_SPEW, "waiting for thread\n");
stopwatch_init(&sw);
while (handle->state != THREAD_DONE) while (handle->state != THREAD_DONE)
assert(thread_yield() == 0); assert(thread_yield() == 0);