[LLVMdev] code coverage instrumentation

Moshtaghi, Alireza Alireza.Moshtaghi at netapp.com
Thu Apr 9 11:25:14 PDT 2015


Hi
Not sure if this is a clang or llvm related question so I'm sending to both mailing lists.
Anyways, I have few questions regarding size and execution time of instrumented code:
We are trying to run code coverage on memory limited hardware and investigating both (generating gcov output using -coverage and the llvm's own way using -fprofile-instr-generate -fcoverage-mapping clang flags) In my questions I refer to the two methods as llgcov-way and llcovprof-way respectively.

Q1- How come size of instrumented code in llgcov-way turns bigger than llcovprof-way? I would imagine the other way because mapping information would go to *.gcno files.

Q2- The instrumented executable size of both llgcov-way and llcovprof-way (with and without optimization) is bloated 2x to 10x or in some cases 50x depending on the program. Here is output of size command for the variations on a simple test program that I wrote:
   text    data     bss     dec     hex filename
   5625     700    1696    8021    1f55 simpletest.-O0-g.llcovprof.
  12838     776    1808   15422    3c3e simpletest.-O0-g.llgcov.
   1481     492    1616    3589     e05 simpletest.-O0.none
   5337     700    1696    7733    1e35 simpletest.-O1-g.llcovprof.
  12246     776    1792   14814    39de simpletest.-O1-g.llgcov.
   1345     492    1616    3453     d7d simpletest.-O1.none
I was wondering if there is any suggestion for reducing the size either through more optimization or by compromising some feature.

Q3- in llcovprof-way since the runtime profile data is collected in a single file, the file system will serialize multi threaded writes, hence increasing the execution time. Is there a way to avoid this?

Thanks
Ali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150409/d45d4f1c/attachment.html>


More information about the llvm-dev mailing list