-
Notifications
You must be signed in to change notification settings - Fork 8k
use semihosting for collecting coverage data #94079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nashif
wants to merge
6
commits into
zephyrproject-rtos:main
Choose a base branch
from
nashif:topic/coverage/semihosting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7bccafe
testsuite: coverage: Support semihosting
nashif 9cc4072
testsuite: split coverage kconfig into own file
nashif 6797bcd
tests: workqueue: increase stacks to allow coverage
nashif 741f14b
tests: increase stack sizes to support coverage
nashif 98ff5e0
kernel: set DYNAMIC_THREAD_STACK_SIZE to 4096 for coverage
nashif 9fa6eb8
tests: increase stacks to allow coverage
nashif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright The Zephyr Project Contributors | ||
# | ||
menu "Coverage" | ||
|
||
config HAS_COVERAGE_SUPPORT | ||
bool | ||
help | ||
The code coverage report generation is only available on boards | ||
with enough spare RAM to buffer the coverage data, or on boards | ||
based on the POSIX ARCH. | ||
|
||
config COVERAGE | ||
bool "Create coverage data" | ||
depends on HAS_COVERAGE_SUPPORT | ||
help | ||
This option will build your application with the -coverage option | ||
which will generate data that can be used to create coverage reports. | ||
For more information see | ||
https://docs.zephyrproject.org/latest/guides/coverage.html | ||
|
||
choice | ||
prompt "Coverage mode" | ||
default COVERAGE_NATIVE_GCOV if NATIVE_BUILD | ||
default COVERAGE_GCOV if !NATIVE_BUILD | ||
depends on COVERAGE | ||
|
||
config COVERAGE_NATIVE_GCOV | ||
bool "Host compiler gcov based code coverage" | ||
depends on NATIVE_BUILD | ||
help | ||
Build natively with the compiler standard `--coverage` options, | ||
that is with gcov/GCC-compatible coverage | ||
|
||
config COVERAGE_NATIVE_SOURCE | ||
bool "Host compiler source based code coverage" | ||
depends on NATIVE_BUILD | ||
depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm" | ||
help | ||
Build natively with the compiler source based coverage options. | ||
Today this is only supported with LLVM | ||
|
||
config COVERAGE_GCOV | ||
bool "Create Coverage data from hardware platform" | ||
depends on !NATIVE_BUILD | ||
help | ||
This option will select the custom gcov library. The reports will | ||
be available over serial. This serial dump can be passed to | ||
gen_gcov_files.py which creates the required .gcda files. These | ||
can be read by gcov utility. For more details see gcovr.com . | ||
|
||
endchoice | ||
|
||
config COVERAGE_GCOV_HEAP_SIZE | ||
int "Size of heap allocated for gcov coverage data dump" | ||
depends on COVERAGE_GCOV | ||
default 32768 if X86 || SOC_SERIES_MPS2 | ||
default 16384 | ||
help | ||
This option configures the heap size allocated for gcov coverage | ||
data to be dumped over serial. If the value is 0, no buffer will be used, | ||
data will be dumped directly over serial. | ||
|
||
choice COVERAGE_DUMP_METHOD | ||
prompt "Method to dump coverage data" | ||
default COVERAGE_DUMP | ||
|
||
config COVERAGE_DUMP | ||
bool "Dump coverage data to console on exit" | ||
help | ||
Dump collected coverage information to console on exit. | ||
|
||
config COVERAGE_SEMIHOST | ||
bool "Use semihosting to write coverage data" | ||
depends on SEMIHOST | ||
help | ||
Use semihosting to write coverage data to a file on the host. | ||
|
||
endchoice | ||
|
||
config FORCE_COVERAGE | ||
bool "Force coverage" | ||
select HAS_COVERAGE_SUPPORT | ||
help | ||
Regardless of platform support, it will enable coverage data production. | ||
If the platform does not support coverage by default, setting this config | ||
does not guarantee that coverage data will be gathered. | ||
Application may not fit memory or crash at runtime. | ||
|
||
config COVERAGE_DUMP_PATH_EXCLUDE | ||
string "Exclude files matching this pattern from the coverage data" | ||
default "" | ||
help | ||
Filenames are matched against the pattern using the POSIX fnmatch | ||
function. Filenames are based on their path in the build folder, not the | ||
original source tree. The empty string "" disables the pattern | ||
matching. | ||
|
||
endmenu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.