Commit 0124043
contest: vm: capture code coverage
Code coverage is a valuable info to get to know how much we can trust a test suite, and easily find out what needs to be improved.
It is quite easy to get such info with the kernel:
- The kernel needs to be compiled with GCOV_KERNEL=y, and have either
GCOV_PROFILE_ALL=y, or GCOV_PROFILE := y set in the Makefiles. The
recommended way is to add 'GCOV_PROFILE' in net/Makefile and
drivers/net/Makefile.
- Before stopping the VM, the LCOV file can be captured using the 'lcov'
tool, version >= 2.0 is recommended.
- 'genhtml' from the LCOV project can be used later to generate an HTML
version using all the .lcov files. It could be done per LCOV file, but
that will then only show the coverage per VM, not the global one.
This GCOV support is disabled by default. It can be enabled via
'vm.gcov=on'. I suggest to keep it off by default, and switch it to on
later when everything is in place.
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>1 parent 3855a91 commit 0124043
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
108 | | - | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
203 | 208 | | |
204 | 209 | | |
205 | 210 | | |
| 211 | + | |
206 | 212 | | |
207 | 213 | | |
208 | 214 | | |
| |||
387 | 393 | | |
388 | 394 | | |
389 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
390 | 408 | | |
391 | 409 | | |
392 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| |||
0 commit comments