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 <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-06-11 12:58:16 -07:00 committed by Anas Nashif
commit 8e053330fe

View file

@ -286,12 +286,12 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
main();
/* Mark nonessenrial since main() has no more work to do */
_main_thread->base.user_options &= ~K_ESSENTIAL;
/* Dump coverage data once the main() has exited. */
gcov_coverage_dump();
/* Terminate thread normally since it has no more work to do */
_main_thread->base.user_options &= ~K_ESSENTIAL;
}
} /* LCOV_EXCL_LINE ... because we just dumped final coverage data */
/* LCOV_EXCL_START */