diff options
author | Raul E Rangel <rrangel@chromium.org> | 2021-11-04 15:57:00 -0600 |
---|---|---|
committer | Raul Rangel <rrangel@chromium.org> | 2021-11-10 21:17:28 +0000 |
commit | fae525f5477d4c6f0a1149232bf542e471f400c0 (patch) | |
tree | 8b13a29f667da09ab9ee462294ae5d2d578e42cf | |
parent | 4e9bb3308e811000eb089be6b03658e4cb9a4717 (diff) |
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>
-rw-r--r-- | src/lib/thread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/thread.c b/src/lib/thread.c index 7d5cdc5b8e..0393ca7db0 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -398,10 +398,10 @@ enum cb_err thread_join(struct thread_handle *handle) if (handle->state == THREAD_UNINITIALIZED) return CB_ERR_ARG; - stopwatch_init(&sw); - printk(BIOS_SPEW, "waiting for thread\n"); + stopwatch_init(&sw); + while (handle->state != THREAD_DONE) assert(thread_yield() == 0); |