-
Notifications
You must be signed in to change notification settings - Fork 2
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
Introduce lib-embedded-gcov #1
base: staging
Are you sure you want to change the base?
Introduce lib-embedded-gcov #1
Conversation
Makefile.uk
Outdated
endif | ||
|
||
LIBEMBEDDEDGCOV_CFLAGS-$(CONFIG_LIBEMBEDDEDGCOV_OUTPUT_SERIAL_HEXDUMP) += -DGCOV_OPT_OUTPUT_SERIAL_HEXDUMP | ||
LIBEMBEDDEDGCOV_CFLAGS-$(CONFIG_LIBEMBEDDEDGCOV_OUTPUT_SERIAL_HEXDUMP) += -Dgcov_printf=printf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gcov_printf function is not only used when the CONFIG_LIBEMBEDDEDGCOV_OUTPUT_SERIAL_HEXDUMP
option is set, but also when the GCOV_OPT_PRINT_STATUS
option is set. This can be seen in the original embedded-gcov code where the gcov_printf function is used when either of these options is defined. This means that even if the user selects a memory output, they may still want to see console information about the gcov run.
#if defined(GCOV_OPT_PRINT_STATUS) || defined(GCOV_OPT_OUTPUT_SERIAL_HEXDUMP)
GCOV_PRINT_STR("Gcov End");
GCOV_PRINT_STR("\n");
#endif
LIBEMBEDDEDGCOV_CFLAGS-$(CONFIG_LIBEMBEDDEDGCOV_OUTPUT_SERIAL_HEXDUMP) += -Dgcov_printf=printf | |
LIBEMBEDDEDGCOV_CFLAGS-y += -Dgcov_printf=printf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated 👍🏼
0841962
to
e17069f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Delia Pavel [email protected]
@michpappas, @Starnox, I get the error below when testing
|
OK, that error appears when selecting Also, I'm running the commands above, and when running the processing scripts, I get: $ ../../libs/embedded-gcov/scripts/gcov_process.sh build/ serial.log
Capturing coverage data from ../objs/
Found gcov version: 7.5.0
Scanning ../objs/ for .gcno files ...
Found 68 graph files in ../objs/
Processing objs/print.gcno
geninfo: WARNING: /media/razvan/c4f6765a-efa5-4ebd-9cf0-7da9908a0189/razvan/unikraft/scripts/workdir/apps/app-helloworld/build/libembeddedgcov/origin/objs/print.gcno: Overlong record
at end of file!
Processing objs/__secs_to_tm.gcno
geninfo: WARNING: /media/razvan/c4f6765a-efa5-4ebd-9cf0-7da9908a0189/razvan/unikraft/scripts/workdir/apps/app-helloworld/build/libembeddedgcov/origin/objs/__secs_to_tm.gcno: Overlong
record at end of file!
Processing objs/ctx.isr.gcno
geninfo: WARNING: /media/razvan/c4f6765a-efa5-4ebd-9cf0-7da9908a0189/razvan/unikraft/scripts/workdir/apps/app-helloworld/build/libembeddedgcov/origin/objs/ctx.isr.gcno: Overlong record at end of file!
Processing objs/gcov_printf.gcno
geninfo: ERROR: /media/razvan/c4f6765a-efa5-4ebd-9cf0-7da9908a0189/razvan/unikraft/scripts/workdir/apps/app-helloworld/build/libembeddedgcov/origin/objs/gcov_printf.gcno: reached unexpected end of file Any clue what might be causing this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments.
README.md
Outdated
|
||
## Collecting Coverage Results | ||
|
||
embedded-gcov provides three types of output: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
embedded-gcov provides three types of output: | |
`lib-embedded-gcov` provides three types of output: | |
README.md
Outdated
The console output then needs to be processed into an lcov report. `lib-embedded-gcov` provides the `gcov_process.sh` script for that, which is essentially a wrapper around the tools provided by `embedded-gcov`. | ||
|
||
Before executing the script make sure you have the required dependencies installed, that is: | ||
- dox2unix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- dox2unix | |
- `dos2unix` |
README.md
Outdated
|
||
Before executing the script make sure you have the required dependencies installed, that is: | ||
- dox2unix | ||
- lcov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- lcov | |
- `lcov` |
README.md
Outdated
|
||
With dependencies installed, execute the script as: | ||
``` | ||
lib-embedded-gcov/scripts/gcov_process.sh <build_directory> <console_log> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a concrete run sample, it's easier to know what your command should look like.
``` | ||
|
||
The script will generate an lcov report and provide a link as shown below. | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three backticks are here by mistake, right?
README.md
Outdated
|
||
To obtain coverage results via the console you need to dump the console output into a file. With QEMU this is possible by configuring the serial device to log all output into a file: | ||
``` | ||
-chardev stdio,id=char0,logfile=serial.log,signal=off -serial chardev:char0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a concrete run sample, it's easier to know what your command should look like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also mention NOT using -nographic
because that clashes with the redirection of standard output.
README.md
Outdated
|
||
lcov report in file:///home/mpp/devel/unikraft_oss/uk_embedded-gcov/app-helloworld/build/libembeddedgcov/origin/results/html/index.html | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why empty line?
Port of embedded-gcov[1] for Unikraft. This patch only provides support for serial console output. [1] https://github.com/nasa-jpl/embedded-gcov Signed-off-by: Michalis Pappas <[email protected]>
e17069f
to
81ef7ed
Compare
@razvand thanks for that. As you pointed out it happens if you enable Please notice that even with that patch the build will fail with:
This is normal behavior, as with this option you need to provide |
@razvand |
Port of embedded-gcov[1] for Unikraft.
[1] https://github.com/nasa-jpl/embedded-gcov