Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58960 )
Change subject: lib/thread: Start stopwatch after printk ......................................................................
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 --- M src/lib/thread.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/58960/1
diff --git a/src/lib/thread.c b/src/lib/thread.c index 7d5cdc5..0393ca7 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -398,10 +398,10 @@ 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);