summaryrefslogtreecommitdiff
path: root/scripts/code_cov_gather_on_test.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@kernel.org>2022-03-16 15:59:55 +0100
committerPetri Latvala <petri.latvala@intel.com>2022-03-21 18:34:59 +0200
commit7eb558a8297ff1ae4f9aaf10ac89d9ddce7ad56c (patch)
tree23af2def2b12b0ccc6f651c8ffea4c56fde38a4d /scripts/code_cov_gather_on_test.py
parent4b88a9253443ecd910a5f4c7bfe624a5f29d35b9 (diff)
runner: Add support for code coverage
The gcc compiler has a feature that enables checking the code coverage in runtime[1]. [1] See https://www.kernel.org/doc/html/latest/dev-tools/gcov.html The Linux Kernel comes with an option to enable such feature: ./scripts/config -e DEBUG_FS -e GCOV_KERNEL The driver's Makefile also needs change to enable it. For instance, in order to enable GCOV for all DRM drivers, one would need to run: for i in $(find drivers/gpu/drm/ -name Makefile); do sed '1 a GCOV_PROFILE := y' -i $i done This patch adds support for it by: a) Implementing a logic to cleanup the code coverage counters via sysfs; b) Calling a script responsible for collecging code coverage data. The implementation works with two modes: 1) It zeroes the counters, run all IGT tests and collects the code coverage results at the end. This implies that no tests would crash the driver, as otherwise the results won't be collected; This is faster, as collecting code coverage data can take several seconds. 2) For each test, it will clean the code coverage counters, run the and collect the results. This is more reliable, as a Kernel crash/OOPS won't affect the results of the previously ran tests. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'scripts/code_cov_gather_on_test.py')
0 files changed, 0 insertions, 0 deletions