Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Rhys_Ulerich
New Contributor I
123 Views

codecov: how to 1) disable a namespace in output, 2) merge .spi files ?

Jump to solution
Two questions on the use of code coverage for icc/icpc 10:

  1. How can I exclude an entire namespace of functions from appearing in the coverage report? E.g. I use the Eigen C++ header-only as well as the STL but want none of std:: or Eigen:: appearing in my report. 'profmerge -exclude_funcs std::.,Eigen::.' does not seem to work.
  2. How can I merge multiple .spi files and run codecov against them? E.g. I have a source directory containing .hpp header-only code as well as .c/.h source files. So I get two pgopti.spi files. The first is in src/ and the second is in test/. src/pgopti.spi contains information about the .c code while test/pgopti.c contains information about my .hpp header-only files as they are compiled into my tests.
Thanks,
Rhys
0 Kudos
1 Solution
Dale_S_Intel
Employee
123 Views

1) While there isn't a specific way to disable a namespace, you may be able to do what you want by relying on the full path of the source files of interest. There is a mechanism to exclude functions based on substrings in their path. You can find full details here (around pages 7-8):

http://www.intel.com/SOFTWARE/PRODUCTS/COMPILERS/TECHTOPICS/PGT.HTM

but the short answer is to create a file (foo.txt) that contains a line that contains the path to the root of your project, say
/home/dale/myproject
then run codecov like so:
[cpp]codecov -comp foo.txt
[/cpp]
Now it should only include functions that are in source file under /home/dale/myproject. I believe the functions in std:: should have system header files as their source files, so I think this would work. Of course if you're on windows, the "/"s should be ""s.

2) There isn't an easy way to merge .spi files, but you should be able to set things up in your build so that everything updates the same .spi file by specifying the "prof-dir". You can do this with the option "-prof-dir ". As long as all parts of your build point to the same prof-dir then they should all read and write the same .spi file. You can also specify this by setting an environment variable PROF_DIR.

Does that answer your questions?

Thanks!
Dale

View solution in original post

2 Replies
Dale_S_Intel
Employee
124 Views

1) While there isn't a specific way to disable a namespace, you may be able to do what you want by relying on the full path of the source files of interest. There is a mechanism to exclude functions based on substrings in their path. You can find full details here (around pages 7-8):

http://www.intel.com/SOFTWARE/PRODUCTS/COMPILERS/TECHTOPICS/PGT.HTM

but the short answer is to create a file (foo.txt) that contains a line that contains the path to the root of your project, say
/home/dale/myproject
then run codecov like so:
[cpp]codecov -comp foo.txt
[/cpp]
Now it should only include functions that are in source file under /home/dale/myproject. I believe the functions in std:: should have system header files as their source files, so I think this would work. Of course if you're on windows, the "/"s should be ""s.

2) There isn't an easy way to merge .spi files, but you should be able to set things up in your build so that everything updates the same .spi file by specifying the "prof-dir". You can do this with the option "-prof-dir ". As long as all parts of your build point to the same prof-dir then they should all read and write the same .spi file. You can also specify this by setting an environment variable PROF_DIR.

Does that answer your questions?

Thanks!
Dale

View solution in original post

Rhys_Ulerich
New Contributor I
123 Views
Does that answer your questions?

Absolutely. Thanks Dale!

- Rhys
Reply