Skip to content

Commit 8e05333

Browse files
Andrew Boienashif
authored andcommitted
kernel: init: fix coverage gap
We don't get any coverage past when we dump the coverage data, so exclude the end of the function and move setting the main thread as nonessential to immediately before the coverage dump. The comment was also amended. Signed-off-by: Andrew Boie <[email protected]>
1 parent fe228a8 commit 8e05333

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,12 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
286286

287287
main();
288288

289+
/* Mark nonessenrial since main() has no more work to do */
290+
_main_thread->base.user_options &= ~K_ESSENTIAL;
291+
289292
/* Dump coverage data once the main() has exited. */
290293
gcov_coverage_dump();
291-
292-
/* Terminate thread normally since it has no more work to do */
293-
_main_thread->base.user_options &= ~K_ESSENTIAL;
294-
}
294+
} /* LCOV_EXCL_LINE ... because we just dumped final coverage data */
295295

296296
/* LCOV_EXCL_START */
297297

0 commit comments

Comments
 (0)