Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
7568 Discussions

Codecoverage for FlexRAN V21.03 for SDK

Purnachandra
Beginner
245 Views

Hi,

we are planning to calculate the code coverage for intel FlexRAN code v21.03 using the codecov tool provided by intel.

URL is appended below for your reference.

https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-refer...

I have followed the above URL to get the code coverage for SDK but no luck.

Any support on this?

0 Kudos
2 Replies
Viet_H_Intel
Moderator
218 Views

Hi,

 

Here are steps:

 

1) Compile with -profgen=srcpos, you will see the pgopti.spi (static profile information) file gets generated (Note: if you have lot of source files under different directories, then you need to compile with both -profgen=srcpos -prof-dir /tmp/dir_you_want_all_profiled_data_to_reside, or set the ENV variable "export PROF_DIR= /tmp/some_dir"). This way, all your .spi, .dyn and dpi files will be under one place.

 

$ icc -prof-gen=srcpos temp.c 

$ ls -lt pgopti*

-rw-r--r-- 1 users 790 Oct 12 13:40 pgopti.spi

-rw-r--r-- 1 users  0 Oct 12 13:40 pgopti.spl

 

2) Then run your workloads to get dynamic information (.dyn)

$ ./a.out

 

$ ls -lt pgopti* *dyn

-rw-r--r-- 1 users 736 Oct 12 13:40 6165f2d1_23668.dyn

-rw-r--r-- 1 users 736 Oct 12 13:40 6165f2ca_23664.dyn

 

3) Use profmerge tool to merge all *dyn files into 1 pgopti.dpi (dynamic profiled information) file.

$ profmerge *dyn

$ ls -lt pgopti* 

-rw-r--r-- 1 users 1808 Oct 12 13:41 pgopti.dpi

 

4) use codecov [options] 

 

$ codecov -prj myProject -spi pgopti.spi -dpi pgopti.dpi

 

By default, the code coverage tool generates a single HTML file (CODE_COVERAGE.HTML) and a subdirectory (CodeCoverage) in the current directory. Use any web browser to see the coverages.

 

Let us know more details which issues you have encountered. 

 

 

Viet_H_Intel
Moderator
56 Views

I assume that I've answered your questions. Thus, I am going to close this thread.

If you need more assistants from us, please create a new thread.


Thanks,



Reply