wiki:GSoC/2018/coverage_analysis_toolset

Version 8 (modified by shashvat jain, on 12/09/18 at 15:06:39) (diff)

--

An updated wiki page for Coverage Analysis can be found here RTEMS Coverage

Improve Coverage Analysis Toolset

Mentors: Chris Johns, Joel Sherrill, C.P. O'Donnell

Students: Vijay Kumar Banerjee

Progress: The Coverage Analysis is running and generating coverage reports in html and txt format

Blockers: Generating .gcno notes files by changing gcc flags

Development Blog : https://thelunatic.github.io/rtems_gsoc18

Introduction

This project is to improve the tools used to perform the analysis and generate reports. It will convert all the config files to .ini and get the coverage analysis running properly. Then the coverage tools will be integrated with RTEMS Tester . Also gcov reports will be generated and the report generation of the covoar tool will be reworked to give output it some data-centric format.

Project

prerequisites

  • Covoar and rtemstoolkit (C++)
  • RTEMS Tester framework (Python)
  • Understand INI format for config files.
  • Reports (HTML and text currently, add XML)

Running covoar To generate coverage reports

To run covoar we need to run covoar from the RTEMS-KERNEL BUILD directory.

NOTE : The .cov trace files are needed to get coverage reports

covoar -S /home/lunatic/development/rtems/test/rtems-tools/tester/rtems/testing/coverage/leon3-qemu-symbols.ini \
-O coverage/score -E/home/lunatic/development/rtems/test/rtems-tools/tester/rtems/testing/coverage/Explanations.txt \
-p RTEMS-5 sparc-rtems5/c/leon3/testsuites/samples/hello.exe

covoar usage :

Usage: covoar [-v] -T TARGET -f FORMAT [-E EXPLANATIONS] -e EXE_EXTENSION -c COVERAGEFILE_EXTENSION EXECUTABLE1 ... EXECUTABLE2

  -v                        - verbose at initialization
  -T TARGET                 - target name
  -f FORMAT                 - coverage file format (RTEMS, QEMU, TSIM or Skyeye)
  -E EXPLANATIONS           - name of file with explanations
  -s SYMBOL_SET_FILE        - path to the INI format symbol sets
  -1 EXECUTABLE             - name of executable to get symbols from
  -e EXE_EXTENSION          - extension of the executables to analyze
  -c COVERAGEFILE_EXTENSION - extension of the coverage files to analyze
  -g GCNOS_LIST             - name of file with list of *.gcno files
  -p PROJECT_NAME           - name of the project
  -C ConfigurationFileName  - name of configuration file
  -O Output_Directory       - name of output directory (default=.
  -d debug                  - disable cleaning of tempfile

Running RTEMS-TESTER for Coverage analysis

RTEMS-TESTER when run with --coverage option, generates an html coverage analysis report (report.html)

$HOME/development/rtems/test/rtems-tools/tester/rtems-test \
--rtems-tools=$HOME/development/rtems/5 --log=coverage_analysis.log \
--no-clean --coverage=score --rtems-bsp=leon3-qemu-cov \
/home/lunatic/development/rtems/kernel/leon3/sparc-rtems5/c/leon3/testsuites/samples/hello.exe

NOTE : The --no-clean option tells the script not to delete the .cov trace files generated while running the coverage. These Trace files can be used for running covoar directly.

The --coverage option is when included with specific symbol name, it runs coverage analysis for only the mentioned sets. In the above example above, the coverage analysis will run for score only.

To run coverage for all the sets there's no need to pass any argument to --coverage option, by default, it runs coverage analysis for all the sets.

Please visit my development blog to see examples of coverage report

Resources

TBA

References

  • TBD