[LLVMdev] LLVM Coverage GCDA Flush API

Bill Wendling wendling at apple.com
Wed Feb 6 12:24:51 PST 2013


The reason was due to how gcc uses the __gcov_flush function. I haven't looked at the code in a while, but it might be doable to flush all CUs...

-bw

On Feb 6, 2013, at 12:05 PM, John Harrison <ash.gti at gmail.com> wrote:

> Why does __gcov_flush only flush the current compilation unit? For gcc __gcov_flush flushes all of the loaded files. 
> 
> Is there a way to have __gcov_flush flush everything? 
> 
> --
> John Harrison
> 
> 
> On Wed, Feb 6, 2013 at 10:24 AM, John Harrison <ash.gti at gmail.com> wrote:
> Ah, my mistake. So this already works. I guess that bug is out of date, since this feature works already. 
> 
> --
> John Harrison
> 
> 
> On Wed, Feb 6, 2013 at 10:00 AM, Joshua Cranmer <pidgeot18 at gmail.com> wrote:
> On 2/6/2013 11:43 AM, John Harrison wrote:
> The way `-ftest-coverage -fprofile-arcs` works at the moment it only flushes via `atexit()`. This patch allows you to flush the coverage at any point by calling `__llvm_gcov_flush` the same way `__gcov_flush` works for gcc.
> 
> If there is another way of doing this, I might of missed it but I was looking for `__gcov_flush` and I did not find the equivalent in llvm at the moment.
> 
> __gcov_flush is added by the GCOVProfiling.cpp pass by GCOVProfiler::insertFlush.
> 
> -- 
> Joshua Cranmer
> News submodule owner
> DXR coauthor
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list