SPRUI04F july 2015 – april 2023
In this phase, the compiler is invoked with the --use_profile_info=file.prf option, which indicates that the compiler should read the specified PRF file generated in phase 1. The application must also be compiled with either the --codecov or --onlycodecov option; the compiler generates a code-coverage info file. The --codecov option directs the compiler to continue compilation after generating code-coverage information, while the --onlycodecov option stops the compiler after generating code-coverage data. For example:
cl6x --opt_level=2 --use_profile_info=pprofout.prf --onlycodecov foo.c
You can specify two environment variables to control the destination of the code-coverage information file.
If the code-coverage data file already exists, the compiler appends the new dataset at the end of the file.
Code-coverage data is a comma-separated list of data items that can be conveniently handled by data-processing tools and scripting languages. The following is the format of code-coverage data:
"filename-with-full-path","funcname",line#,column#,exec-frequency,"comments"
"filename-with-full-path" | Full pathname of the file corresponding to the entry |
"funcname" | Name of the function |
line# | Line number of the source line corresponding to frequency data |
column# | Column number of the source line |
exec-frequency | Execution frequency of the line |
"comments" | Intermediate-level representation of the source-code generated by the parser |
The full filename, function name, and comments appear within quotation marks ("). For example:
Other tools, such as a spreadsheet program, can be used to format and view the code coverage data. |