- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I would like to generate .dyn files to obtain codecov report following this tutorial. However, I just realize that newer C++ compiler (icpx) does not have the corresponding flag (-pro-gen=srcpos) used by the older one (icpc) to generate the .dyn files. I also tried to use -fprofile-generate tag for icpx, but it generates a different file format (*.profraw), which I guess it cannot be used by profmerge or codecov.
I have been looking for a documentation or similar questions but still couldn't find a solution. Any feedback is appreciated!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try something like this, suppose your source file is test.c
icx -c -fcoverage-mapping -fprofile-instr-generate test.c
icx -c -fprofile-instr-generate -fcoverage-mapping -mllvm -spi-generate -mllvm -spi-filename=test.spi test.c
icx test.o -o test -fprofile-instr-generate
./test
Check where your llvm-profgen is:
icx --print-prog-name=llvm-profgen
It'll tell you something like this: /opt/intel/oneapi/compiler/2024.2/bin/compiler/llvm-profgen
/opt/intel/oneapi/compiler/2024.2/bin/compiler/llvm-profdata merge -o test.profdata *profraw
You should have 2 additional output: default.profraw, test.profdata
/opt/intel/oneapi/compiler/2024.2/bin/compiler/llvm-cov report -format=xml -instr-profile=test.profdata test.spi
You'll get some output about coverage info in xml format.
You can also send the output to another xml file:
/opt/intel/oneapi/compiler/2024.2/bin/compiler/llvm-cov report -format=xml -show-regions-in-xml -instr-profile=test.profdata test.spi > cov.xml
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your response! I would like to try your method, but is there a way to generate .dyn files that can be used by codecov?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
not with icx.
codecov doesn't understand the profile generated by icx

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page